1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 079_no_unlink_upstream.dpatch
8 diff -Naur .B/daemon/automount.c .A/daemon/automount.c
9 --- .B/daemon/automount.c 2007-01-07 21:36:36.000000000 +0000
10 +++ .A/daemon/automount.c 2007-01-07 21:36:37.000000000 +0000
12 static int rm_unwanted_fn(const char *file, const struct stat *st, int when, void *arg)
14 int rmsymlink = *(int *) arg;
18 if (st->st_dev != ap.dev)
21 - info("rm_unwanted: %s\n", file);
22 - if (S_ISDIR(st->st_mode))
24 - else if (!S_ISLNK(st->st_mode) || rmsymlink)
29 + if (lstat(file, &newst)) {
30 + crit ("rm_unwanted: unable to stat file, possible race "
35 + if (newst.st_dev != ap.dev) {
36 + crit ("rm_unwanted: file %s has the wrong device, possible "
37 + "race condition.",file);
41 + if (S_ISDIR(newst.st_mode)) {
43 + info ("rm_unwanted: unable to remove directory"
47 + } else if (S_ISREG(newst.st_mode)) {
48 + crit ("rm_unwanted: attempting to remove files from a mounted "
51 + } else if (S_ISLNK(newst.st_mode) && rmsymlink) {