]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agofdisk: (dos) kill 'partitions' global variable
Karel Zak [Tue, 22 Jan 2013 12:46:55 +0000 (13:46 +0100)] 
fdisk: (dos) kill 'partitions' global variable

 ... and use size_t for partition numbers

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add part_get_status operation
Karel Zak [Mon, 21 Jan 2013 16:10:23 +0000 (17:10 +0100)] 
libfdisk: add part_get_status operation

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: cleanup fdisk_get_partition_type() returns
Karel Zak [Mon, 21 Jan 2013 11:50:25 +0000 (12:50 +0100)] 
libfdisk: cleanup fdisk_get_partition_type() returns

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (dos) move dos specific code
Karel Zak [Mon, 21 Jan 2013 11:44:58 +0000 (12:44 +0100)] 
fdisk: (dos) move dos specific code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (dos) move 'toggle active' code to fdiskdoslabe.c
Karel Zak [Mon, 21 Jan 2013 11:32:33 +0000 (12:32 +0100)] 
fdisk: (dos) move 'toggle active' code to fdiskdoslabe.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (dos) move dos specific code
Karel Zak [Mon, 21 Jan 2013 11:28:27 +0000 (12:28 +0100)] 
fdisk: (dos) move dos specific code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: remove dead code
Karel Zak [Mon, 21 Jan 2013 11:26:21 +0000 (12:26 +0100)] 
fdisk: remove dead code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (dos) move dos_list_table_expert() to fdiskdoslabe.c
Karel Zak [Mon, 21 Jan 2013 11:25:30 +0000 (12:25 +0100)] 
fdisk: (dos) move dos_list_table_expert() to fdiskdoslabe.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (dos) move 'move begin' code to fdiskdoslabe.c
Karel Zak [Mon, 21 Jan 2013 11:11:43 +0000 (12:11 +0100)] 
fdisk: (dos) move 'move begin' code to fdiskdoslabe.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (dos) move fix order code to fdiskdoslabe.c
Karel Zak [Mon, 21 Jan 2013 11:06:17 +0000 (12:06 +0100)] 
fdisk: (dos) move fix order code to fdiskdoslabe.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (dos) move list table code to fdiskdoslabe.c
Karel Zak [Mon, 21 Jan 2013 11:01:44 +0000 (12:01 +0100)] 
fdisk: (dos) move list table code to fdiskdoslabe.c

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: use libfdisk label->changed
Karel Zak [Fri, 18 Jan 2013 15:11:40 +0000 (16:11 +0100)] 
fdisk: use libfdisk label->changed

The patch is huge because it's necessary to add a pointer context to
all read_<foo> functions.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add label->changed flag
Karel Zak [Fri, 18 Jan 2013 15:11:08 +0000 (16:11 +0100)] 
libfdisk: add label->changed flag

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (sun) remove nasty sunlabel macro
Karel Zak [Fri, 18 Jan 2013 13:43:00 +0000 (14:43 +0100)] 
fdisk: (sun) remove nasty sunlabel macro

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (sun) remove global variable 'partitions'
Karel Zak [Fri, 18 Jan 2013 11:47:27 +0000 (12:47 +0100)] 
fdisk: (sun) remove global variable 'partitions'

 * use label counters
 * add assert()
 * use struct fdisk_label if possible

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (bsd) add partitions counters
Karel Zak [Fri, 18 Jan 2013 11:05:40 +0000 (12:05 +0100)] 
fdisk: (bsd) add partitions counters

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (aix) remove unuused variable 'partitions'
Karel Zak [Fri, 18 Jan 2013 10:48:45 +0000 (11:48 +0100)] 
fdisk: (aix) remove unuused variable 'partitions'

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: (gpt) introduce driver independent partitions counters
Karel Zak [Fri, 18 Jan 2013 10:43:56 +0000 (11:43 +0100)] 
libfdisk: (gpt) introduce driver independent partitions counters

 label->nparts_{max,cur} to later replace global variable partitions

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) remove global variables, cleanup header verification
Karel Zak [Thu, 17 Jan 2013 16:09:07 +0000 (17:09 +0100)] 
fdisk: (gpt) remove global variables, cleanup header verification

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: differentiate between get and read operation
Karel Zak [Thu, 17 Jan 2013 14:32:17 +0000 (15:32 +0100)] 
fdisk: differentiate between get and read operation

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: move label identifier to label struct
Karel Zak [Tue, 11 Dec 2012 17:30:03 +0000 (18:30 +0100)] 
libfdisk: move label identifier to label struct

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add fdisk_label to driver API
Karel Zak [Tue, 11 Dec 2012 17:04:25 +0000 (18:04 +0100)] 
libfdisk: add fdisk_label to driver API

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: improve label deinitialization
Karel Zak [Tue, 11 Dec 2012 15:37:04 +0000 (16:37 +0100)] 
libfdisk: improve label deinitialization

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: kill dos_compatible_flag global variable
Karel Zak [Tue, 11 Dec 2012 14:08:06 +0000 (15:08 +0100)] 
libfdisk: kill dos_compatible_flag global variable

... move the variable to label private struct.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add fdisk_new_context(), reuse context
Karel Zak [Tue, 11 Dec 2012 13:41:57 +0000 (14:41 +0100)] 
libfdisk: add fdisk_new_context(), reuse context

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: split label and label operations
Karel Zak [Tue, 11 Dec 2012 11:56:27 +0000 (12:56 +0100)] 
libfdisk: split label and label operations

 Changes:

 - fdisk_label is a private label driver struct
 - generic header of the fdisk_label points to fdisk_label_operations
 - the private fdisk_label stuff is always allocated for all drivers
   during fdisk_context initialization

 - context->labels[] contains pointers to all supported labels (drivers)
 - context->label is a pointer to the currently used label

 This change allows to:

 - store label specific global settings (e.g. dos compatible mode,
   display units, ...) independently on the current label

 - add label specific function to the API

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: cleanup the rest of fdisks/utils.c stuff
Karel Zak [Thu, 6 Dec 2012 14:22:43 +0000 (15:22 +0100)] 
libfdisk: cleanup the rest of fdisks/utils.c stuff

 - remove obsolete code
 - move fdisk_{set,get}_partition_type() to label.c (this is label
   driver operation)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add context functions
Karel Zak [Thu, 6 Dec 2012 14:17:53 +0000 (15:17 +0100)] 
libfdisk: add context functions

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add probing function
Karel Zak [Thu, 6 Dec 2012 14:13:23 +0000 (15:13 +0100)] 
libfdisk: add probing function

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add fdisk_reset_alignment()
Karel Zak [Thu, 6 Dec 2012 14:04:35 +0000 (15:04 +0100)] 
libfdisk: add fdisk_reset_alignment()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add topology and geometry functions
Karel Zak [Thu, 6 Dec 2012 11:12:41 +0000 (12:12 +0100)] 
libfdisk: add topology and geometry functions

 - rename __discovery_* to fdisk_discovery_*
 - rename fdisk_context_force_sector_size() to fdisk_override_sector_size()
 - rename fdisk_context_set_user_geometry() to fdisk_override_geometry()

 - remove non-default sector size warning

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add firstsector utils
Karel Zak [Wed, 5 Dec 2012 16:08:54 +0000 (17:08 +0100)] 
libfdisk: add firstsector utils

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: remove duplicate code (already in libfdisk)
Karel Zak [Wed, 5 Dec 2012 14:08:26 +0000 (15:08 +0100)] 
fdisk: remove duplicate code (already in libfdisk)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add generic label code
Karel Zak [Wed, 5 Dec 2012 14:07:19 +0000 (15:07 +0100)] 
libfdisk: add generic label code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add alignment code
Karel Zak [Wed, 5 Dec 2012 13:32:20 +0000 (14:32 +0100)] 
libfdisk: add alignment code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add parttype code
Karel Zak [Fri, 30 Nov 2012 15:39:57 +0000 (16:39 +0100)] 
libfdisk: add parttype code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add basic structs
Karel Zak [Fri, 30 Nov 2012 15:31:04 +0000 (16:31 +0100)] 
libfdisk: add basic structs

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: use debug stuff from libfdisk
Karel Zak [Fri, 30 Nov 2012 14:29:03 +0000 (15:29 +0100)] 
fdisk: use debug stuff from libfdisk

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibfdisk: add basic library files
Karel Zak [Fri, 30 Nov 2012 14:27:41 +0000 (15:27 +0100)] 
libfdisk: add basic library files

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add fdisk GPT test
Karel Zak [Wed, 6 Mar 2013 13:36:23 +0000 (14:36 +0100)] 
tests: add fdisk GPT test

Note that the test does not check on-disk data (by checksum)
because the current fdisk does not allow to modify automatically
generated partition and disk UUIDs.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add fdisk BSD test
Karel Zak [Wed, 6 Mar 2013 13:01:41 +0000 (14:01 +0100)] 
tests: add fdisk BSD test

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: update fdisk mbr tests
Karel Zak [Wed, 6 Mar 2013 11:32:34 +0000 (12:32 +0100)] 
tests: update fdisk mbr tests

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: use checksum to detect rev(1) consistency
Karel Zak [Tue, 5 Mar 2013 08:38:46 +0000 (09:38 +0100)] 
tests: use checksum to detect rev(1) consistency

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: make utmpdump TZ independent
Karel Zak [Mon, 4 Mar 2013 12:10:09 +0000 (13:10 +0100)] 
tests: make utmpdump TZ independent

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoionice: keep output backwardly compatible
Karel Zak [Mon, 4 Mar 2013 11:58:12 +0000 (12:58 +0100)] 
ionice: keep output backwardly compatible

 ...bug introduced by 8c219bf463dbbae412767d269bff1cdd4e4bf4a5

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: update ipcs (reorder default output)
Karel Zak [Mon, 4 Mar 2013 11:53:31 +0000 (12:53 +0100)] 
tests: update ipcs (reorder default output)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: update libblkid PT tests
Karel Zak [Mon, 4 Mar 2013 11:49:11 +0000 (12:49 +0100)] 
tests: update libblkid PT tests

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: update UDF test
Karel Zak [Mon, 4 Mar 2013 11:45:13 +0000 (12:45 +0100)] 
tests: update UDF test

 .. blkid now returns infor from ISO header too.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: update ISO tests
Karel Zak [Mon, 4 Mar 2013 11:44:34 +0000 (12:44 +0100)] 
tests: update ISO tests

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoMerge branch 'master' of https://github.com/zec/util-linux
Karel Zak [Mon, 4 Mar 2013 11:40:38 +0000 (12:40 +0100)] 
Merge branch 'master' of https://github.com/zec/util-linux

12 years agodocs: improve wording, grammar and formatting of lsblk man page
Benno Schulenberg [Mon, 25 Feb 2013 09:48:35 +0000 (10:48 +0100)] 
docs: improve wording, grammar and formatting of lsblk man page

Also sort the options alphabetically.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agodocs: improve grammar and formatting of explanation of "-o +list"
Benno Schulenberg [Fri, 22 Feb 2013 20:51:32 +0000 (21:51 +0100)] 
docs: improve grammar and formatting of explanation of "-o +list"

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agobuild-sys: add exec_shell.h to distribution
Bernhard Voelker [Sat, 2 Mar 2013 17:59:02 +0000 (18:59 +0100)] 
build-sys: add exec_shell.h to distribution

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agounshare: tweak style
Mike Frysinger [Fri, 1 Mar 2013 04:03:02 +0000 (23:03 -0500)] 
unshare: tweak style

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agounshare(1): delete empty NOTES section
Mike Frysinger [Fri, 1 Mar 2013 04:03:01 +0000 (23:03 -0500)] 
unshare(1): delete empty NOTES section

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agologin: remove file descriptor leak [cppcheck]
Sami Kerola [Wed, 20 Feb 2013 21:31:09 +0000 (21:31 +0000)] 
login: remove file descriptor leak [cppcheck]

[login-utils/login.c:510]: (error) Resource leak: fd

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agowall: use xgethostname()
Sami Kerola [Sat, 16 Feb 2013 18:08:40 +0000 (18:08 +0000)] 
wall: use xgethostname()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoreadprofile: fix --reest (--reset) typo
Karel Zak [Mon, 4 Mar 2013 11:25:47 +0000 (12:25 +0100)] 
readprofile: fix --reest (--reset) typo

Reported-by: Branislav Blaskovic <notifications@github.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: use correct block size for UDF probe
Zachary Catlin [Sat, 2 Mar 2013 02:34:25 +0000 (21:34 -0500)] 
libblkid: use correct block size for UDF probe

In UDF, Volume Structure Descriptors are always 2048 bytes long (ECMA-167,
3rd ed., §2/9.1), while filesystem sectors are the same size as the sectors
of the underlying media (e.g., UDF 2.01 §1.3.2). Before this commit, the
block size was estimated from VSD offsets, which gives incorrect answers for
non-optical media. Now, the UDF probe uses the device block size by default,
falling back to 2048-byte sectors for the case of optical-disk images.

Signed-off-by: Zachary Catlin <z@zc.is>
12 years agolibmount: ignore name=value if only 'name' is expected
Karel Zak [Thu, 28 Feb 2013 10:26:59 +0000 (11:26 +0100)] 
libmount: ignore name=value if only 'name' is expected

For example

mount /srv/www /mnt -o rw,group=woven,dev,suid

the group= should not be interpreted as userspace mount option, because
umount(8) expects 'group' (without =<value>).

Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoumount: add note about namespaces too --all-targets
Karel Zak [Wed, 27 Feb 2013 10:23:33 +0000 (11:23 +0100)] 
umount: add note about namespaces too --all-targets

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: update deprecated.txt
Karel Zak [Tue, 26 Feb 2013 14:26:54 +0000 (15:26 +0100)] 
docs: update deprecated.txt

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add umount --all-targets tests
Karel Zak [Tue, 26 Feb 2013 13:59:07 +0000 (14:59 +0100)] 
tests: add umount --all-targets tests

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoumount: add --all-targets
Karel Zak [Tue, 26 Feb 2013 13:50:26 +0000 (14:50 +0100)] 
umount: add --all-targets

The same source (whole filesystem or filesystems subvolume) could be
mounted on more targets (mountpoints). For example bind mounts or
btrfs sub-volumes.

If you want to detach the source device from the system then you need
to unmount all the mountpoints.

 umount --all-targets <device|mountpoint>

provides this functionality. This option could be used together with
--recursive. Then all nested mountpoints within the filesystem are
unmounted too. For example:

 umount --recursive --all-targets /dev/sdb1

should be a way how to make the device unmounted at all.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: export umount mountpoint look up code
Karel Zak [Tue, 26 Feb 2013 13:19:05 +0000 (14:19 +0100)] 
libmount: export umount mountpoint look up code

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: don't prepare update for empty mtab/utab on umount
Karel Zak [Tue, 26 Feb 2013 13:17:42 +0000 (14:17 +0100)] 
libmount: don't prepare update for empty mtab/utab on umount

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: optimize tab files parsing
Karel Zak [Tue, 26 Feb 2013 13:16:02 +0000 (14:16 +0100)] 
libmount: optimize tab files parsing

 - ignore empty files
 - ignore empty tables

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoumount: improve --recursive docs
Karel Zak [Mon, 25 Feb 2013 10:17:27 +0000 (11:17 +0100)] 
umount: improve --recursive docs

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoMerge branch 'patch-1' of https://github.com/dtrebbien/util-linux
Karel Zak [Wed, 20 Feb 2013 12:07:07 +0000 (13:07 +0100)] 
Merge branch 'patch-1' of https://github.com/dtrebbien/util-linux

* 'patch-1' of https://github.com/dtrebbien/util-linux:
  Implement mempcpy() in terms of memcpy() if mempcpy() is unavailable

12 years agoadd missing rpmatch.h everywhere it needs to be
William Pitcock [Wed, 20 Feb 2013 12:04:02 +0000 (13:04 +0100)] 
add missing rpmatch.h everywhere it needs to be

Signed-off-by: William Pitcock <nenolod@dereferenced.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: add debug messages for "idmag" stuff and btrfs
Karel Zak [Wed, 20 Feb 2013 09:43:30 +0000 (10:43 +0100)] 
libblkid: add debug messages for "idmag" stuff and btrfs

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: make backup superblock visible for wipefs(8) only
Karel Zak [Tue, 19 Feb 2013 14:51:51 +0000 (15:51 +0100)] 
libblkid: make backup superblock visible for wipefs(8) only

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/tty: don't truncate output on non-terminals
Karel Zak [Tue, 19 Feb 2013 13:10:24 +0000 (14:10 +0100)] 
lib/tty: don't truncate output on non-terminals

 for example:

$ findmnt | cat
$ lslocks > foo

 the output should not be truncated.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: add blkid_probe_step_back to documentation
Karel Zak [Tue, 19 Feb 2013 12:12:31 +0000 (13:12 +0100)] 
libblkid: add blkid_probe_step_back to documentation

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: return disk ID/UUID by PT binary interface
Karel Zak [Tue, 19 Feb 2013 12:09:48 +0000 (13:09 +0100)] 
libblkid: return disk ID/UUID by PT binary interface

 Add blkid_parttable_get_id() function.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: allow to read (PART)UUID/LABEL from udev DB
Karel Zak [Mon, 18 Feb 2013 13:53:12 +0000 (14:53 +0100)] 
findmnt: allow to read (PART)UUID/LABEL from udev DB

Currently findmnt uses libmount to get filesystem properties (and
libmount uses libblkid). This works as expected, but root permissions
are required to read the tags from the devices.

It seems better to read the information from udev db and use libblkid
as fallback solution only.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: resuse udev handler
Karel Zak [Mon, 18 Feb 2013 12:37:00 +0000 (13:37 +0100)] 
lsblk: resuse udev handler

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: add missing information about -o +<list>
Karel Zak [Mon, 18 Feb 2013 12:30:00 +0000 (13:30 +0100)] 
docs: add missing information about -o +<list>

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: support -o +<list> convention
Karel Zak [Mon, 18 Feb 2013 12:21:42 +0000 (13:21 +0100)] 
lslocks: support -o +<list> convention

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: add BLOCKER column
Karel Zak [Mon, 18 Feb 2013 12:12:01 +0000 (13:12 +0100)] 
lslocks: add BLOCKER column

 BLOCKER -  PID of the process blocking the lock

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: fix a mem leak
Karel Zak [Mon, 18 Feb 2013 11:59:33 +0000 (12:59 +0100)] 
libmount: fix a mem leak

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofsck.cramfs: add dummy -a -y for compatibility
Karel Zak [Mon, 18 Feb 2013 11:18:29 +0000 (12:18 +0100)] 
fsck.cramfs: add dummy -a -y for compatibility

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: detect blocked locks, fix /proc/locks parser
Karel Zak [Thu, 14 Feb 2013 15:29:51 +0000 (16:29 +0100)] 
lslocks: detect blocked locks, fix /proc/locks parser

$ flock foo -c "sleep 100" & flock foo -c "sleep 100"

old version:
  $ lslocks
  lslocks: failed to parse pid: 'WRITE'

new version:

COMMAND           PID  TYPE  SIZE MODE   M      START        END PATH
[...]
flock            1318 FLOCK    0B WRITE* 0          0          0 /home/projects/
flock            1319 FLOCK    0B WRITE  0          0          0 /home/projects/

 The asterisk (e.g. WRITE*) is used for blocked processes.

Reported-by: Mantas Mikulenas <grawity@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: use libmount to parse mountinfo
Karel Zak [Thu, 14 Feb 2013 14:59:28 +0000 (15:59 +0100)] 
lslocks: use libmount to parse mountinfo

old version:
$ strace -e open lslocks 2>&1 | grep mountinfo | wc -l
118

new version:
strace -e open ./lslocks 2>&1 | grep mountinfo | wc -l
1

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomountpoint: don't hardcode paths
Karel Zak [Thu, 14 Feb 2013 14:46:06 +0000 (15:46 +0100)] 
mountpoint: don't hardcode paths

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolscpu: don't read cpuid on non-live systems
Karel Zak [Thu, 14 Feb 2013 14:38:08 +0000 (15:38 +0100)] 
lscpu: don't read cpuid on non-live systems

Reported-by: Luis Aranguren <pizzaman@hotmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agonsenter: fix errors in manpage
Zbigniew Jędrzejewski-Szmek [Thu, 14 Feb 2013 02:05:49 +0000 (21:05 -0500)] 
nsenter: fix errors in manpage

- spell abbreviations with capital letters
- fix the names of a few options and files

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
12 years agounshare,nsenter: spawn shell by default
Zbigniew Jędrzejewski-Szmek [Thu, 14 Feb 2013 02:05:48 +0000 (21:05 -0500)] 
unshare,nsenter: spawn shell by default

The behaviour mimics chroot.

Possibly it would have been nicer to to query the password database in
the new namepace and run the shell of the user there, but it's hard to
do correctly. getpwuid() might need to load nss plugins, and the arch
in the new namespace might be different (in case of NEWNS mounts), or
the hostname might be different, etc. So in general it's not possible
to do it reliably.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
12 years agolibblkid: read whole buffer for iso_volume_descriptor
Karel Zak [Thu, 14 Feb 2013 12:56:34 +0000 (13:56 +0100)] 
libblkid: read whole buffer for iso_volume_descriptor

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: Probe UDF volumes for ISO9660 info as well
Zeeshan Ali (Khattak) [Tue, 12 Feb 2013 01:33:18 +0000 (03:33 +0200)] 
libblkid: Probe UDF volumes for ISO9660 info as well

I have seen blkid failing to report any meaningful data on some of UDF
volumes I have (Windows installer media):

$ ./blkid -p -o udev en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso
ID_FS_LABEL=UDF_Volume
ID_FS_LABEL_ENC=UDF\x20Volume
ID_FS_TYPE=udf

Also, once my patches to expose more of ISO9660 info get merged, we'd
also need the same info to be exposed for UDF volumes.

This patch adds ISO9660 probing to UDF volumes and here is the result I
see on my example UDF volume (together with my pending patch to expose
more ISO9660 information):

$ ./blkid -p -o udev en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso
ID_FS_PUBLISHER_ID=MICROSOFT CORPORATION
ID_FS_APPLICATION_ID=CDIMAGE 2.54 (01/01/2005 TM)
ID_FS_UUID=2011-04-12-02-38-58-00
ID_FS_UUID_ENC=2011-04-12-02-38-58-00
ID_FS_BOOT_SYSTEM_ID=EL TORITO SPECIFICATION
ID_FS_LABEL=GSP1RMCPRXFRER_EN_DVD
ID_FS_LABEL_ENC=GSP1RMCPRXFRER_EN_DVD
ID_FS_TYPE=iso9660

$ ./blkid -p -o udev en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso
ID_FS_PUBLISHER_ID=MICROSOFT CORPORATION
ID_FS_APPLICATION_ID=CDIMAGE 2.52 (03/09/2004 TM)
ID_FS_UUID=2008-04-14-12-00-00-00
ID_FS_UUID_ENC=2008-04-14-12-00-00-00
ID_FS_BOOT_SYSTEM_ID=EL TORITO SPECIFICATION
ID_FS_LABEL=GRTMPFPP_EN
ID_FS_LABEL_ENC=GRTMPFPP_EN
ID_FS_TYPE=iso9660

Before anyone asks, Yes! The UDF media I have is all legal and downloaded
directly from MSDN. :)

[kzak@redhat.com: - read LABEL from UDF only if not found anything
                    useful in ISO9660]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: Expose more ISO9660 headers
Zeeshan Ali (Khattak) [Mon, 11 Feb 2013 21:22:12 +0000 (23:22 +0200)] 
libblkid: Expose more ISO9660 headers

In order to kill libosinfo's infamous udev rule[1], we need to make blkid
report the following information as udev properties on IS09660 media so
that libosinfo can make use of that for detection:

1. Volume ID (already exposed as label).
2. System ID.
3. Publisher ID.
4. Application ID.
5. Boot record's boot system ID, (almost always 'EL TORITO
   SPECIFICATION' if boot record is present).

Example use:

$ blkid -p -o udev Fedora-17-x86_64-DVD.iso
ID_FS_SYSTEM_ID=LINUX
ID_FS_APPLICATION_ID=GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C)
1993 E.YOUNGDALE
ID_FS_UUID=2012-05-22-20-55-32-00
ID_FS_UUID_ENC=2012-05-22-20-55-32-00
ID_FS_BOOT_SYSTEM_ID=EL TORITO SPECIFICATION
ID_FS_LABEL=Fedora_17_x86_64
ID_FS_LABEL_ENC=Fedora\x2017\x20x86_64
ID_FS_TYPE=iso9660
ID_PART_TABLE_TYPE=dos

[1] https://fedorahosted.org/libosinfo/ticket/1

[kzak@redhat.com: - add blkid_ltrim_whitespace() and use it together
                    with blkid_rtrim_whitespace() to trim white spaces
                  - enlarge blkid values to 128 bytes
                  - add generic blkid_probe_set_id_label() function
                  - always terminate all _ID with \0
                  - don't export the _IDs to blkid cache]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: Don't keep reading same sector of ISO
Zeeshan Ali (Khattak) [Mon, 11 Feb 2013 21:22:11 +0000 (23:22 +0200)] 
libblkid: Don't keep reading same sector of ISO

We were reading the same sector over and over again when parsing ISO9660.
This patches fixes it.

12 years agobuild-sys: add package url to AC_INIT
Sami Kerola [Sun, 10 Feb 2013 21:33:41 +0000 (21:33 +0000)] 
build-sys: add package url to AC_INIT

See last line from './configure --help'.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agobuild-sys: use AC_USE_SYSTEM_EXTENSIONS
Sami Kerola [Sun, 10 Feb 2013 21:33:40 +0000 (21:33 +0000)] 
build-sys: use AC_USE_SYSTEM_EXTENSIONS

The AC_GNU_SOURCE is obsolete.

Addresses: http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html#index-AC_005fGNU_005fSOURCE-2058
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agobuild-sys: use AC_COMPILE_IFELSE
Sami Kerola [Sun, 10 Feb 2013 21:33:39 +0000 (21:33 +0000)] 
build-sys: use AC_COMPILE_IFELSE

The AC_TRY_COMPILE is obsolete.

Addresses: http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html#index-AC_005fTRY_005fCOMPILE-2203
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolibmount: add missing MNT_ERR_AMBIFS
Karel Zak [Thu, 14 Feb 2013 08:20:30 +0000 (09:20 +0100)] 
libmount: add missing MNT_ERR_AMBIFS

Sorry, the last commit into libmount has been incomplete.

Reported-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoswitch_root: Add a sanity check
Richard Weinberger [Sat, 9 Feb 2013 18:22:50 +0000 (19:22 +0100)] 
switch_root: Add a sanity check

As switch_root basically does rm -Rf / we should make sure
that / is really an initramfs.

Signed-off-by: Richard Weinberger <richard@nod.at>
12 years agobuild-sys: add config-gen.d stuff for chsh-chfn
Karel Zak [Wed, 13 Feb 2013 12:49:05 +0000 (13:49 +0100)] 
build-sys: add config-gen.d stuff for chsh-chfn

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agochsh-chfn: fix bugs, improve compilation
Karel Zak [Wed, 13 Feb 2013 12:44:34 +0000 (13:44 +0100)] 
chsh-chfn: fix bugs, improve compilation

 * rename --disable-require-password to --disable-chsh-chfn-password

 * is_local() is really unnecessary when linked with libuser

 * fix set_value_libuser() returns codes

 * fix chfn.c, there is no 'pw', but oldf.pw

 * don't link with PAM when--disable-chsh-chfn-password

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: correctly propagate ambivalent blkid probing results
Karel Zak [Wed, 13 Feb 2013 11:36:10 +0000 (12:36 +0100)] 
libmount: correctly propagate ambivalent blkid probing results

libmount ignores "ambivalent probing result" from libblkid and tries
filesystems /etc/filesystems. This is incorrect behavior.

Reported-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>