1 --- autofs-4.1.4/daemon/automount.c.no-unlink 2005-07-11 13:28:57.000000000 -0500
2 +++ autofs-4.1.4/daemon/automount.c 2005-07-11 13:50:46.000000000 -0500
3 @@ -216,16 +216,38 @@ static int walk_tree(const char *base, i
4 static int rm_unwanted_fn(const char *file, const struct stat *st, int when, void *arg)
6 int rmsymlink = *(int *) arg;
10 if (st->st_dev != ap.dev)
13 - info("rm_unwanted: %s\n", file);
14 - if (S_ISDIR(st->st_mode))
16 - else if (!S_ISLNK(st->st_mode) || rmsymlink)
21 + if (lstat(file, &newst)) {
22 + crit ("rm_unwanted: unable to stat file, possible race "
27 + if (newst.st_dev != ap.dev) {
28 + crit ("rm_unwanted: file %s has the wrong device, possible "
29 + "race condition.",file);
33 + if (S_ISDIR(newst.st_mode)) {
35 + info ("rm_unwanted: unable to remove directory"
39 + } else if (S_ISREG(newst.st_mode)) {
40 + crit ("rm_unwanted: attempting to remove files from a mounted "
43 + } else if (S_ISLNK(newst.st_mode) && rmsymlink) {