Commit Graph

5464 Commits

Author SHA1 Message Date
Karel Zak cf1a99dacc su: move generic su code to su-common.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 17:00:30 +02:00
Karel Zak 8528ea2f81 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

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 17:00:30 +02:00
Karel Zak 4e1073c23b build-sys: add configure summary
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 16:49:28 +02:00
Karel Zak 0825179f47 col: fix compiler warning [-Wstrict-prototypes]
text-utils/col.c:142:43: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 16:49:28 +02:00
Karel Zak aa71999827 fsck.cramfs: fix compiler warning [-Wpointer-arith]
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]

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 16:49:28 +02:00
Karel Zak dcd33c3e15 build-sys: add another compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 16:49:28 +02:00
Karel Zak d39c2b438f libmount: use O_CLOEXEC everywhere
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 16:49:28 +02:00
Karel Zak 49a8f58e48 libblkid: use O_CLOEXEC
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 16:49:28 +02:00
Karel Zak 58e6e67ad5 build-sys: release++ (v2.22)
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 14:57:28 +02:00
Karel Zak 7271beff67 docs: update v2.22-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 14:36:16 +02:00
Karel Zak 5bbbd94258 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 14:23:25 +02:00
Trần Ngọc Quân d89b8d0f5a po: update vi.po (from translationproject.org) 2012-09-04 13:51:16 +02:00
Yuri Chornoivan 3827f47148 po: update uk.po (from translationproject.org) 2012-09-04 13:51:15 +02:00
Jakub Bogusz 511340b0d1 po: update pl.po (from translationproject.org) 2012-09-04 13:51:15 +02:00
Benno Schulenberg fe4179d9af po: update nl.po (from translationproject.org) 2012-09-04 13:51:15 +02:00
Takeshi Hamasaki 4396767254 po: update ja.po (from translationproject.org) 2012-09-04 13:51:15 +02:00
David Prévot e03969ba5d po: update fr.po (from translationproject.org) 2012-09-04 13:51:15 +02:00
Joe Hansen 770eda85e9 po: update da.po (from translationproject.org) 2012-09-04 13:51:15 +02:00
Petr Písař 1e313c7fb7 po: update cs.po (from translationproject.org) 2012-09-04 13:51:15 +02:00
Davidlohr Bueso 24505fb241 fdisk: document FDISK_DEBUG
Add the corresponding entry in the manpage.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-09-04 12:48:23 +02:00
Bernhard Voelker eab4028f38 fdisk: fix typo in comment
* fdisks/utils.c: s/firts/first/: found by misspellings.
s/Zero's/Zeros/: denoted by Pdraig Brady <P@draigBrady.com>.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-09-04 12:45:31 +02:00
Dave Reisner ed6c8c1b61 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>
2012-09-04 12:43:28 +02:00
Karel Zak 22b49b33df su: cleanup man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-29 18:05:31 +02:00
Karel Zak c3085df65f 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>
2012-08-27 19:26:07 +02:00
Karel Zak 1abde0cdbc 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)

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-27 17:38:24 +02:00
Karel Zak 7d447a811e libblkid: use unsigned ints in ntfs prober
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-27 15:13:41 +02:00
Karel Zak 7a4f988542 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>
2012-08-24 19:20:33 +02:00
Karel Zak 975e14bd4a 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.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-24 18:29:51 +02:00
Karel Zak 123011de33 build-sys: release++ (v2.22-rc2)
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-15 20:04:52 +02:00
Karel Zak da42129daa docs: update v2.22-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-15 18:02:53 +02:00
Karel Zak 59c748fb3d docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-15 17:59:56 +02:00
Karel Zak fc44048eb9 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-15 17:56:47 +02:00
David Prévot f80a95f09a po: update fr.po (from translationproject.org) 2012-08-15 17:09:47 +02:00
Karel Zak b1b54edf95 build-sys: add -Wmissing-declarations, sort warning options
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-15 17:04:41 +02:00
Karel Zak 361bdcf3c9 tests: update build-sys tests
- remove tests programs (no more compiled by default)
 - add resizepart

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-15 16:44:18 +02:00
Karel Zak 7011f487c5 uuidd: improve systemd unit files
- use $usrsbin_execdir
 - add [Install] section
 - use long options

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-15 16:06:19 +02:00
Karel Zak d4baf92e50 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.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-15 02:06:53 +02:00
B Watson 43f8915c51 column: --separator segfaults
The --separator and --columns long options in util-linux-2.21.2 and in
a git clone from 5 minutes ago, don't work:

$ echo foobar | column -s x
foobar

$ echo foobar | column -c 10
foobar

$ echo foobar | column --separator=x
column: option '--separator' doesn't allow an argument

$ echo foobar | column --separator x
Segmentation fault

$ echo foobar | column --columns 10
column: bad columns width value: '(null)': Invalid argument

$ echo foobar | column --columns=10
column: option '--columns' doesn't allow an argument

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.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-14 18:27:09 +02:00
Bernhard Voelker f31322a289 lib/sysfs: make sysfs_partno_to_devno better readable
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-08-14 18:22:04 +02:00
Karel Zak 88ca32b38b lsblk: add WWN, improve udev support
* read WWN from udev DB

 * use *_ENC properties from udev DB to get original unmodified
   strings (otherwise for example blank space is replaced with '_' in
   ID_FS_LABEL)

 * always read from udev, libblkid is fallback solution only

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-14 18:15:38 +02:00
Karel Zak 8651b6a70a resizepart: remove debug message
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-14 08:33:39 +02:00
Karel Zak 8863a802eb resizepart: add new command
This is a simple wrapper for BLKPG_RESIZE_PARTITION (since kernel 3.6).

Co-Author: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-13 22:10:14 +02:00
Karel Zak 778ad369f6 lib/sysfs; add sysfs_partno_to_devno()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-13 22:06:18 +02:00
Karel Zak f369387731 lib/mangle: remove unused variable
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-13 21:57:34 +02:00
Karel Zak a3b780532f lib/sysfs: expect p<N> suffix for partitions
... so for example lsblk(8) will see partitioned loop devices

loop0       7:0    0    80G  0 loop
├─loop0p1 259:0    0   100M  0 loop
└─loop0p2 259:1    0  79.9G  0 loop

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-13 21:11:37 +02:00
Karel Zak 096db1ead1 libmount: fix unmangle code
old version:
  /mnt/ugly/te\134st\134 -> /mnt/ugly/te\st\134

fixed version:
  /mnt/ugly/te\134st\134 -> /mnt/ugly/te\st\

Reported-by: Naja Melan <najamelan@autistici.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-13 16:35:03 +02:00
Milan Broz 4ceb601d21 dmesg: fix kmsg read if read returns EPIPE
The /dev/kmsg can return EPIPE if current record has beed modified
while reading.

For init_kmsg, it cause switch to DMESG_METHOD_SYSLOG
(which is not expected) and later it can truncate output.

Signed-off-by: Milan Broz <mbroz@redhat.com>
2012-08-13 15:54:57 +02:00
Dave Reisner 3514cc3a8f eject: return proper 0/1 from eject_cdrom()
main() expects this method to return 0 for failure and 1 for success, as
the other eject_*() methods do. Add the missing comparison of ioctl() >= 0

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-13 15:45:47 +02:00
Samuel Thibault 4797b1e592 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>
2012-08-13 15:14:13 +02:00
Davidlohr Bueso 109896c36b fdisk: aix: fix warning
Fixes:
 warning: no previous prototype for ‘aix_nolabel’

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-08-13 14:49:57 +02:00