Karel Zak [Wed, 12 Sep 2012 12:27:12 +0000 (14:27 +0200)]
libmount: don't remove user= when executed by root
The original mount(8) allows to store arbitrary user= option to mtab
file if called by root user. For example:
# mount -f foo /bar -t xxx -o rw,user=kzak
the new mount removes the 'user=' and 'users' options at all for root
user. This is regression. The original functionality is necessary by
'sshfs' where fuse writes to mtab file by mount(8).
Reported-by: Juergen Daubert <jue@jue.li> (and 'horrorStruck' on IRC) Signed-off-by: Karel Zak <kzak@redhat.com>
Ludwig Nussel [Tue, 11 Sep 2012 08:46:11 +0000 (10:46 +0200)]
mount: losetup: remove obsolete encryption support
kernel cryptoloop is deprecated since ages and support for cryptoloop
in util-linux is incomplete/broken.
- no password hashing
- last 8 bit of key are always set to zero
- no binary keys possible (stops reading key at \n and \0)
In the past some Distros added the above features with patches. So
remove cryptoloop support from util-linux completely to make sure
people won't try using it.
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 11 Sep 2012 07:30:16 +0000 (09:30 +0200)]
libblkid: fix copyright noticed to be consistent (so all are LGPL)
The libblkid library was intended to be released under the LGPL.
There is very little significant code in version.c; just a version
parser, and the original copyright holder (Theodore Ts'o,
tytso@mit.edu) has confirmed that he had intended to relicense all of
the files under the LGPL during a time when he was the sole author.
Acked-by: "Theodore Ts'o" <tytso@mit.edu> Reported-by: John Calcote <john.calcote@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 29 Aug 2012 15:34:26 +0000 (17:34 +0200)]
runuser: new command (derived from su(1))
This command is based on su(1), the differences:
- based on Fedora runuser su(1) patch
- not installed with suid rights
- allowed for root users only
- don't ask for password
- uses PAM session, for example:
Karel Zak [Tue, 28 Aug 2012 14:32:28 +0000 (16:32 +0200)]
su: add --group and --supp-group options
These options allow to specify alternative groups. The command
su(1) has to be executed by root. The implementation is based on
Fedora runuser(1) command.
For example:
# su --group=kzak --supp-group=uuidd -
# id
uid=0(root) gid=1000(kzak) groups=0(root),985(uuidd),1000(kzak)
non-root user:
$ su --group=kzak -
su: only root can specify alternative groups
disk-utils/fsck.cramfs.c: In function ‘test_crc’:
disk-utils/fsck.cramfs.c:231:32: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
disk-utils/fsck.cramfs.c:233:24: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
Dave Reisner [Mon, 20 Aug 2012 10:06:17 +0000 (06:06 -0400)]
findmnt: use st.st_bavail for available column
This matches more closely with what 'df -h' reports as space available.
Any remaining discrepancy between these 2 tools is a result of precision
and choices in rounding.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Karel Zak [Mon, 27 Aug 2012 17:26:07 +0000 (19:26 +0200)]
libmount: remount does not add entry to mtab file
# mount -n -o ro /dev/sda1 /
# mount -o remount,rw /dev/sda1 /
For the backward compatibility the command mount(8) should to add a
new entry to the file /etc/mtab on remount if the original entry not
found (because previous mount has been called with -n).
Reported-by: <frinnst> on IRC Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 27 Aug 2012 15:38:24 +0000 (17:38 +0200)]
libblkid: rewrite ntfs prober
- use regular NTFS bios parameters block
- don't care about mirror cluster location
- remove unnecessary macros
- add more checks (based on Linux kernel code)
Karel Zak [Fri, 24 Aug 2012 16:41:50 +0000 (18:41 +0200)]
fsck: use less aggressive method to detect mounted devices
We should not care about mountpoints in fsck if a device name
specified on command line, just check if the device is used somewhere
in /proc/self/mountinfo file.
Crazy people who use
fsck /mountpoint
have to specify the mountpoint by the same format as in their fstab --
symlinks canonicalization is not supported.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=850965 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 24 Aug 2012 16:13:06 +0000 (18:13 +0200)]
libmount: rewrite mnt_table_is_fs_mounted() to be less aggressive
The old implementation always canonicalizes target (mountpoint) path.
It's better to postpone this operation until the path is really
necessary (usually it's unnecessary), because readlink() on mountpoint
may trigger automounts.
Karel Zak [Tue, 14 Aug 2012 23:53:40 +0000 (01:53 +0200)]
build-sys: expand paths at make time
autoconf docs about *dir variables (e.g bindir):
... A corollary is that you should not use these variables except in
makefiles...
...you should not rely on AC_CONFIG_FILES to replace bindir and friends
in your shell scripts and other files; instead, let make manage their
replacement.
Looks like a simple case of missing has_arg flag in the "struct
option" initialization for these two options. The patch just adds the
flag. I haven't done thorough testing of the patched code, but it
seems to work OK and it no longer segfaults or tries to dereference a
null pointer.
Samuel Thibault [Wed, 8 Aug 2012 15:19:43 +0000 (17:19 +0200)]
Fix non-Linux build
loopdev.c, test_pager, and get_max_number_of_cpus() are linux-specific.
get_linux_version will only work on Linux, let's introduce
system_supports_ext4_ext2() which assumes that mounting ext2 with ext4
is not supported on non-Linux systems.
[kzak@redhat.com: - use #ifdef SYS_sched_getaffinity rather than __linux__]
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 13 Aug 2012 12:23:04 +0000 (14:23 +0200)]
lib/tt: always escape '\' to simplify parsing in scripts
The commands echo(1) and printf(1) are usable for escape sequences
decoding, for example
for x in $(findmnt --noheading --raw --output TARGET); do
printf "%b" $x
done
but it's necessary to escape all '\' chars, otherwise for example \b
in foo\bar will be interpreted as backspace. It means that for example
findmnt(8) has to use \x5c for the backslash.
Sami Kerola [Sat, 4 Aug 2012 07:33:40 +0000 (09:33 +0200)]
vipw: make vim writebackup mode work
Some editors, such as Vim with 'writebackup' mode enabled, use "atomic
save" in which the old file is deleted and a new one with the same name
created in its place. The vipw tries to detect if such happen by
looking hard temporary file link count, when it is zero reopen
temporary file by using it's path.
Reported-by: Mantas Mikulėnas <grawity@gmail.com>
References: http://www.spinics.net/lists/util-linux-ng/msg06666.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 4 Aug 2012 07:33:38 +0000 (09:33 +0200)]
docs: add sys-utils/umount.8 manual page
The man page is almost exact copy of mount-deprecated/umount.8. This
version mentions long options, and has the options in same order as
they are mentioned in usage() output. Rest of the minor changes make
groff slightly nicer e.g. use .PP instead of empty line for paragraph
marker.