summaryrefslogtreecommitdiffstats
path: root/mount
Commit message (Collapse)AuthorAgeFilesLines
* mount: add acl option documentation for ext3 and reiserfsMatthias Koenig2007-07-161-0/+21
| | | | Signed-off-by: Matthias Koenig <mkoenig@suse.de>
* lomount.c: don't use mlockall if CRYPT_NONEMasatake YAMATO2007-07-101-6/+7
| | | | | | | | | | | | | | | loop back mounting emits two system calls: mount and mlockall. mount is obviously needed. mlockall is needed for encryption. As the result both CAP_SYS_ADMIN and CAP_IPC_LOCK are needed to do loopback mounting. The problem is that CAP_IPC_LOCK is always needed through my command doesn't need encryption. With the following patch, mount calls mlockall only when encryption is needed. Signed-off-by: Masatake YAMATO <jet@gyve.org>
* man pages: add "AVAILABILITY" sectionKarel Zak2007-07-036-0/+19
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use loop= option when mounting by /sbin/mount.<type>Karel Zak2007-07-021-2/+3
| | | | | | | The mount(8) calls external mount programs (/sbin/mount.<type>) without the loop=/dev/loopN option. This patch fix this bug. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: needs to handle special mountprog even on guessed file systems.Karel Zak2007-06-283-19/+40
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: add long options and fix man pageKarel Zak2007-06-272-33/+52
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: loop device race conditionMatthias Koenig2007-06-271-5/+18
| | | | | | | | | Fix race in losetup Retry acquiring a loop device if set_loop failed with EBUSY Signed-Off-By: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: loop device race conditionMatthias Koenig2007-06-272-13/+46
| | | | | | | | | Fix race in mount -o loop Retry acquiring a loop device if the setup failed with EBUSY. Signed-Off-By: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use encoded labels for volume_idKay Sievers2007-06-261-10/+19
| | | | | | The current version of libvolume_id exports the encoding function for the symlinks names, so slashes in labels and other chars, that don't really fit into symlink names, will work as expected with LABEL=.
* losetup: add a new option -sKarel Zak2007-06-182-4/+18
| | | | | | | | | | | | | | | | | | The losetup provides an -f option to discover an unused loop device. As implemented, it is racy. The problem is that -f prints the loop device to stdout only when used standalone. This means a script has to do: lodev=$(losetup -f) losetup $lodev $filename which is racy if another script may be running. This patch add a new option '-s'. The '-s' option prints device name if the -f option and a file argument are present. For example: lodev=$(losetup -f -s $filename) Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: rewrite getfs_by_specdir() without mem leaksKarel Zak2007-06-151-26/+32
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix typo in error messageKarel Zak2007-06-151-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: cleanup PATH_ macros and tailing white-spacesKarel Zak2007-06-142-12/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: fix swapon headers and syscallsMike Frysinger2007-06-131-29/+13Star
| | | | | | | | | | | | | | This patch scrubs anything related to SWAPON_NEEDS_TWO_ARGS as this is only relevant for < linux-1.3.2 and i say it's about time we let it go. I also cleaned up the system call fallback logic as the _syscall#() macros are the deprecated interface in favor of the real syscall() function. The asm/page.h gets the boot as nothing in swapon.c utilizes defines from it while unistd.h gets always included as defines/functions are used from it other than just swapon(). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* mount: clean up info about NFS in mount.8Karel Zak2007-05-301-80/+19Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add note about fcntl/ioctl unreliability on NFS to mount.8Karel Zak2007-05-301-0/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add note about /etc/mtab unreliability to mount.8Karel Zak2007-05-301-0/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add support for mixed usage of SPECesKarel Zak2007-05-301-51/+102
| | | | | | | | | | | | | | | | | | | | | | | This patch improves a way how the mount works with SPECes (devname, LABEL or UUID) and nodes (mountpoints) from command line. The patch adds support for mixed usage of SPECes -- it means on command line is different SPEC than in the /etc/fstab file. For example: command line: mount LABEL=foo fstab: UID=915b048a-998d-4ee5-9e6b-7fcaaf34d3c5 /mnt/foo auto default The mount command doesn't strictly require same SPEC on command line and in fstab anymore. You can be more creative and mix UUID, LABEL or device name. This implementation is more effective that convert *all* entries from /etc/fstab to a real devnames. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: getfs_* (fstab) interface has to work with canonicalize()Karel Zak2007-05-281-2/+21
| | | | | | | The getfs_by_dir() and getfs_by_devname() have to be able to work with canonicalized and also with non-canonicalized paths. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use verbose mode instead debug modeKarel Zak2007-05-252-41/+25Star
| | | | | | | | | | | | | The patch: commit 61d9d2ff1cb0e28e2b88099bbc5b919fa5004fce Date: Wed Dec 27 23:35:56 2006 +0100 added debug mode to the mount command. It was mistake. It's better to use old verbose mode instead a new debug mode. This patch transform all staff from debug mode to to verbose mode. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: parse SPEC before search in fstabKarel Zak2007-05-251-0/+18
| | | | | | | | The mount blindly uses a SPEC from command line and tries to found the SPEC in /etc/fstab. It's better to parse the SPEC and search by UUID, LABEL or devname only. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: clean up getfs* (fstab.c) interfaceKarel Zak2007-05-254-32/+45
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: factor out common parts from mount/Makefile.amStepan Kasal2007-05-221-21/+16Star
| | | | | Signed-off-by: Stepan Kasal <skasal@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fsprobe: add libvolume_id supportKarel Zak2007-05-184-3/+138
| | | | | | Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix has_* functions (CVE-2007-0822)Karel Zak2007-05-171-2/+8
| | | | | | The functions have to check for NULL pointer. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fsprobe: use blkid cache only when really necessaryKarel Zak2007-05-171-10/+45
| | | | | | | The blkid_get_cache() parses /etc/blkid.tab, it's better do it only when we really need to resolve a spec (label or uuid). Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fsprobe: make fsprobe_get_devname functions more genericKarel Zak2007-05-176-12/+103
| | | | | | | | | | | The blkid supports NAME=value parsing, but use the library for this simple task is overkill. (The libblkid requires initialized blkid cache all time, for all calls.) This patch makes the fsprobe_get_devname_for_mounting() and fsprobe_get_devname() generic for all fsprobe implementations. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fsprobe: rename the rest of API routines to fsprobe_*Karel Zak2007-05-175-53/+77
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fsprobe: remove mount_guess_fstype.{c,h}Karel Zak2007-05-177-102/+77Star
| | | | | Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fsprobe: remove non-blkid codeKarel Zak2007-05-1710-1389/+6Star
| | | | | | | This patch removes old FS detection code and enables blkid code only when HAVE_BLKID is defined. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fsprobe: rename files to fsprobe_*Karel Zak2007-05-177-8/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: kill mount_guess_rootdevStepan Kasal2007-05-164-100/+1Star
| | | | | | It's not used. Signed-off-by: Stepan Kasal <skasal@redhat.com>
* build-sys: remove swapargs.h, move the tests to main configure.acStepan Kasal2007-05-163-46/+6Star
| | | | | | | Do not use header swapargs.h, generated by script swap.configure; use the standard AC_DEFINE method in configure.ac. Signed-off-by: Stepan Kasal <skasal@redhat.com>
* build-sys: move -D flags to *_CPPFLAGSStepan Kasal2007-05-161-2/+2
| | | | | | | Preprocessor options belong to *_CPPFLAGS; add $(AM_CPPFLAGS) as we want to amend it, not override. Signed-off-by: Stepan Kasal <skasal@redhat.com>
* swapon: simplify an #ifStepan Kasal2007-05-161-6/+1Star
| | | | | | Replace two immerced #ifdef's by an #if with a compound conditional. Signed-off-by: Stepan Kasal <skasal@redhat.com>
* build-sys: mount/Makefile.am tiny cleanup IIStepan Kasal2007-05-161-7/+9
| | | | | | Style change: init the *_LDADD vars, then amend them with +=. Signed-off-by: Stepan Kasal <skasal@redhat.com>
* build-sys: do not build convenience libraries in lib/Stepan Kasal2007-05-161-4/+4
| | | | | | | Build lib/*.c individually for each project which uses it, so that the right set of flags is applied each time. Signed-off-by: Stepan Kasal <skasal@redhat.com>
* build-sys: mount/Makefile.am tiny cleanupStepan Kasal2007-05-161-11/+6Star
| | | | | | | Major part of mount_SOURCES and umount_SOURCES is the same; factor it out to a new make variable. Signed-off-by: Stepan Kasal <skasal@redhat.com>
* build-sys: add SUID_LDFLAGSStepan Kasal2007-05-161-0/+2
| | | | | | | Programs which are usually installed with the setuid bit do need their own CFLAGS and LDFLAGS. SUID_LDFLAGS is analogic to SUID_CFLAGS. Signed-off-by: Stepan Kasal <skasal@redhat.com>
* build-sys: do not kick off AM_CFLAGS by SUID_CFLAGSStepan Kasal2007-05-161-2/+2
| | | | | | | SUID_CFLAGS are not meant to override the makefile-wide AM_CFLAGS. (We do not use AM_CFLAGS currently, but we will.) Signed-off-by: Stepan Kasal <skasal@redhat.com>
* mount: remove nfsmount() from sundries.hKarel Zak2007-05-111-3/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: remove all NFS codeKarel Zak2007-05-0916-4077/+3Star
| | | | | | | | | | Use /sbin/{u,}mount.nfs{,4} from nfs-utils! The mount command will use these to mount nfs filesystems instead of internal code. The /sbin/{u,}mount.nfs{,4} is supported from nfs-utils-1.1.0 (currently -rc1). Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add support for context, fscontext and defcontext selinux mount optionsKarel Zak2007-05-043-9/+146
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use realloc for xstrconcat functionsKarel Zak2007-05-043-48/+49
| | | | | | | | | | Everywhere in code is s = xstrconcat3(s, t, u); that's nonsense use malloc(new_s); free(s); return new_s; Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use growable string for optionsKarel Zak2007-05-041-51/+60
| | | | | | | | | | | The parse_opt() routine uses fixed size of string for mount options. This is useless for future selinux options where is not well defined size of selinux context name. The patch also makes code more readable and all option-string operations share same code. Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: avoid duplicate entries in mtab when mount -fKarel Zak2007-05-022-1/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: doesn't rpc_pipefs and nfsd on umount -aKarel Zak2007-04-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix list logic in update_mtabKarel Zak2007-04-261-1/+6
| | | | | | | | | | | | | | | | | If mtab does not contain the new entry, then only mc0->prev is updated to point to absent, but not the old mc0->prev's nxt pointer. Because we then use the nxt pointers to write the new mtab, absent is not added to the new mtab. (Note: fortunately, the mount doesn't use the update_mtab() for new mounts, but for remount, move and umount only -- kzak) If mtab is empty, absent->prev should be set to mc0, and not mc0->prev, as it will be NULL. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Martin Schlemmer <azarah@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix memory usage in update_mtabMike Frysinger2007-04-261-8/+23
| | | | | | | | | | | | The update_mtab deallocates memory which was allocated by caller. It's nice opportunity for double-free errors. The patch fix a memory leak if we have to abort before mc0 are freed. The patch also fix a memory leak when we deallocate old (umounted) entry. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Martin Schlemmer <azarah@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: do not treat arm/sparc specially.Mike Frysinger2007-04-251-1/+1
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Martin Schlemmer <azarah@gentoo.org>