Adapt the example to pass the variables as arguments to the configure
script, as this is the prefered way. And a few cosmetic changes to the
paragraph.
Signed-off-by: Stepan Kasal <skasal@redhat.com>
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>
The optimization flags are not preprocessor flags.
Moreover, CPPFLAGS and CFLAGS shall be overridable at make time, the
configure script shall not touch them.
Setting AM_CFLAGS in config/include-Makefile.am seems to be TRW.
Signed-off-by: Stepan Kasal <skasal@redhat.com>
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>
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>
"automake" calls "autoconf" internally, to trace the expansion of
configure.ac. So it is more natural to call "autoconf" before
"automake".
Signed-off-by: Stepan Kasal <skasal@redhat.com>
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>
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>
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>
The dmesg, ipcrm, ipcs, renice and setsid are user-accessible commands
and belong in man1 more than to man8.
Signed-off-by: Karel Zak <kzak@redhat.com>
The patch allows to define special CFLAGS for typical suid programs
(like mount, umount, chfn, ...). Some distributions use for example
"-fpic" for suid binaries.
Signed-off-by: Karel Zak <kzak@redhat.com>
The helper is an external /sbin/umount.<suffix> program where the
suffix is a value from the uhelper= option from /etc/mtab.
The uhelper (unprivileged umount helper) is possible to used when
non-root user wants to umount a mountpoint which is not defined in the
/etc/fstab file (e.g devices mounted by HAL).
This option is already supported by HAL upstream.
Signed-off-by: Karel Zak <kzak@redhat.com>
This is temporary workaround and it will be removed in 2.14 when
minimal number of people will use old systems where is not defined
SCHED_BATCH in (bits/)sched.h.
Signed-off-by: Karel Zak <kzak@redhat.com>
Add the "relatime" (relative atime) option support to mount. Relative
atime only updates the atime if the previous atime is older than the
mtime or ctime. Like noatime, but useful for applications like mutt
that need to know when a file has been read since it was last
modified.
Cc: Adrian Bunk <bunk@stusta.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Karel Zak <kzak@redhat.com>
Signed-off-by: Valerie Henson <val_henson@linux.intel.com>
This patch builds shared-subtree semantics awareness into the mount
command. Updates the man page for mount too.
The patch also fix a conflict between MS_COMMENT and MS_UNBINDABLE
(-- kzak).
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
* the lock function uses F_SETLK / F_SETLKW as a conditional wait.
It's more reliable and better for performance to close the
MOUNTED_LOCK file in unlock_mtab(), otherwise concurrent process will
be wait by while () { link() } loop instead on fcntl(F_SETLKW).
Thanks to Jeff Moyer <moyer@redhat.com> who found the problem two
year ago.
* when open(MOUNTED_LOCK) failed, we need to try everything again, but
the original code didn't zeroize "we_created_lockfile" and the old
version in particular case left lock_mtab() without locked /etc/mtab.
This is nasty bug.
* the original locking code had bad performance due too long sleep
(1s), between attempts. Now we're more aggressive and we use
5000ms. The result is that more processes is able to lock mtab in
short time slice.
Thanks to Peter Rockai <prockai@redhat.com> who found the problem
and suggest a first version of the code with usleep.
* now we don't count number of attempts anymore, but we count sum of
time which we spend in the mtab_lock(). The number of attempts is
not important (and it also depends on CPU performance, load,
scheduler, ...), the important thing is how long we spend with
locking. Now time limit is 30s.
Signed-off-by: Karel Zak <kzak@redhat.com>
This feature has been already supported by mount, but it wasn't accessible by
losetup command. Now you can use "losetup -r".
Signed-off-by: Karel Zak <kzak@redhat.com>