Skip to content

Instantly share code, notes, and snippets.

View wjt's full-sized avatar
🚅
Travelling; I will be slow to respond until 17th November.

Will Thompson wjt

🚅
Travelling; I will be slow to respond until 17th November.
View GitHub Profile
#!/usr/bin/gjs
const Lang = imports.lang;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
let file = Gio.file_new_for_path(ARGV[0]);
let monitor = file.monitor_file(Gio.FileMonitorFlags.WATCH_HARD_LINKS, null);
monitor.connect('changed', (monitor, file, otherfile, ev, data) => {
log('file changed with event ' + ev);
});
wjt@tensionsheet-redux:/tmp$ gdb ./foo
GNU gdb (Endless 8.2-1bem1) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
/org/freedesktop/UDisks2/Manager:
org.freedesktop.UDisks2.Manager:
SupportedFilesystems: ext2
ext3
ext4
vfat
ntfs
exfat
xfs
reiserfs
/org/freedesktop/UDisks2/Manager:
org.freedesktop.UDisks2.Manager:
SupportedFilesystems: ext2
ext3
ext4
vfat
ntfs
exfat
xfs
reiserfs
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 0c248532..b4923bb6 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -7849,7 +7849,6 @@ flatpak_dir_install (FlatpakDir *self,
}
else
{
- g_autofree gchar *arg_socket = NULL;
g_autoptr (GError) local_error = NULL;
$ git diff --stat origin/gnome-3-10..
.tx/config | 9 +
gnome-help/C/figures/gnome-change-wallpaper.webm | Bin 1092978 -> 0 bytes
.../C/figures/gnome-launching-applications.webm | Bin 1665619 -> 0 bytes
.../C/figures/gnome-responding-to-messages.webm | Bin 2448644 -> 0 bytes
gnome-help/C/figures/gnome-task-switching.webm | Bin 2268009 -> 0 bytes
gnome-help/C/figures/gnome-timezone.webm | Bin 1262984 -> 0 bytes
.../C/figures/gnome-windows-and-workspaces.webm | Bin 3965424 -> 0 bytes
gnome-help/C/getting-started.page | 292 --
gnome-help/C/gs-browse-web-firefox.page | 76 -
$ sudo bindfs --force-user=1000 --create-for-user=root --create-for-group=root /var/tmp/real /var/tmp/fake
$ cat >/var/tmp/fake/rootme.c
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int
main (int argc, char **argv)
{
printf ("getuid () == %u; geteuid () == %u\n", getuid (), geteuid ());
ptygoop: ptygoop.c Makefile
gcc -o $@ $< `pkg-config --cflags --libs glib-2.0` -Wall -Wextra -Werror
@wjt
wjt / 00-README.md
Last active November 23, 2018 10:15

Demonstrates that unmounting a filesystem with MNT_DETACH allows open file descriptors on that filesystem to be inherited by new children of processes than already held them open. I believe this is expected behaviour from the definition of the flag in man 2 umount2.

Steps:

$ gcc -o forkme forkme.c
$ mkdir /tmp/real /tmp/bind
$ sudo mount --bind /tmp/real /tmp/bind
$ ./forkme /tmp/bind/foo
[ wait for confirmation that it has opened &amp; written to the file ]
In eos-factory-reset line 3:
cmd_name=$(basename $0)
^-- SC2086: Double quote to prevent globbing and word splitting.
In eos-factory-reset line 20:
if [ $? != 0 ]; then
^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.