Commit graph

6464 commits

Author SHA1 Message Date
Karel Zak
b1d4444988 lib/tty: fix get_terminal_name() usage, cleanup code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-28 12:10:29 +02:00
Karel Zak
ef264c830e agetty: allow full control on CLOCAL flag
Now the -L option allows to explicitly enable CLOCAL flag.

Unfortunately sometimes it's necessary to clear the flag. This patch
add optional argument =<mode> to specify 'auto', 'always' and 'never'
to control CLOCAL flag.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=816342
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-23 09:47:58 +02:00
Gilles Espinasse
e992a7b20d tests: new warning fix
2.23 added -Wstrict-prototypes check. Fix make check showing
CC tests/helpers/test_md5.o
tests/helpers/test_md5.c:8: warning: function declaration isn't a prototype

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2013-05-21 11:38:55 +02:00
Gilles Espinasse
34228e6972 util-linux minor typo fixes
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2013-05-21 11:38:35 +02:00
Karel Zak
bdd384d10d build-sys: always check for setns() and unshare() libs functions
$ ./configure --disable-unshare
 $ make nsenter

  CC       sys-utils/nsenter.o
In file included from sys-utils/nsenter.c:36:0:
./include/namespace.h:31:19: error: static declaration of ‘unshare’ follows non-static declaration
In file included from /usr/include/sched.h:42:0,
                 from sys-utils/nsenter.c:23:
/usr/include/bits/sched.h:86:12: note: previous declaration of ‘unshare’ was here
make: *** [sys-utils/nsenter.o] Error 1

We have to always check for the libc function independently on
--disable-{unshare,nsenter} to avoid collision between local and libc
declarations.

Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-21 11:32:29 +02:00
Karel Zak
857d9cdf49 lscpu: add virtualization types
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-20 16:41:19 +02:00
Ondrej Oprala
fb2627cec4 lscpu: detect more hypervisor vendors
[kzak@redhat.com: - cleanup coding style,
                  - use path_exist()]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-20 16:30:23 +02:00
Sami Kerola
e1d58c7796 cfdisk: add long options to the command
Includes update to bash completion, and manual as well.

[kzak@redhat.com: - remove <<< syntax from bash-completion script]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-20 13:40:15 +02:00
Karel Zak
4df7954d47 sfdisk: don't call BLKRRPART for non-block devices
Reported-by: Bertrand Jacquin <beber@meleeweb.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-20 13:10:52 +02:00
Karel Zak
bcb693de80 uuidd: clean up error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-15 00:18:27 +02:00
Karel Zak
28b856ff88 mkfs.cramfs: use standard error message
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-14 23:54:07 +02:00
Karel Zak
41a8ff088b hwclock: use warn() to print cmos errors
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-14 23:41:32 +02:00
Karel Zak
9104cd2850 libmount: use err.h in test
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-14 23:40:51 +02:00
Karel Zak
69e74525bb chcpu: clean up error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-14 23:33:59 +02:00
Karel Zak
4b3624ca21 sulogin: clean up error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-14 23:29:09 +02:00
Karel Zak
84992b8ad6 libblkid: add ReFS magic string
Reported-by: "Richard W.M. Jones" <rjones@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-14 15:53:14 +02:00
Karel Zak
08af448f5c blkid: fix typo in ID_FS_AMBIVALEN=
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-14 15:03:30 +02:00
Karel Zak
0b56c45956 libmount: don't ignore root fs on umount -a
The release v2.22 (the new umount) introduces a regression when root
fs is excluded from umount --all. There is not reason for this
exception. The libmount should be smart enough to disable mtab update
after rootfs umount.

Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-14 10:32:56 +02:00
Karel Zak
507341f832 lib/tty: don't hardcode terminal fd in get_terminal_name()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-13 15:40:57 +02:00
Mike Frysinger
66083665d5 standard SEE ALSO section of man pages
The standard format is to seperate each entry with a comma, and
for each one to be on a line by itself.  Most util-linux pages
follow this, but a few do not.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-05-13 14:42:59 +02:00
Karel Zak
460c7afb79 lsblk: add SERIAL column
... to return short serial number of the disk (from udev db)

Addresses: https://github.com/karelzak/util-linux/issues/33
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-13 13:33:41 +02:00
Karel Zak
8810d532a8 tests: add losetup tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-13 13:13:24 +02:00
Karel Zak
9f56106df6 losetup: add --raw and --noheadings
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-13 12:00:24 +02:00
Karel Zak
b048b8af3a losetup: use warn_size() for regular files only
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-13 11:00:47 +02:00
Karel Zak
e3b6cb87e0 lib/loopdev: fix loopcxt_check_size() to work with blkdevs
The loopcxt_check_size() is workaround for kernels < v3.9, kernel has
been fixed by commit 541c742a7559eb65f0e36d3e2338c2ca532a3e61.

The function sets loopdev size according to backing file size. The
problem is that the backing file could be a block device where
stat.st_size is zero, so we have to use blkdev_get_size() for block
devices.

Addresses: https://bugs.archlinux.org/task/35193
Reported-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-13 10:54:41 +02:00
Karel Zak
5673f30de6 libfdisk: don't re-allocate range string in Ask API
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-09 13:20:35 +02:00
Karel Zak
4fb18cde32 libfdisk: do not use va_list in the Ask API
# fdisk /dev/sda
  Welcome to fdisk (util-linux 2.23).

  [...]

  Command (m for help): a
  Segmentation fault (core dumped)

It's too fragile, the va_list implementation is architecture specific
and it seems we need such thing in libfdisk at all.

Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-09 13:06:02 +02:00
Karel Zak
a21aa92fd4 libmount: use MS_SILENT for /{proc,etc}/filesystems
mount(8) needs to be doing silent mounts when doing this brute
forcing or when the filesystem is not explicitly specified.

Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-09 09:25:31 +02:00
Karel Zak
7697771d8f build-sys: use -Wno-clobbered for some BSD crap
* extend UL_WARN_ADD() for accept non-default CFLAGS variable
 * add BSD_WARN_CFLAGS with -Wno-clobbered
 * use all this for pg(1) and more(1)

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-07 09:50:22 +02:00
Karel Zak
b7faf99128 lib/colors: add colormode_or_err()
... to make the code easy to use in utils.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-07 09:09:35 +02:00
Davidlohr Bueso
a971fa18b6 prlimit: delete rem_prlim prototype
We can just move the function up before any of its callers.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2013-05-06 19:27:03 +02:00
Mike Frysinger
b77ce61eb3 docs: note ddate removal
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-05-06 19:27:00 +02:00
Sami Kerola
30b44cf1e7 dmesg: fix usage() typo
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-05-06 19:26:58 +02:00
Karel Zak
9bc2b51a06 dmesg: support --color[={auto,always,never}]
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-06 19:11:28 +02:00
Karel Zak
a10c043493 lib/colors: add support for auto, always and never modes
... to implement --color[=<when>]

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-06 19:07:23 +02:00
Benno Schulenberg
0bd341508e su: consistent angular brackets and lowercase in help text of 'su'
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-05-06 17:42:08 +02:00
Karel Zak
aab691cf8d libblkid: fix blkid_parse_tag_string() to ignore incomplete tags
fstab entry:

    FOO=     /       btrfs  defaults       1 1

Program received signal SIGABRT, Aborted.
0x00007f016ccd8819 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56   return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
    at ../sysdeps/unix/sysv/linux/libc_fatal.c:196

Reported-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-06 17:20:03 +02:00
Benno Schulenberg
a48c321dd1 textual: fixing typos in a warning and an error message
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-04-26 13:55:29 +02:00
Karel Zak
bf74d70c64 cfdisk: fix ambiguous code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-26 13:54:24 +02:00
Karel Zak
d78d040933 build-sys: add --disable-setterm
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-26 13:47:54 +02:00
Sami Kerola
69f1cad4ca libmount: (test) check writing to a file was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:40:27 +02:00
Sami Kerola
7f587afc67 wall: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00
Sami Kerola
1469971535 swapon: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00
Sami Kerola
05cef8eafb setpriv: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00
Sami Kerola
5f52af507b fallocate: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00
Sami Kerola
de2ca55931 swaplabel: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00
Sami Kerola
833b7e0d80 mkswap: unify write check to a file descriptor
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00
Sami Kerola
616fbb3af8 mkfs.minix: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00
Sami Kerola
393fb46501 mkfs.cramfs: unify write check to a file descriptor
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00
Sami Kerola
0dfd626f54 mkfs.bfs: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00