summaryrefslogtreecommitdiffstats
path: root/utils/mount/fstab.c
Commit message (Collapse)AuthorAgeFilesLines
* umount.nfs: fix nfs4 checkIan Kent2011-08-291-0/+52
| | | | | | | | | | | | | | | | From: Ian Kent <ikent@redhat.com> nfs_umount_is_vers4() doesn't take acount of the escaping of characters seen in /proc/mounts and /etc/mtab as the functions in fstab.c do. This leads to an inability to umount a mount containing any of these escaped characters (like spaces). This patch changes nfs_umount_is_vers4() to use functions in fstab.c and adds a function to fstab.c to read /proc/mounts specifically, as it was used for the check in nfs_umount_is_vers4() previously. Signed-off-by: Ian Kent <ikent@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount: improve signal management when locking mtabNeilBrown2011-06-291-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As mount.nfs can run setuid it must be careful about how the user can interact with in. In particular it needs to ensure it does not respond badly to any signals that the user might be able to generate. This is particularly an issue while updating /etc/mtab (when that is not linked to /proc/mounts). If the user can generate a signal which kills mount.nfs while /etc/mtab is locked, then it will leave the file locked, and could possibly corrupt mtab (particularly if 'ulimit 1' was previously issued). Currently lock_mtab does set some handlers for signals, but not enough. It arranges for every signal up to (but not including) SIGCHLD to cause mount.nfs to unlock mdadm promptly exit ... even if the default behaviour would be to ignore the signal. SIGALRM is handled specially, and signals after SIGCHLD are left with their default behaviour. This includes for example SIGXFSZ which can be generated by the user running "ulimit 1". So: change this so that some signals are left unchanged, SIGALRM is handled as required, and all signals that the user can generate are explicitly ignored. The remainder still cause mount.nfs to print a message, unlock mtab, and exit. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Eliminate compiler warningsChuck Lever2010-10-141-13/+16
| | | | | | | | | | | | | | | | | | | | Clean up. fstab.c: In function ?lock_mtab?: fstab.c:385: warning: declaration of ?errsv? shadows a previous local fstab.c:367: warning: shadowed declaration is here fstab.c:407: warning: declaration of ?errsv? shadows a previous local fstab.c:367: warning: shadowed declaration is here fstab.c:417: warning: declaration of ?tries? shadows a previous local fstab.c:325: warning: shadowed declaration is here fstab.c:422: warning: declaration of ?errsv? shadows a previous local fstab.c:367: warning: shadowed declaration is here These are probably harmless. Reusing a variable name, however, is a little confusing to follow when reading the code. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Fix source code character encodingChuck Lever2010-09-271-1/+1
| | | | | | | | | | | | | Minor clean up. Most modern Linux distributions set UTF-8 locales. Standardize the character encoding of source files on UTF-8, to squelch vim com- plaints. I probably missed a few spots. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Squelch unused parameter warnings on empty functionsChuck Lever2009-07-141-1/+1
| | | | | | | | | | | | | Address compiler warnings: fstab.c:288: warning: unused parameter sig parse_dev.c:186: warning: unused parameter dev parse_dev.c:187: warning: unused parameter hostname parse_dev.c:187: warning: unused parameter pathname Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* In recent Fedora builds, the '-D _FORTIFY_SOURCE=2' compileSteve Dickson2009-03-231-2/+6
| | | | | | | | flag has been set. This cause warnings to be generated when return values from reads/writes (and other calls) are not checked. The patch address those warnings. Signed-off-by: Steve Dickson <steved@redhat.com>
* Ported the create_mtab() routine from util-linux-ng as wellChristiaan Welvaart2008-07-151-0/+5
| | | | | | | | some add_mtab() updates to better hand the instances where /etc/mtab does not exist or is not writable Signed-off-by: Christiaan Welvaart <cjw@daneel.dyndns.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: clean up a couple of printfs in fstab.cChuck Lever2007-07-301-9/+12
| | | | | | | Clean up for consistent use. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: eliminate another dependency on a global variableChuck Lever2007-07-301-0/+555
The file support/nfs/fstab.c, which is linked into libnfs.a, depends on the global variable "verbose." This variable is defined and used only in the mount command, and the functions in fstab.c are used only by the mount command. Move fstab.c and support/include/fstab.h to utils/mount. This file placement is also consistent with at least one other mount helper, mount.ocfs2. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>