Commit Graph

1456 Commits

Author SHA1 Message Date
Karel Zak d7500c6a6b lsipc: move outmode to coltrol struct
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak 91c92cb545 lsipc: fix coding style
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak 7458c061db lsipc: differentiate between UID and USER names
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak c8b47062ab lsipc: fix ID parsing, use full time for pretty print
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak e015417306 lsipc: cleanup -o usage
* support -o+AAA,BBB,CCC
* keep default resource columns in getopt switch()

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak 32cfe498b8 lsipc: improve --global
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak 470a7332b3 lsipc: cleanup columns indexes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak be47528713 lsipc: add COMMAND for shmem
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak be333373b5 lsipc: add CTIME to shmem default
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak 9d20ffda79 lsipc: new command to list IPC facilities
Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak 46e43c9860 hwclock: add -D to the man page
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1244609
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 10:10:05 +02:00
Karel Zak 158e418241 ldattach: tiny coding style changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-15 15:49:18 +02:00
Tilman Schmidt 58c1746094 ldattach: order line disciplines canonically
List line disciplines in numerical order and put official names
before convenience aliases.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
2015-07-15 15:46:18 +02:00
Tilman Schmidt 5687494ae0 ldattach: always set line speed and format for N_GIGASET_M101
The Gigaset M101 exhibits particularly awkward and confusing behaviour
when the serial line speed isn't set to what the device expects:
Configuration mode detects the used speed and works anyway, but data
mode silently fails. Troubleshooting this is enormously time-consuming.

Spare the users this trouble by setting the line speed and format to
these devices' factory default values as long as the command line
doesn't say otherwise.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
2015-07-15 15:46:17 +02:00
Tilman Schmidt b5225af344 ldattach: adapt print_table column width to widest entry
The hardcoded column width of 10 in print_table() is not enough, as
the currently longest table entry to be printed has 12 characters.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
2015-07-15 15:46:16 +02:00
Karel Zak 048811c97a swapon: fix restart waitpid with errno == EINTR
Reported-by: Maks Naumov (https://github.com/karelzak/util-linux/pull/205)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-01 15:35:17 +02:00
Karel Zak 289b153340 fstrim: close dir before exit [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-29 16:14:35 +02:00
Karel Zak f078134257 rtcwake: cosmetic changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-29 15:19:47 +02:00
Karel Zak bac778c06a rtcwake: fix ARRAY_SIZE() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-29 13:46:05 +02:00
Karel Zak 2626f123a5 rtcwake: don't use usage() on error
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-29 13:43:41 +02:00
Sami Kerola 76037ac7d8 rtcwake: fix valgrind warning
==3445== Syscall param ioctl(generic) points to uninitialised byte(s)
==3445==    at 0x4F16477: ioctl (in /usr/lib/libc-2.21.so)
==3445==    by 0x402785: setup_alarm (rtcwake.c:231)
==3445==    by 0x403302: main (rtcwake.c:520)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola f87b73ab44 rtcwake: read accepted mode strings from /sys/power/state
The rtcwake has various mode names that are internal to the command,
listed in rtcwake_mode_string array, while some modes are dynamicaly
listed in /sys/power/state.  Together these form the allowed modes.

[kzak@redhat.com: - cleanup strv usage]

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-29 13:39:37 +02:00
Sami Kerola 254e9e58b7 rtcwake: make some command line options mutually exclusive
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 5b4185e17d rtcwake: improve coding style
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 43a44bfc6d rtcwake: add --list-modes
Commit ece44f19f4 missed freeze mode, which
to a simple patch adding the missing argument but Karel pointed out it
would be better to make the rtcwake to tell what arguments are supported
so that possible changes end up to be automatically correct in bash
completion.

Proposed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 067fde32c9 rtcwake: do not overwrite device name
This improves error messaging, and removes a memory leak.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 499a0c7956 rtcwake: clean up struct tm initializations
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 356b2989ae rtcwake: fix preprocessor redefinition
The RTC_AF is expected to be part of linux/rtc.h file.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola a10ce9a3e5 rtcwake: add human readable --date timestamp format
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 3e5a54554d rtcwake: improve read_clock_mode()
Make skipping two lines more robust, and add message about unexpected
adjfile contents when running with --verbose.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 5fde2f0d34 rtcwake: remove RTC_ALM_READ and RTC_ALM_SET compatibility
The RTC_WKALM_RD and RTC_WKALM_SET have been available since 2.6.17, and
preferred way since 2007.  Keeping the fallbacks to the old interface is
no longer needed.

Reference: e824290e5d
Reference: f8245c2688
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 64a8067835 rtcwake: replace long if else statement with switch case
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 6e1ec14faf rtcwake: enumerate constant mode strings
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 71d95e92c1 rtcwake: add rtcwake_control and remove global variables
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola b464fd6284 zramctl: add link to kernel documentation
The manual page does lacks explanation how to create zram with modprobe.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 12:05:50 +02:00
Boris Egorov e3ca1312a2 sys-utils/disk-utils/lib: fix printf format types [cppcheck]
Fix 'invalidPrintfArgType' cppcheck warnings

Signed-off-by: Boris Egorov <egorov@linux.com>
2015-06-25 12:08:45 +02:00
Karel Zak 8dd51c1833 fstrim: de-duplicate by mount source too
Now fstrim de-duplicates by target (mountpoint). This patch adds
de-duplication according to mount source (device) to avoid bind mounts
or devices mounted more than once. Note that the patch also check FS
root, the different FS roots of the same multi-root FS (e.g. btrfs)
maybe mounted on different places.

  # mount --bind /home/wine /mnt/test

old version:

  # fstrim -av
  /mnt/test: 0 B (0 bytes) trimmed            <---
  /home/wine: 0 B (0 bytes) trimmed           <---
  /boot: 0 B (0 bytes) trimmed
  /home: 0 B (0 bytes) trimmed
  /: 0 B (0 bytes) trimmed

new version:

  # fstrim -av
  /mnt/test: 0 B (0 bytes) trimmed            <---
  /boot: 0 B (0 bytes) trimmed
  /home: 171.8 MiB (180113408 bytes) trimmed
  /: 0 B (0 bytes) trimmed

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1162213
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-10 14:19:45 +02:00
Andreas Henriksson c4417ee9d3 man: fix nolazytime typo in mount(8)
Avoids double negation...

Addresses: http://bugs.debian.org/786554
Reported-by: Felix Zielcke <fzielcke@z-51.de>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-06-08 12:09:58 +02:00
Karel Zak 4827093d4b losetup: add --json
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-05 10:30:52 +02:00
Karel Zak 362f5d2035 losetup: print more usable error message on failed -f
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1215370
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-03 12:05:09 +02:00
Karel Zak 28cdf9c612 libmount: do not call umount helper on --fake
The umount.<type> helpers does not support --fake option and it does
not make sense to call the helpers at all. All we need is to remove
mtab/utab entries.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1172297
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-03 11:02:25 +02:00
Karel Zak 6d9b1c19ea lscpu: add warning for __SANITIZE_ADDRESS__
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-02 14:55:52 +02:00
Cristian Rodríguez a680b2abe7 sys-utils: lscpu segfaults when built with -fsanitize=address
This is expected and a false positive, exclude the vmware detection
trick when __SANITIZE_ADDRESS__ is defined.
2015-06-02 11:58:53 +02:00
Karel Zak 687cc5d589 hwclock: don't allow non-root access
Fortunately very few people are crazy enough to install hwclock as
setuid. Some comments in code and unfortunately also man page
advertising that setuid is no problem. That's pretty stupid promise.

The code quality is poor and it's obviously not designed to be secure
(things like popen() without drop privileges, etc.).

This patch removes all notes about "setuid support" and for sure
disable hwclock execution for non-root users.

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786804
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-05-26 10:32:38 +02:00
Georg Schiesser fddfd4e08b build-sys: support unshare.static
This patch adds support for building a static version of unshare.
We need to add unshare to the list of possible static programs, and
provide build flags for the compiler and linker, which are equivalent to
the flags of the non-static program, except additional static linking.
See also: commit 2fa60c5 build-sys: support nsenter.static

Signed-off-by: Georg Schiesser <georg.schiesser@opentech.at>
2015-05-18 11:46:05 +02:00
Karel Zak bffc9174b8 zramctl: add MEM-LIMIT, MEM-USED and MIGRATED columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-05-18 11:30:56 +02:00
Karel Zak 5388c86260 zramctl: support /sys/block/zram<id>/mm_stat
Linux >= 4.1 provides all memory related statistics by one file.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-05-18 11:13:44 +02:00
WANG Chao ee1f1057e2 lscpu: add cpu flags entry to summary output
It'd be convenient to have unified cpu "Flags: " entry in the summary
output.

Signed-off-by: WANG Chao <wcwxyz@gmail.com>
2015-05-13 11:27:16 +02:00
Brad Forschinger b5575bc08c flock: NULL deref
cmd_argv[2] will be initialised only if it's specificed with -c.  NULL
deref otherwise resulting in crash.

Signed-off-by: Brad Forschinger <bnjf@bnjf.id.au>
2015-05-05 12:42:52 +02:00
Mike Frysinger 1eb1911893 build-sys: fix parallel builds w/setarch links
The symlink generation tries to write to the sys-utils/ subdir but does
not make sure that dir exists.  This can sometimes lead to parallel build
failures when building out-of-tree like:
...
echo ".so man8/setarch.8" > sys-utils/linux64.8
/bin/bash: sys-utils/linux64.8: No such file or directory
Makefile:11503: recipe for target 'sys-utils/linux64.8' failed
make: *** [sys-utils/linux64.8] Error 1

References: https://bugs.gentoo.org/511812
Signed-off-by: Mike Frysinger <vapier@chromium.org>
2015-05-05 12:40:54 +02:00