]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agoipcs: add --human readable size conversion option
Sami Kerola [Sun, 16 Dec 2012 10:43:51 +0000 (10:43 +0000)] 
ipcs: add --human readable size conversion option

Introduces new function ipc_print_size() which will call
size_to_human_string(), and handles the occasional '([k]bytes)' printing
if default size format is requested.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoipcs: assist debugging
Sami Kerola [Sun, 16 Dec 2012 10:43:50 +0000 (10:43 +0000)] 
ipcs: assist debugging

One will be able to see enum symbols when debugging, which is not the
case when values are specified as define list.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: swapon.8 option name fix
Sami Kerola [Sun, 16 Dec 2012 10:43:49 +0000 (10:43 +0000)] 
docs: swapon.8 option name fix

The commit 7ae8b469adda598fda28e4ea647d47905b43e172 added option --bytes,
not the initial proposal which was changed after maillist discussion.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopartx: add update command
Phillip Susi [Fri, 14 Dec 2012 19:57:25 +0000 (14:57 -0500)] 
partx: add update command

Update the kernel partition table to match what is on disk.  Remove any
extra partitions and add any missing ones.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
12 years agosulogin: map NL to CR-NL on output in initial termios settings
Karel Zak [Wed, 19 Dec 2012 09:24:23 +0000 (10:24 +0100)] 
sulogin: map NL to CR-NL on output in initial termios settings

(See also 9c62a2326e6e39a5e759830b0b9d91696166fb45 agetty patch).

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: minor coding style changes
Karel Zak [Tue, 18 Dec 2012 15:03:02 +0000 (16:03 +0100)] 
sulogin: minor coding style changes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: add multi console feature from SysVinit sulogin
Werner Fink [Mon, 10 Dec 2012 12:27:11 +0000 (13:27 +0100)] 
sulogin: add multi console feature from SysVinit sulogin

Now after adding Conflicts=rescue.service to getty@.service and
serial-getty@.service and Conflicts=getty.target to rescue.target
all works with `systemctl rescue'.  Even adding init=/sbin/sulogin
to the kernels command line by using the `e' key in grub2 boot
menu works flawless.

This version is without the emergency code as I've this moved to
lib/console.c where it belongs to.

Signed-off-by: Werner Fink <werner@suse.de>
12 years agosulogin: mount temporary /dev and /proc if not found
Werner Fink [Mon, 10 Dec 2012 12:27:10 +0000 (13:27 +0100)] 
sulogin: mount temporary /dev and /proc if not found

This is very usefull if initrd can not loaded that is no /dev and no
/proc is found.  Also if the /etc/shadow and /etc/passwd is copied into
the initrd the sulogin can be used in initrd even before /dev and/or /proc
are mounted.

Signed-off-by: Werner Fink <werner@suse.de>
12 years agosulogin: use alarm function to indicate if a timeout occurs
Werner Fink [Fri, 7 Dec 2012 08:00:56 +0000 (09:00 +0100)] 
sulogin: use alarm function to indicate if a timeout occurs

A small change to use the alarm handler to indicate if a timeout occurs.

Signed-off-by: Werner Fink <werner@suse.de>
12 years agosulogin: make usleep() workaround work
Werner Fink [Fri, 7 Dec 2012 08:00:55 +0000 (09:00 +0100)] 
sulogin: make usleep() workaround work

Simply fix a compile problem found during debugging console.c

Signed-off-by: Werner Fink <werner@suse.de>
12 years agosulogin: use the linked lists from list.h for consoles list
Werner Fink [Tue, 18 Dec 2012 14:02:35 +0000 (15:02 +0100)] 
sulogin: use the linked lists from list.h for consoles list

with this the double linked list feature from util-linux is used
instead of the single linked list.

[kzak@redhat.com: use list_last_entry() and list INIT macros]

Signed-off-by: Werner Fink <werner@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/list: add list_last_entry()
Karel Zak [Tue, 18 Dec 2012 13:49:21 +0000 (14:49 +0100)] 
include/list: add list_last_entry()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: remove crappy bugs section from man page
Karel Zak [Mon, 17 Dec 2012 16:11:05 +0000 (17:11 +0100)] 
fdisk: remove crappy bugs section from man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/list: fix undefined behavior in list_entry() macro
Sami Liedes [Mon, 17 Dec 2012 15:22:35 +0000 (16:22 +0100)] 
include/list: fix undefined behavior in list_entry() macro

Update list_entry() macro, which is basically the same as the
container_of() macro in the kernel, to use offsetof() to fix undefined
behavior.

Caught using clang -fsanitize=undefined.

[kzak@redhat.com: port from e2fsprogs]

Signed-off-by: Sami Liedes <sami.liedes@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: fix typo
Karel Zak [Fri, 14 Dec 2012 15:12:47 +0000 (16:12 +0100)] 
docs: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: update AUTHORS file
Karel Zak [Thu, 13 Dec 2012 12:51:57 +0000 (13:51 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: fix typos
Karel Zak [Wed, 12 Dec 2012 20:01:32 +0000 (21:01 +0100)] 
libmount: fix typos

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoblkid: fix double free [coverity scan]
Karel Zak [Wed, 12 Dec 2012 19:48:15 +0000 (20:48 +0100)] 
blkid: fix double free [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: make mkstemp() more robust [coverity scan]
Karel Zak [Wed, 12 Dec 2012 12:32:52 +0000 (13:32 +0100)] 
libmount: make mkstemp() more robust [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoswapon: fix memmory leak [coverity scan]
Karel Zak [Wed, 12 Dec 2012 11:40:48 +0000 (12:40 +0100)] 
swapon: fix memmory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: check mkdir(/run/blkid) return code [coverity scan]
Karel Zak [Wed, 12 Dec 2012 11:27:05 +0000 (12:27 +0100)] 
libblkid: check mkdir(/run/blkid) return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoswapon: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:18:20 +0000 (12:18 +0100)] 
swapon: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoprlimit: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:16:16 +0000 (12:16 +0100)] 
prlimit: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolscpu: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:13:38 +0000 (12:13 +0100)] 
lscpu: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agonamei: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:12:25 +0000 (12:12 +0100)] 
namei: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:11:17 +0000 (12:11 +0100)] 
lslocks: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:09:44 +0000 (12:09 +0100)] 
lsblk: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 11:08:06 +0000 (12:08 +0100)] 
findmnt: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agopartx: don't care about xasprintf() return code
Karel Zak [Wed, 12 Dec 2012 10:57:40 +0000 (11:57 +0100)] 
partx: don't care about xasprintf() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologin: check lastlog lseek return code [coverity scan]
Karel Zak [Wed, 12 Dec 2012 10:48:08 +0000 (11:48 +0100)] 
login: check lastlog lseek return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agochsh: use return rather than exit in main, clean up man page
Karel Zak [Wed, 12 Dec 2012 09:48:01 +0000 (10:48 +0100)] 
chsh: use return rather than exit in main, clean up man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agochfn: always use return rather than exit() in main
Karel Zak [Wed, 12 Dec 2012 09:41:44 +0000 (10:41 +0100)] 
chfn: always use return rather than exit() in main

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agochfn: clean up exit status
Karel Zak [Wed, 12 Dec 2012 09:36:32 +0000 (10:36 +0100)] 
chfn: clean up exit status

The old version in some cases (but not always) returns -1 (255) on
error. It seems better to cleanup the code and don't return internal
return codes by exit().

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: unset *_DEBUG variables
Karel Zak [Mon, 10 Dec 2012 12:43:11 +0000 (13:43 +0100)] 
tests: unset *_DEBUG variables

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: don't use safe_getenv() for test
Karel Zak [Mon, 10 Dec 2012 12:31:08 +0000 (13:31 +0100)] 
libmount: don't use safe_getenv() for test

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: avoid endless loop in mnt_get_kernel_cmdline_option
Bernhard Voelker [Fri, 30 Nov 2012 16:12:12 +0000 (17:12 +0100)] 
libmount: avoid endless loop in mnt_get_kernel_cmdline_option

The above function infloops when the name to search for can only
be found at the beginning of /proc/cmdline but doesn't match,
e.g. when searching for "ro" in "root=/dev/sda1 quiet vga=0x31a".

* libmount/src/utils.c (mnt_get_kernel_cmdline_option): Replace
while by for loop to ensure the pointer p is incremented.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agorename: use macro to print version
Karel Zak [Mon, 10 Dec 2012 12:14:38 +0000 (13:14 +0100)] 
rename: use macro to print version

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agorename: add --symlink option for renaming symlink target
Jan (yac) Matějka [Mon, 26 Nov 2012 15:50:08 +0000 (16:50 +0100)] 
rename: add --symlink option for renaming symlink target

[kzak@redhat.com: - coding style clean up]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoblkid: fix man page mess
Karel Zak [Mon, 10 Dec 2012 11:25:25 +0000 (12:25 +0100)] 
blkid: fix man page mess

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) check if the "First sector" is unused
Karel Zak [Tue, 4 Dec 2012 17:03:35 +0000 (18:03 +0100)] 
fdisk: (gpt) check if the "First sector" is unused

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) align newly created partitions
Karel Zak [Tue, 4 Dec 2012 16:54:15 +0000 (17:54 +0100)] 
fdisk: (gpt) align newly created partitions

 - default "First sector" has to be aligned
 - "Last sector" has to be aligned if specified by +<size><suffix> convention

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) fix {last,first}_usable_lba usage
Karel Zak [Tue, 4 Dec 2012 16:02:50 +0000 (17:02 +0100)] 
fdisk: (gpt) fix {last,first}_usable_lba usage

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: cleanup partition start/end usage
Karel Zak [Tue, 4 Dec 2012 15:34:18 +0000 (16:34 +0100)] 
fdisk: cleanup partition start/end usage

 - always use pointers to make the code more generic
 - always use "const" is possible
 - always use le64_to_cpu() to access numbers

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) check partitions alignment
Karel Zak [Tue, 4 Dec 2012 14:45:25 +0000 (15:45 +0100)] 
fdisk: (gpt) check partitions alignment

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: report PT type, inform about new GPT
Karel Zak [Tue, 4 Dec 2012 13:58:55 +0000 (14:58 +0100)] 
fdisk: report PT type, inform about new GPT

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) use topology to define FirstUsableLBA
Karel Zak [Tue, 4 Dec 2012 13:49:17 +0000 (14:49 +0100)] 
fdisk: (gpt) use topology to define FirstUsableLBA

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agovipw: remove unused set{uid,gid} calls
Karel Zak [Tue, 4 Dec 2012 13:32:15 +0000 (14:32 +0100)] 
vipw: remove unused set{uid,gid} calls

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: clean nonnull attribute usage
Karel Zak [Tue, 4 Dec 2012 13:22:39 +0000 (14:22 +0100)] 
libmount: clean nonnull attribute usage

 - use __attribute__((nonnull) for functions where we not able to
   return an return code ("is", "has" and some "get" functions).

 - use __attribute__((nonnull) for small functions where we
   always modify any of the function argument (some mnt_optstr_* functions)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: re-read PART{UUID,LABEL} for successfully verified cached devices
Karel Zak [Tue, 4 Dec 2012 12:02:57 +0000 (13:02 +0100)] 
libblkid: re-read PART{UUID,LABEL} for successfully verified cached devices

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: cleanup arguments checks
Karel Zak [Tue, 4 Dec 2012 11:12:54 +0000 (12:12 +0100)] 
libblkid: cleanup arguments checks

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: cleanup nonnull attribute usage
Karel Zak [Tue, 4 Dec 2012 10:58:13 +0000 (11:58 +0100)] 
libblkid: cleanup nonnull attribute usage

 - don't mix __attribute__((nonnull)) and "if (!argument) return" for
   the same function. The "if ()" check will be *silently* optimized
   out by gcc.

 - use __attribute__((nonnull)) for functions where is impossible to
   return error code. For example "is" and "has" functions or functions
   where we return unsigned types and zero is a valid value.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: move DOS units stuff to fdiskdoslabel.c
Karel Zak [Mon, 3 Dec 2012 15:22:17 +0000 (16:22 +0100)] 
fdisk: move DOS units stuff to fdiskdoslabel.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: use BLKSSZGET as default for io-limits rather than hardcoded limit
Karel Zak [Mon, 3 Dec 2012 14:50:21 +0000 (15:50 +0100)] 
fdisk: use BLKSSZGET as default for io-limits rather than hardcoded limit

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: remove global variable sector_offset
Karel Zak [Mon, 3 Dec 2012 14:32:16 +0000 (15:32 +0100)] 
fdisk: remove global variable sector_offset

 - add cxt->first_lba as replacement to sector_offset
 - add label->reset_alignment() to overwrite the default alignment setting
 - add fdisk_reset_alignment() to setup grain, first LBA offset, etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: zerosize EBR buffer
Karel Zak [Fri, 30 Nov 2012 20:33:06 +0000 (21:33 +0100)] 
fdisk: zerosize EBR buffer

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: api: propagate add partitions to users
Davidlohr Bueso [Mon, 26 Nov 2012 04:29:18 +0000 (20:29 -0800)] 
fdisk: api: propagate add partitions to users

Similarly to commit 1f5eb51b79275e32d045fd6718753bf04cde8374 we
do not propagate problems when adding partitions to user visible
api.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: remove dead code
Davidlohr Bueso [Mon, 26 Nov 2012 04:29:12 +0000 (20:29 -0800)] 
fdisk: remove dead code

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agofdisk: api: move disklabel type to cxt
Davidlohr Bueso [Mon, 26 Nov 2012 04:25:49 +0000 (20:25 -0800)] 
fdisk: api: move disklabel type to cxt

Get rid of it as a global variable as it belongs in the context.
To compare a disklabel on the device, the fdisk_dev_is_disklabel()
function is introduced. Also, to avoid naming issues, the fdisk_labeltype
members where renamed to FDISK_DISKLABEL_<type>.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
12 years agoMerge branch '2012wk47' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Fri, 30 Nov 2012 12:43:42 +0000 (13:43 +0100)] 
Merge branch '2012wk47' of git://github.com/kerolasa/lelux-utiliteetit

12 years agobuild-sys: fix typo
Karel Zak [Fri, 30 Nov 2012 11:58:33 +0000 (12:58 +0100)] 
build-sys: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: use pkg-config for selinux
Karel Zak [Fri, 30 Nov 2012 11:48:44 +0000 (12:48 +0100)] 
build-sys: use pkg-config for selinux

- we need libselinux 2.x (where is security_get_initial_context())
- the latest selinux versions are linked with -lpcre

Reported-by: Gregory Nietsky <gregory@distrotech.co.za>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: add devel-non-docs compile profile
Karel Zak [Fri, 30 Nov 2012 11:47:08 +0000 (12:47 +0100)] 
build-sys: add devel-non-docs compile profile

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: don't fails silently if EBR is outside of disk
Karel Zak [Fri, 30 Nov 2012 10:54:10 +0000 (11:54 +0100)] 
fdisk: don't fails silently if EBR is outside of disk

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: cleanup blkid_strconcat
Karel Zak [Fri, 30 Nov 2012 10:10:22 +0000 (11:10 +0100)] 
libblkid: cleanup blkid_strconcat

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: remove blkid_{strndup,strdup}
Karel Zak [Fri, 30 Nov 2012 09:56:54 +0000 (10:56 +0100)] 
libblkid: remove blkid_{strndup,strdup}

Don't try to be smart. Let's use standard libc functions. (Note that
we have fallback for strndup() in include/strutils.h)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: add function attributes to private API
Karel Zak [Fri, 30 Nov 2012 09:33:22 +0000 (10:33 +0100)] 
libblkid: add function attributes to private API

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: add function attributes to public API
Ondrej Oprala [Fri, 30 Nov 2012 09:32:12 +0000 (10:32 +0100)] 
libblkid: add function attributes to public API

[kzak@redhat.com: - use __ul prefix in public API,
                  - define minimal requirement gcc 3.4]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: add function attributes to private API
Ondrej Oprala [Fri, 30 Nov 2012 08:01:10 +0000 (09:01 +0100)] 
libmount: add function attributes to private API

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: add function attributes to public API
Ondrej Oprala [Fri, 30 Nov 2012 07:56:11 +0000 (08:56 +0100)] 
libmount: add function attributes to public API

[kzak@redhat.com: - use __ul prefix in public API,
                  - define minimal requirement gcc 3.4]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: cleanup TODO
Karel Zak [Tue, 27 Nov 2012 10:13:42 +0000 (11:13 +0100)] 
docs: cleanup TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: fix copy & past bug
Karel Zak [Tue, 27 Nov 2012 09:44:28 +0000 (10:44 +0100)] 
lsblk: fix copy & past bug

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoumount: sanitize paths from non-root users
Karel Zak [Mon, 26 Nov 2012 15:25:46 +0000 (16:25 +0100)] 
umount: sanitize paths from non-root users

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: sanitize paths from non-root users
Karel Zak [Mon, 26 Nov 2012 13:30:22 +0000 (14:30 +0100)] 
mount: sanitize paths from non-root users

 $ mount /root/.ssh/../../dev/sda2
 mount: only root can mount UUID=17bc65ec-4125-4e7c-8a7d-e2795064c736 on /boot

this is too promiscuous. It seems better to ignore on command line
specified paths which are not resolve-able for non-root users.

Fixed version:

  $ mount /root/.ssh/../../dev/sda2
  mount: /root/.ssh/../../dev/sda2: Permission denied

  $ mount /dev/sda2
  mount: only root can mount UUID=17bc65ec-4125-4e7c-8a7d-e2795064c736 on /boot

Note that this bug has no relation to mount(2) permissions evaluation
in suid mode. The way how non-root user specifies paths on command
line is completely irrelevant for comparison with fstab entries.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/canonicalize: add canonicalize_path_restricted() to canonicalize without suid...
Karel Zak [Mon, 26 Nov 2012 15:24:28 +0000 (16:24 +0100)] 
lib/canonicalize: add canonicalize_path_restricted() to canonicalize without suid permisssions

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: make debug stuff more robust
Karel Zak [Mon, 26 Nov 2012 11:19:02 +0000 (12:19 +0100)] 
libmount: make debug stuff more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: (deprecated) drop --guess-fstype
Karel Zak [Mon, 26 Nov 2012 10:57:26 +0000 (11:57 +0100)] 
mount: (deprecated) drop --guess-fstype

The option is undocumented and unnecessary.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: correctly interpret '*' from /etc/filesystems
Karel Zak [Mon, 26 Nov 2012 10:21:40 +0000 (11:21 +0100)] 
libmount: correctly interpret '*' from /etc/filesystems

 - single line with '*' in /etc/filesystems means that libmount has to
   read /proc/filesystems, otherwise /proc/filesystems has to be ignored

 - mount(2) ENODEV is no reason to break the do_mount_by_pattern()
   loop when trying to mount by /{etc,proc}/filesystems

Reported-by: NeilBrown <neilb@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: ddate removal
Sami Kerola [Sat, 27 Oct 2012 17:58:54 +0000 (18:58 +0100)] 
docs: ddate removal

Missed in commit 4cf02b65109029a38f708148dea8d2bdf2fa19de

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: mention what Open Group has marked legacy
Sami Kerola [Tue, 23 Oct 2012 19:59:26 +0000 (20:59 +0100)] 
docs: mention what Open Group has marked legacy

Reviewed-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: remove dead link
Sami Kerola [Tue, 23 Oct 2012 19:50:38 +0000 (20:50 +0100)] 
docs: remove dead link

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodocs: mention Open Group requirements
Sami Kerola [Tue, 23 Oct 2012 19:14:53 +0000 (20:14 +0100)] 
docs: mention Open Group requirements

Commands cal col ipcrm ipcs kill line logger mesg more newgrp pg renice
has Open Group requirements.  Contributors need to be aware of them.

Reviewed-by: Adam Sampson <ats@offog.org>
Reviewed-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Reviewed-by: Ángel González <ingenit@zoho.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolscpu: remove unnecessary variable
Karel Zak [Fri, 23 Nov 2012 14:01:27 +0000 (15:01 +0100)] 
lscpu: remove unnecessary variable

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: remove print_perms()
Sami Kerola [Sun, 11 Nov 2012 22:41:24 +0000 (22:41 +0000)] 
ipcs: remove print_perms()

The function is no longer in use.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoipcs: make individual message queue id printing to use /proc
Sami Kerola [Sun, 11 Nov 2012 22:31:21 +0000 (22:31 +0000)] 
ipcs: make individual message queue id printing to use /proc

[kzak@redhat.com: - fix msgctl() call,
  move q_qbytes to ipc_msg_get_info]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: clean up do_msg(), and add ipc_msg_get_info()
Sami Kerola [Sun, 11 Nov 2012 22:10:54 +0000 (22:10 +0000)] 
ipcs: clean up do_msg(), and add ipc_msg_get_info()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoipcs: make individual semaphore id printing to use /proc
Sami Kerola [Sun, 11 Nov 2012 21:12:20 +0000 (21:12 +0000)] 
ipcs: make individual semaphore id printing to use /proc

And reindent the print_shm() function.

[kzak@redhat.com: move semctl(GET*...) calls to ipcutils.c]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: clean up do_sem(), and add ipc_sem_get_info()
Sami Kerola [Sun, 11 Nov 2012 20:53:07 +0000 (20:53 +0000)] 
ipcs: clean up do_sem(), and add ipc_sem_get_info()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoipcs: make individual shared memory id printing to use /proc
Sami Kerola [Sun, 21 Oct 2012 14:33:25 +0000 (15:33 +0100)] 
ipcs: make individual shared memory id printing to use /proc

And reindent the print_shm() function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: fix ipc_shm_get_info(), use calloc
Karel Zak [Mon, 5 Nov 2012 16:28:07 +0000 (17:28 +0100)] 
ipcs: fix ipc_shm_get_info(), use calloc

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: clean up do_shm()
Karel Zak [Mon, 5 Nov 2012 15:48:12 +0000 (16:48 +0100)] 
ipcs: clean up do_shm()

 - don't expect maxid as argument in ipc_shm_get_info()
 - if there is @id argument then use it everywhere in ipc_shm_get_info()
 - don't call shmctl() if not necessary in do_shm()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: read shared memory values from /proc
Sami Kerola [Sun, 14 Oct 2012 15:01:05 +0000 (16:01 +0100)] 
ipcs: read shared memory values from /proc

[kzak@redhat.com: - move to ipcutils.{c,h},
                  - fix datatypes to be arch independent]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: determine ipc limits from /proc
Sami Kerola [Sun, 21 Oct 2012 16:40:28 +0000 (17:40 +0100)] 
ipcs: determine ipc limits from /proc

Some of the limit values are not dynamic.  Like in kernel these values
are #defined.

[kzak@redhat.com: - use better names for functions,
                  - add ipcutils.{c,h}
                  - read also shmmax from /proc]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/path: add path_read_u64()
Karel Zak [Mon, 5 Nov 2012 11:28:00 +0000 (12:28 +0100)] 
lib/path: add path_read_u64()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/path: rename functions to be more explicit
Karel Zak [Mon, 5 Nov 2012 11:23:55 +0000 (12:23 +0100)] 
lib/path: rename functions to be more explicit

 ... and to have names compatible with lib/sysfs.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: add /proc and /sys path definitions
Sami Kerola [Sun, 21 Oct 2012 16:39:36 +0000 (17:39 +0100)] 
ipcs: add /proc and /sys path definitions

The necessary proc and sysfs files are tested to be present.  When
information files are missing the ipcs will use obsolted system calls,
and data structures, as fallback.

[kzak@redhat.com: - fix #define _PATH_PROC_IPC_MSG "/proc/sys/kernel/sem" typo]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosu: log failed logins to btmp
Karel Zak [Thu, 22 Nov 2012 14:23:14 +0000 (15:23 +0100)] 
su: log failed logins to btmp

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosu: use get_terminal_name() for compatibility with login(1)
Karel Zak [Thu, 22 Nov 2012 13:45:49 +0000 (14:45 +0100)] 
su: use get_terminal_name() for compatibility with login(1)

login(1) uses tty name (!= path) in the syslog messages.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agologin: use get_terminal_name() from ttyutils.c
Karel Zak [Thu, 22 Nov 2012 13:42:10 +0000 (14:42 +0100)] 
login: use get_terminal_name() from ttyutils.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/ttyutils: add get_terminal_name()
Karel Zak [Thu, 22 Nov 2012 13:36:17 +0000 (14:36 +0100)] 
lib/ttyutils: add get_terminal_name()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/ttyutils: add test program
Karel Zak [Thu, 22 Nov 2012 13:32:21 +0000 (14:32 +0100)] 
lib/ttyutils: add test program

Signed-off-by: Karel Zak <kzak@redhat.com>