]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 years agobuild-sys: add nsenter to gitignore
Sami Kerola [Sun, 20 Jan 2013 18:04:52 +0000 (18:04 +0000)] 
build-sys: add nsenter to gitignore

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agonsenter: rename --exec/-e to --no-fork/-F
Zbigniew Jędrzejewski-Szmek [Mon, 21 Jan 2013 06:38:05 +0000 (01:38 -0500)] 
nsenter: rename --exec/-e to --no-fork/-F

The naming of this option was really confusing.
Just rename it for clarity.

[kzak@redhat.com: rebase to original code without --all]

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agonsenter: allow arguments to be specified in any order
Zbigniew Jędrzejewski-Szmek [Mon, 21 Jan 2013 06:38:01 +0000 (01:38 -0500)] 
nsenter: allow arguments to be specified in any order

Allows 'nsenter -mt $PID', which would fail previously.

[kzak@redhat.com: - fix open_target_fd() arguments]

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotextual: use UTIL_LINUX_VERSION everywhere
Karel Zak [Fri, 25 Jan 2013 11:05:26 +0000 (12:05 +0100)] 
textual: use UTIL_LINUX_VERSION everywhere

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agorenice: accept also -V for --version, and document it
Benno Schulenberg [Mon, 6 Feb 2012 16:48:25 +0000 (17:48 +0100)] 
renice: accept also -V for --version, and document it

Also improve the man page.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agorenice: correct the usage synopsis, and improve help text
Benno Schulenberg [Mon, 6 Feb 2012 15:44:23 +0000 (16:44 +0100)] 
renice: correct the usage synopsis, and improve help text

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: standardize reporting of program name plus package version
Benno Schulenberg [Mon, 6 Feb 2012 15:37:16 +0000 (16:37 +0100)] 
textual: standardize reporting of program name plus package version

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: gettextize several overlooked messages
Benno Schulenberg [Mon, 6 Feb 2012 15:11:27 +0000 (16:11 +0100)] 
textual: gettextize several overlooked messages

Also improve the clarity of some of them.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: tag two bug messages as "internal error"
Benno Schulenberg [Mon, 6 Feb 2012 15:05:35 +0000 (16:05 +0100)] 
textual: tag two bug messages as "internal error"

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: remove inconsistent periods from two error messages
Benno Schulenberg [Mon, 6 Feb 2012 15:04:33 +0000 (16:04 +0100)] 
textual: remove inconsistent periods from two error messages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotextual: fix a few typos in some of the usage help texts
Benno Schulenberg [Mon, 6 Feb 2012 15:01:48 +0000 (16:01 +0100)] 
textual: fix a few typos in some of the usage help texts

Also improve clarity of some other lines of those texts.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
12 years agotests: sort commands strings
Sami Kerola [Sat, 19 Jan 2013 00:09:11 +0000 (00:09 +0000)] 
tests: sort commands strings

The list is starting to be long enough that making any order to it seems
like right thing to do.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add ipcmk(1) and ipcrm(1) checks
Sami Kerola [Sat, 19 Jan 2013 00:09:10 +0000 (00:09 +0000)] 
tests: add ipcmk(1) and ipcrm(1) checks

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodmesg: parse level when --color is used
Sami Kerola [Sat, 19 Jan 2013 00:09:09 +0000 (00:09 +0000)] 
dmesg: parse level when --color is used

When user runs with --color it should not need to be combined with
filtering per level or facility, or decoding.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add whereis(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:08 +0000 (00:09 +0000)] 
tests: add whereis(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add isosize(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:07 +0000 (00:09 +0000)] 
tests: add isosize(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agodocs: mkswap.8: recommend fallocate(1)
Sami Kerola [Sat, 19 Jan 2013 00:09:06 +0000 (00:09 +0000)] 
docs: mkswap.8: recommend fallocate(1)

There is no reason why fallocate(1) should not be preferred instead of
'dd if=/dev/zero of=swapfile' with it's cumbersome size spec.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add fallocate(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:05 +0000 (00:09 +0000)] 
tests: add fallocate(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add setarch(8) check
Sami Kerola [Sat, 19 Jan 2013 00:09:04 +0000 (00:09 +0000)] 
tests: add setarch(8) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add setsid(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:03 +0000 (00:09 +0000)] 
tests: add setsid(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agodmesg: add boundary check to facility & level array usage
Sami Kerola [Sat, 19 Jan 2013 00:09:02 +0000 (00:09 +0000)] 
dmesg: add boundary check to facility & level array usage

The dmesg should not crash while --decode'ing message facilities and
levels to readable string even if the values are out of bounds.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add dmesg(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:01 +0000 (00:09 +0000)] 
tests: add dmesg(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add line(1) check
Sami Kerola [Sat, 19 Jan 2013 00:09:00 +0000 (00:09 +0000)] 
tests: add line(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add more(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:59 +0000 (00:08 +0000)] 
tests: add more(1) check

[kzak@redhat.com: use test_more program rather than directly more(1)]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomore: allow to compile as non-interactive test_more program
Karel Zak [Thu, 24 Jan 2013 18:27:12 +0000 (19:27 +0100)] 
more: allow to compile as non-interactive test_more program

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: add --disable-{more,ul,pg}
Karel Zak [Thu, 24 Jan 2013 18:23:56 +0000 (19:23 +0100)] 
build-sys: add --disable-{more,ul,pg}

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: support list of variables for UL_REQUIRES_HAVE macro
Karel Zak [Thu, 24 Jan 2013 18:22:40 +0000 (19:22 +0100)] 
build-sys: support list of variables for UL_REQUIRES_HAVE macro

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add ionice(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:57 +0000 (00:08 +0000)] 
tests: add ionice(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add ul(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:56 +0000 (00:08 +0000)] 
tests: add ul(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add tailf(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:55 +0000 (00:08 +0000)] 
tests: add tailf(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add mcookie(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:54 +0000 (00:08 +0000)] 
tests: add mcookie(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add getopt(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:53 +0000 (00:08 +0000)] 
tests: add getopt(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add utmpdump(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:52 +0000 (00:08 +0000)] 
tests: add utmpdump(1) check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agotests: add rev(1) check
Sami Kerola [Sat, 19 Jan 2013 00:08:51 +0000 (00:08 +0000)] 
tests: add rev(1) check

Fairly lenghty input line tries to ensure realloc segment in code is hit
at least once.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agobuild-sys: add gcov files to .gitignore
Sami Kerola [Sat, 19 Jan 2013 00:08:50 +0000 (00:08 +0000)] 
build-sys: add gcov files to .gitignore

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoinclude: add missing values to sysfs_cxt initializer definition
Sami Kerola [Wed, 9 Jan 2013 19:36:56 +0000 (19:36 +0000)] 
include: add missing values to sysfs_cxt initializer definition

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoipcmk: use random_get_bytes() to generate IPC keys
Karel Zak [Thu, 24 Jan 2013 15:27:04 +0000 (16:27 +0100)] 
ipcmk: use random_get_bytes() to generate IPC keys

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agocal: don't mix ncurses output functions and printf()
Karel Zak [Thu, 17 Jan 2013 17:48:16 +0000 (18:48 +0100)] 
cal: don't mix ncurses output functions and printf()

Fedora 18 (ncurses-libs-5.9-7.20121017, glibc-2.16-28):

$ cal | cat
Actual results:
    January 2013    Su Mo Tu We Th Fr Sa       1  2  3  4  5 6  7  8
9 10 11 1213 14 15 16 17 18 1920 21 22 23 24 25 2627 28 29 30 31

Not sure where is the problem, but it's too fragile to mix two
output methods in one code.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=896447
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agonsenter: improve optional args in usage() and man page
Karel Zak [Thu, 17 Jan 2013 12:30:33 +0000 (13:30 +0100)] 
nsenter: improve optional args in usage() and man page

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agounshare,nsenter: Move the old libc handling into a common header namespace.h
Eric W. Biederman [Thu, 17 Jan 2013 00:36:32 +0000 (16:36 -0800)] 
unshare,nsenter: Move the old libc handling into a common header namespace.h

Move the defitions of CLONE_NEWNS, CLONE_NEWUTS, CLONE_NEWIPC,
CLONE_NEWNET, CLONE_NEWUSER, CLONE_NEWPID into namespace.h in case
sched.h does not provide those definitions.  Are there systems
around that are old enough that still need this?

Move the definitions of unshare() and setns() into namespace.h
for supporting old versions of libc that does not provice these.
I have tested this support with setns as I still have systems
old enough that glibc does not wrap setns.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agonsenter: Replace a bare strtoul with strtoul_or_err
Eric W. Biederman [Thu, 17 Jan 2013 00:35:53 +0000 (16:35 -0800)] 
nsenter: Replace a bare strtoul with strtoul_or_err

This is shorter code and makes things a bit clearer and less
error prone if anyone happens to copy the code.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agonsenter: Add const to declarations where possible.
Eric W. Biederman [Thu, 17 Jan 2013 00:35:12 +0000 (16:35 -0800)] 
nsenter: Add const to declarations where possible.

Make it clear where functions do not modify their arguments.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agonsenter: Properly spell significant in a comment.
Eric W. Biederman [Thu, 17 Jan 2013 00:34:44 +0000 (16:34 -0800)] 
nsenter: Properly spell significant in a comment.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agonsenter: Enhance waiting for a child process
Eric W. Biederman [Thu, 17 Jan 2013 00:34:17 +0000 (16:34 -0800)] 
nsenter: Enhance waiting for a child process

In the case of a pid namespace we need to fork a child process instead
of calling exec.  Move all of that logic out of line into a function
continue_as_child, making the logic of the primary case easier to
understand.

Update the logic for waiting for a child process to suspend ourselves
when the child processes suspends and to continue the child process
when we are unsuspsended.  This supports the bash suspend command and
various editors that suspend themselves.

If the child process exits with a signal update the logic to run
kill(getpid(), WTERMSIG(status)) so the caller sees the same exit code
that nsenter observed.

There will always be permission to send signals to our children and
the tty is not changing so there is no need for the intermediate
process to forward signals to it's child.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agounshare: Add support for the pid and user namespaces
Eric W. Biederman [Fri, 11 Jan 2013 22:53:34 +0000 (14:53 -0800)] 
unshare: Add support for the pid and user namespaces

- Update the unshare application to support the pid and user namespaces.
- Update the man page for the new options
- Fix typo in the man page where UTS was spelled UTC.
- Remove the vestigal support for running a suid unshare.
  After unsharing a user namespace setuid(getuid()) won't work because
  no uid or gid mappings have been specified yet. So it is just easier not
  to have any support for running suid.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agonsenter: new command (light wrapper around setns)
Eric W. Biederman [Fri, 11 Jan 2013 22:46:38 +0000 (14:46 -0800)] 
nsenter: new command (light wrapper around setns)

Inspired by unshare, nsenter is a simple wrapper around setns that
allows running a new process in the context of an existing process.

Full paths may be specified to the namespace arguments so that
namespace file descriptors may be used wherever they reside in the
filesystem.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
12 years agoRevert "unshare: support the switching of namespaces"
Karel Zak [Thu, 17 Jan 2013 12:00:44 +0000 (13:00 +0100)] 
Revert "unshare: support the switching of namespaces"

The functionality will be replaced with nsenter from Eric W.
Biederman.

This reverts commit 4bbe8099390d528018890efa914e268de3c4b44b.

12 years agofindmnt: use tree output in more cases
Karel Zak [Thu, 17 Jan 2013 11:02:03 +0000 (12:02 +0100)] 
findmnt: use tree output in more cases

It seems that we can create the tree also if output is restricted by
fstype or options filter, for example

$ findmnt -t cgroups

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: make --verbose more verbose about propagation
Karel Zak [Tue, 15 Jan 2013 15:09:07 +0000 (16:09 +0100)] 
mount: make --verbose more verbose about propagation

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: keep MS_PROPAGATION flags in mnt_context_set_mflags() result
Karel Zak [Tue, 15 Jan 2013 15:08:41 +0000 (16:08 +0100)] 
libmount: keep MS_PROPAGATION flags in mnt_context_set_mflags() result

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: write success messages to stdout
Karel Zak [Tue, 15 Jan 2013 14:53:46 +0000 (15:53 +0100)] 
mount: write success messages to stdout

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agotests: add/improve mount shared-subtree tests
Karel Zak [Tue, 15 Jan 2013 13:25:23 +0000 (14:25 +0100)] 
tests: add/improve mount shared-subtree tests

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: support multiple MS_PROPAGATION flags in one mount(8) exec
Karel Zak [Tue, 15 Jan 2013 13:23:54 +0000 (14:23 +0100)] 
mount: support multiple MS_PROPAGATION flags in one mount(8) exec

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: allow to use propagation flags in fstab
Karel Zak [Tue, 15 Jan 2013 12:55:29 +0000 (13:55 +0100)] 
libmount: allow to use propagation flags in fstab

Linux kernel does not allow to change more than one propagation flag
by one mount(2) syscall. The flags also cannot be mixed with another
mount options. It means that the propagation flags cannot be stored in
/etc/fstab, manual "mount --make-* <mountpoint>" is always necessary
after successful mount. Painful...

This patch implements additional mount(2) after previous successful
mount(2) (or exec /sbin/mount.<type>).

For example:

  mount /dev/sda1 /A -o private,unbindable,ro

or fstab entry:

  /dev/sda1   /A  auto  ro,private,unbindable

is implemented by three mount(2) calls:

- 1st mounts /dev/sda1 with MS_RDONLY
- 2nd sets MS_PRIVATE flag
        - 3rd sets MS_UNBINDABLE flag.

It's the same as as to manually call:

  mount /dev/sda1 /A -o ro
  mount --make-private /A
  mount --make-unbindable /A

This solution is not atomic, and umount(2) is not called if
propagation flags are not successfully applied, only error is
returned.

This change does not affect libmount API, so one beautiful day when
mount(2) syscall will be improved we can drop this nasty patch.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agokill: add note about threads to the man page
Karel Zak [Tue, 15 Jan 2013 10:14:03 +0000 (11:14 +0100)] 
kill: add note about threads to the man page

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=846790
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: make --target usable with bind mounts
Karel Zak [Mon, 14 Jan 2013 13:50:50 +0000 (14:50 +0100)] 
findmnt: make --target usable with bind mounts

The --target <non-mount-point> functionality should be enabled only if
previous regular search found nothing to avoid collisions with bind
mounts, because to detect mountpoint we use traditional child / parent
stat.st_dev comparison which does not work for bind mounts (--bind /A
/A).

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: add PROPAGATION column
Karel Zak [Thu, 10 Jan 2013 14:59:16 +0000 (15:59 +0100)] 
findmnt: add PROPAGATION column

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: add mnt_fs_get_propagation()
Karel Zak [Thu, 10 Jan 2013 14:58:52 +0000 (15:58 +0100)] 
libmount: add mnt_fs_get_propagation()

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: add ID column
Karel Zak [Thu, 10 Jan 2013 13:59:39 +0000 (14:59 +0100)] 
findmnt: add ID column

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofindmnt: add OPT-FIELDS column
Karel Zak [Thu, 10 Jan 2013 13:58:05 +0000 (14:58 +0100)] 
findmnt: add OPT-FIELDS column

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: read optional mountinfo fields
Ondrej Oprala [Thu, 10 Jan 2013 11:35:08 +0000 (12:35 +0100)] 
libmount: read optional mountinfo fields

[kzak@redhat.com: - rename struct member and functions from
                    "propagation" to "optional fields"
                  - split the original patch
                  - fix parser]

Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount: fix regression test helper
Ondrej Oprala [Thu, 10 Jan 2013 11:07:29 +0000 (12:07 +0100)] 
libmount: fix regression test helper

Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: make btrfs magics more readable
Karel Zak [Thu, 10 Jan 2013 10:40:21 +0000 (11:40 +0100)] 
libblkid: make btrfs magics more readable

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: cleanup --enable-most-builds list
Sami Kerola [Wed, 9 Jan 2013 22:44:06 +0000 (22:44 +0000)] 
build-sys: cleanup --enable-most-builds list

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agobuild-sys: ignore chkdupexe
Sami Kerola [Wed, 9 Jan 2013 22:44:05 +0000 (22:44 +0000)] 
build-sys: ignore chkdupexe

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agobuild-sys: add files to distribution
Sami Kerola [Wed, 9 Jan 2013 22:44:04 +0000 (22:44 +0000)] 
build-sys: add files to distribution

To fix 'make distcheck' compilation.  The fdisks/Makemodule.am has one
new entry 'dos_part_types.h', the rest is about sorting the list.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolibblkid: add support for btrfs backup superblock
Goffredo Baroncelli [Wed, 9 Jan 2013 21:14:43 +0000 (22:14 +0100)] 
libblkid: add support for btrfs backup superblock

Btrfs has three superblock. The first one is placed at 64KB, the second one at
64MB, the third one at 256GB.

If the first superblock is valid except that the "magic field" is zeroed, btrfs
skips the check of the other superblocks.  If the first superblock is fully
invalid, btrfs checks for the other superblock.

So zeroing the first superblock "magic field" at the beginning seems that the
filesystem is wiped. But when the first superblock is overwritten (eg by
another filesystem), then the other two superblock may be considered valid, and
the filesystem may resurrect.

This patch allow to find and wipe the other btrfs superblocks signature.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agohexdump: do not segfault when iterating over an empty format string
Ondrej Oprala [Fri, 21 Dec 2012 12:04:04 +0000 (13:04 +0100)] 
hexdump: do not segfault when iterating over an empty format string

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
12 years agomount: add support for x-mount.mkdir[=<mode>] option
Ondrej Oprala [Fri, 21 Dec 2012 13:45:46 +0000 (14:45 +0100)] 
mount: add support for x-mount.mkdir[=<mode>] option

If the target directory (mountpoint) does not exist then mount(8) will create
it before mount.<type> is executed or mount(2) syscall is called.

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibmount; add recursive mkdir
Karel Zak [Wed, 9 Jan 2013 17:05:08 +0000 (18:05 +0100)] 
libmount; add recursive mkdir

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: document x-* options
Karel Zak [Wed, 9 Jan 2013 14:41:46 +0000 (15:41 +0100)] 
mount: document x-* options

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomount: Fix -t in listing mode when run as non-root
Richard Tollerton [Thu, 3 Jan 2013 06:05:34 +0000 (00:05 -0600)] 
mount: Fix -t in listing mode when run as non-root

Presently, libmount-mount completely prohibits the use of -t by non-root
users.  This breaks using -t in listing mode as a user, which represents
a regression against mount-deprecated, macosx and presumably *BSD.

This commit fixes the issue by deferring the mnt_context_is_restricted
check for -t until we know we're not in listing mode.

Signed-off-by: Rich Tollerton <rich.tollerton@ni.com>
12 years agomkfs.minix: fix compiler warning [-Wformat]
Karel Zak [Wed, 9 Jan 2013 13:44:59 +0000 (14:44 +0100)] 
mkfs.minix: fix compiler warning [-Wformat]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolibblkid: add missing promise raid metadata locations
Phillip Susi [Wed, 2 Jan 2013 16:40:46 +0000 (11:40 -0500)] 
libblkid: add missing promise raid metadata locations

There are some additional locations where dmraid can find
and use pdc raid metadata that libblkid was not checking.

12 years agomount: document options for debugfs
Dave Reisner [Wed, 2 Jan 2013 14:11:10 +0000 (09:11 -0500)] 
mount: document options for debugfs

Since 3.4, debugfs allows uid, gid, and mode options.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agobuild-sys: invert flag for sulogin emergency mount
Dave Reisner [Sun, 30 Dec 2012 20:00:23 +0000 (15:00 -0500)] 
build-sys: invert flag for sulogin emergency mount

This should be disabled by default.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
12 years agolosetup: fix declarations [smatch scan]
Sami Kerola [Fri, 28 Dec 2012 21:23:43 +0000 (21:23 +0000)] 
losetup: fix declarations [smatch scan]

sys-utils/losetup.c:309:2: error: 'for' loop initial declarations are only allowed in C99 mode
sys-utils/losetup.c:374:2: error: 'for' loop initial declarations are only allowed in C99 mode

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoswapon: default to --show if nothing is requested
Sami Kerola [Fri, 28 Dec 2012 21:23:42 +0000 (21:23 +0000)] 
swapon: default to --show if nothing is requested

Proposed-by: Karel Zak <kzak@redhat.com>
References: http://www.spinics.net/lists/util-linux-ng/msg07301.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoipcs: fix spacing in summary output
Sami Kerola [Fri, 28 Dec 2012 21:23:41 +0000 (21:23 +0000)] 
ipcs: fix spacing in summary output

Change 56692a6 introduced spacing error to --summary printing.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoscript: search shell from path, when necessary
Sami Kerola [Fri, 28 Dec 2012 21:23:40 +0000 (21:23 +0000)] 
script: search shell from path, when necessary

Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518532
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoflock: improve usage strings
Mike Frysinger [Wed, 26 Dec 2012 20:10:29 +0000 (15:10 -0500)] 
flock: improve usage strings

The current examples miss the best usage of all: specifying the command
and its arguments directly on the command line.  Add that to both the
program usage and the man page.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoinclude/ttyutils: add default chardata
Werner Fink [Tue, 8 Jan 2013 14:38:40 +0000 (15:38 +0100)] 
include/ttyutils: add default chardata

this one moves the init_chardata to include/ttyutils.h as well as to
lib/include/ttyutils.c.  Also the macros CTL/CTRL are fixed in
agetty.c and sulogin.c to use the XOR variant CTL.

[kzak@redhat.com: use macro rather than global variable for default
                  chardata]

Signed-off-by: Werner Fink <werner@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude: cleanup copyright headers
Karel Zak [Tue, 8 Jan 2013 14:00:23 +0000 (15:00 +0100)] 
include: cleanup copyright headers

We use the code from include/ and lib/ on many places, so use public
domain if possible or LGPL for code copied from libs.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoinclude/bitopts: Use the operating system byteswapping functions
Karel Zak [Tue, 8 Jan 2013 13:07:48 +0000 (14:07 +0100)] 
include/bitopts: Use the operating system byteswapping functions

The swap macros are already in libc.

Co-Author: Cristian Rodríguez <crrodriguez@opensuse.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoswapon: print warning about insecure owner/permissions
Karel Zak [Tue, 8 Jan 2013 12:13:40 +0000 (13:13 +0100)] 
swapon: print warning about insecure owner/permissions

Let's make it more obvious if swap area is accessible for non-root
users. The old version prints the warning only if --verbose is
specified.

Reported-by: mp.lists@free.fr
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolsblk: Add write-same attribute to topology info
Milan Broz [Thu, 20 Dec 2012 11:42:23 +0000 (12:42 +0100)] 
lsblk: Add write-same attribute to topology info

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agounshare: support the switching of namespaces
Neil Horman [Fri, 28 Dec 2012 16:22:18 +0000 (11:22 -0500)] 
unshare: support the switching of namespaces

In addition to the unshare syscall, there exists the setns syscall, which
allows processes to migrate to the namepsaces of other processes.  Add this
functionality into the unshare command, as they operate in a fairly simmilar
fashion.

Note: There was discussion of adding a path based namespace argument to unshare
in the origional discussion thread, but I opted to leave that out as it didn't
seem to fit in nicely with the current argument pattern.  I figure we can always
add that in later if we need to

[kzak@redhat.com: - fix optional arguments
                  - do not call unshare if no flag specified
                  - use O_CLOEXEC
                  - codding style cleanup]

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoagetty: replace perms 660 to 620
Karel Zak [Wed, 2 Jan 2013 07:23:00 +0000 (08:23 +0100)] 
agetty: replace perms 660 to 620

 ... the default is root:tty 620

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agobuild-sys: remove consoles.h
Karel Zak [Thu, 27 Dec 2012 16:37:27 +0000 (17:37 +0100)] 
build-sys: remove consoles.h

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: don't use {de,con}structor attributes
Karel Zak [Sun, 23 Dec 2012 21:44:05 +0000 (22:44 +0100)] 
sulogin: don't use {de,con}structor attributes

We're not Russian roulette players, so don't use such ugly things at all..

Reported-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosulogin: remove consoles.c from libcommon
Karel Zak [Sun, 23 Dec 2012 21:14:21 +0000 (22:14 +0100)] 
sulogin: remove consoles.c from libcommon

- move struct chardata to include/ttyutils.h
- move console.{h,c} to login-utils/sulogin-* (it's sulogin specific)
- fix sulogin and agetty includes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomkfs.minix: fsck:minix: fix compiler warnings
Karel Zak [Thu, 20 Dec 2012 19:01:35 +0000 (20:01 +0100)] 
mkfs.minix: fsck:minix: fix compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agomkswap: fix compiler warnings
Karel Zak [Thu, 20 Dec 2012 19:00:11 +0000 (20:00 +0100)] 
mkswap: fix compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolslocks: fix compiler warnings
Karel Zak [Thu, 20 Dec 2012 18:57:48 +0000 (19:57 +0100)] 
lslocks: fix compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agofdisk: (gpt) fix compiler warnings
Karel Zak [Thu, 20 Dec 2012 18:55:55 +0000 (19:55 +0100)] 
fdisk: (gpt) fix compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agosetterm: fix compiler warning
Karel Zak [Thu, 20 Dec 2012 18:55:20 +0000 (19:55 +0100)] 
setterm: fix compiler warning

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: fix compiler warnings, use 64bit time
Karel Zak [Thu, 20 Dec 2012 18:52:16 +0000 (19:52 +0100)] 
ipcs: fix compiler warnings, use 64bit time

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agohwclock: fix compiler warning
Karel Zak [Thu, 20 Dec 2012 18:51:38 +0000 (19:51 +0100)] 
hwclock: fix compiler warning

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agoipcs: make --human really sexy
Karel Zak [Wed, 19 Dec 2012 14:27:12 +0000 (15:27 +0100)] 
ipcs: make --human really sexy

Align the "size" columns to the right.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 years agolib/ismounted: improve loopdev support
Karel Zak [Wed, 19 Dec 2012 13:34:01 +0000 (14:34 +0100)] 
lib/ismounted: improve loopdev support

... to make it usable for situations when the same backing
file is mapped to more loop devices.

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