Changeset 2234


Ignore:
Timestamp:
Dec 6, 2012, 5:30:27 PM (6 years ago)
Author:
matthijs
Message:

mountd: Don't recursively clean /tmp/mounts.

rm -rf completely cleans out the directory, including any filesystems
that are mounted under /tmp/mounts. This should not normally happen, but
users that want to make remote network shares available on their Fonera
tend to mount them under /tmp/mounts and if they do this before mountd
is started, they might find their network share empty after rebooting
the Fonera.

Since this rm is mostly there "just in case" and since there should
normally only be symlinks in /tmp/mounts, we can change it into a
non-recursive version that will leave any mounted filesystems alone.

Note that another option would be to use rm -rf --one-file-system, but
Busybox' rm doesn't support this option. Using find -xdev -delete also
doesn't work, due to https://bugs.busybox.net/show_bug.cgi?id=5756

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fon/mountd/src/lib/autofs.c

    r2233 r2234  
    215215        mkdir("/tmp/run/", 0555);
    216216        mkdir(uci_path, 0555);
    217         system_printf("rm -rf %s*", uci_path);
     217        system_printf("rm -f %s*", uci_path);
    218218        if(uci_timeout < 16)
    219219                uci_timeout = 16;
Note: See TracChangeset for help on using the changeset viewer.