Commit Graph

4934 Commits

Author SHA1 Message Date
Ludwig Nussel f29fc7e0bb syslog always 2012-05-25 10:21:09 +02:00
Ludwig Nussel c92880ef39 remove non pam code 2012-05-25 10:20:57 +02:00
Ludwig Nussel ff6b15d645 make su build as part of util-linux 2012-05-24 14:26:51 +02:00
Tim Waugh c6a1746b5f call setsid() when called with -c
Prevents command injection via TIOCSTI

https://bugzilla.redhat.com/show_bug.cgi?id=173008
2012-05-24 13:52:43 +02:00
Werner Fink a6fdd3f812 make sure /sbin resp /usr/sbin are in PATH 2012-05-24 13:52:43 +02:00
Ludwig Nussel 589554ad7a honor settings in /etc/default/su resp /etc/login.defs 2012-05-24 13:52:43 +02:00
Ludwig Nussel a9980c85c9 set sane default path 2012-05-24 13:52:42 +02:00
Ludwig Nussel b14d022fd0 log all su attempts 2012-05-24 13:52:42 +02:00
Ludwig Nussel 8171142ab6 pam support for su 2012-05-24 13:52:42 +02:00
Ludwig Nussel d6586bfc89 merge coreutils' last GPL2 version of su.c 2012-05-24 13:50:20 +02:00
Karel Zak 0a86755fe8 fdisk: don't print welcome message to stderr
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-23 11:26:42 +02:00
Karel Zak 7657d3e217 fdisk: add readonly option to fdisk_new_context_from_filename()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-23 11:24:04 +02:00
Karel Zak 70696820f8 fdisk: always use stderr for debug messages
* add dbgprint() to provide standardized debug output

 * print initial debug message to stderr

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-23 11:09:49 +02:00
Karel Zak dffdc98958 libmount: use stderr for initial debug message
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-23 11:05:37 +02:00
Davidlohr Bueso f7b1f75e68 fdisk: add debug support
Based on libmnt, this patch adds basic debugging support for fdisk. Currently
only CONTEXT is debugged, yet keeps exact functionality as libmnt/libblkid.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-23 10:53:30 +02:00
Davidlohr Bueso 823f0fd107 fdisk: introduce fdisk context
This is the first patch that adds the initial parts of the new fdisk internal
API. Two functions are created to both init and deinit the fdisk context. Only
the device's descriptor and path are added as a start and these are replaced
throughout fdisk.c and label specific code.

All logic that opens the file does it with fdisk_new_context_from_filename(),
and this enforces always opening the device with rw, then, if unsuccesfull,
with read-only. This changes the current logic that opens the device with
certain permissions depending on the user given options.  For example, -l opens
the device read-only.

This patch passed regression tests and local modifications for sgi/dos/sun disk
labels.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-23 10:53:05 +02:00
Davidlohr Bueso 6da365de2d fdisk: refactor -s option
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-23 10:52:09 +02:00
Davidlohr Bueso 37eadc1796 fdisk: use BSD label header
Move bsd specific function definitions into its own header file and include it in fdisk code.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-23 10:51:27 +02:00
Davidlohr Bueso e11447670a fdisk: remove bogus statement
usage() does not return, also move the help option handling to the bottom of the switch.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-23 10:51:23 +02:00
Davidlohr Bueso 365f01fcdf fdisk: add an quit/exit handling function
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-23 10:50:59 +02:00
maximilian attems adddfd37a1 misc-utils: cleanup unused strings.h includes
Noticed on klibc building.

Signed-off-by: maximilian attems <max@stro.at>
2012-05-23 10:31:12 +02:00
maximilian attems ae278c88cf include: [c.h] protect container_of
fixes lots of warning noise:
../../../include/c.h:112:0: warning: "container_of" redefined [enabled
by default]
/usr/lib/klibc/include/stddef.h:52:0: note: this is the location of the
previous definition

Signed-off-by: maximilian attems <max@stro.at>
2012-05-23 10:31:07 +02:00
Karel Zak b6b0ea094b hexdump: fix comparison of distinct pointer types
display.c: In function ‘get’:
display.c:262:117: warning: comparison of distinct pointer types lacks
a cast [enabled by default]

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-23 10:20:19 +02:00
Karel Zak 69c9e8387b last: use min() from c.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-23 10:07:57 +02:00
Dave Reisner 7383ebceec libmount: Use binary search to compare pseudofs
It's the responsibility of anyone adding to this list in the future to
ensure that the list remains sorted.

While we're at it, expand this list of known pseudofs types.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-23 09:56:51 +02:00
Dave Reisner b8a670aecf findmnt: fallback to mountinfo for polling
If no tabfiles are specified, default to watching /proc/self/mountinfo
rather than exiting silently with EXIT_FAILURE.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-23 09:56:51 +02:00
Dave Reisner beda9dd309 findmnt: reference correct manual section
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-23 09:56:51 +02:00
Petr Uzel 96ce175801 libuuid: use max() from c.h
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-23 09:56:51 +02:00
Petr Uzel 3bbef0769e text-utils: use min() from c.h
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-23 09:56:51 +02:00
Petr Uzel f9f19b8f7f mkfs.cramfs: remove unused 'MIN' macro definition
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-23 09:56:51 +02:00
Petr Uzel 078ad9bf06 blkid: stop device probing if error is detected
blkid -p dev1 dev2 [...] now stops upon first error detected and
returns correct value. Previously, if error was detected with dev1,
it continued with dev2 anyways and so the return value corresponded
to the last device only.

Reported-by: Bernhard Voelker <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-23 09:43:51 +02:00
Petr Uzel 1578ddd658 blkid: introduce symbolic names for different blkid exit codes
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-23 09:43:51 +02:00
Petr Uzel a922091df8 blkid: use symbolic exit code
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-23 09:43:50 +02:00
Karel Zak 495b13983e Merge branch 'master' of https://github.com/jhuntwork/util-linux 2012-05-23 09:39:40 +02:00
Karel Zak 9561d1afea wdctl: add --oneline
* remove --pairs, it was usable for flags table only

 * one line for each watchdog device

For example:

 # wdctl --noident --noflags --oneline
 /dev/watchdog: TIMEOUT="30" TIMELEFT="2"

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-22 13:31:46 +02:00
Karel Zak b776c15e8a lib/tt: export tt_fputs_{quoted,nonblank} function
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-22 13:27:46 +02:00
Karel Zak f56338b439 wdctl: allow to specify more than one device
* remove -d <device> option

 * support wdctl [options] [<device> ...] usage

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-22 11:48:36 +02:00
Karel Zak d4cba553f9 login: fix segmentation fault in log_utmp
ctx->tty_number is optional...

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=822705
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-21 09:58:42 +02:00
Karel Zak 96747e7594 wdctl: add --flags-only and optional column DEVICE
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-18 15:08:31 +02:00
Karel Zak 28094b1e3c eject: allow to address device by LABEL/UUID
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-18 12:01:10 +02:00
Karel Zak fa705b5441 libmount: don't canonicalize target
Note that mountpoint (target_ paths in /proc/mounts and /proc/self/mountinfo
are always canonicalized by kernel.

 * for umount we don't have to canonicalize target
   by default if the mountpoint is found in /proc/self/mountinfo

 * in mnt_table_find_target() is unnecessary to canonicalize target paths
   if the table of the filesystems is read from /proc/self/mountinfo

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=820707
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-17 12:10:43 +02:00
Karel Zak 3b56eea7c9 text-utils: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:46:20 +02:00
Karel Zak b43d3a3a2c term-utils: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:46:05 +02:00
Karel Zak 20a3998222 sys-utils: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:45:17 +02:00
Karel Zak 630ed89d5a schedutils: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:45:05 +02:00
Karel Zak 659e5f5b5c partx: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:44:51 +02:00
Karel Zak db41a4298f misc-utils: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:44:37 +02:00
Karel Zak 92bb28a4f6 sulogin: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:44:19 +02:00
Karel Zak 99c95585fc hwclock: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:44:02 +02:00
Karel Zak 0069505932 fdisk: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:43:49 +02:00