]>
git.ipfire.org Git - thirdparty/util-linux.git/log
Karel Zak [Tue, 29 Jan 2013 14:28:30 +0000 (15:28 +0100)]
libfdisk: extend "ask" API, add support for offsets
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 29 Jan 2013 14:25:47 +0000 (15:25 +0100)]
lib/strutils: simplify strtosize(), return info about suffix
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 28 Jan 2013 15:16:11 +0000 (16:16 +0100)]
fdisk: add callback for ask-numbers API
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 28 Jan 2013 15:14:21 +0000 (16:14 +0100)]
libfdisk: add "ask" interface
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 28 Jan 2013 15:11:41 +0000 (16:11 +0100)]
libfdisk: fix gpt status, don't use xcalloc() in library
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 28 Jan 2013 09:37:45 +0000 (10:37 +0100)]
fdisk: correctly initialize pointer to sun label
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 28 Jan 2013 09:28:32 +0000 (10:28 +0100)]
fdisk: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 28 Jan 2013 09:09:03 +0000 (10:09 +0100)]
libfdisk: add stuff for unit tests
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 25 Jan 2013 19:04:11 +0000 (20:04 +0100)]
libfdisk: (gpt) fix compiler warnings [-Wformat]
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 22 Jan 2013 17:18:29 +0000 (18:18 +0100)]
libfdisk: add FDISK_LABEL_FL_ADDPART_NOPARTNO
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 22 Jan 2013 17:05:18 +0000 (18:05 +0100)]
fdisk: remove fdisk_label from API functions, add asserts, use size_t
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 22 Jan 2013 13:02:22 +0000 (14:02 +0100)]
libfdisk: (gpt) move code from fdisk to libfdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Karel Zak [Mon, 4 Mar 2013 11:40:38 +0000 (12:40 +0100)]
Merge branch 'master' of https://github.com/zec/util-linux
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>
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>
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>
Mike Frysinger [Fri, 1 Mar 2013 04:03:02 +0000 (23:03 -0500)]
unshare: tweak style
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
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>
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>
Sami Kerola [Sat, 16 Feb 2013 18:08:40 +0000 (18:08 +0000)]
wall: use xgethostname()
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>