summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* write: remove pointless fileno(3) callsSami Kerola2016-07-011-6/+6
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* write: get rid of function prototypesSami Kerola2016-07-011-141/+132Star
| | | | | | | Marking functions static and writing them in order where functions are introduced before use is enough. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* write: remove unused variableSami Kerola2016-07-011-4/+0Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lslocks: add --noinaccessibleKarel Zak2016-07-012-27/+45
| | | | | | | | | | * add --noinaccessible to not print incomplete information * make incomplete paths more visible (append "...") * don't print 0B size if lock file inaccessible Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'utmpdump' of git://github.com/kerolasa/lelux-utiliteetitKarel Zak2016-07-0121-78/+192
|\ | | | | | | | | | | | | | | | | | | | | * 'utmpdump' of git://github.com/kerolasa/lelux-utiliteetit: docs: add file format note to utmpdump manual page tests: utmpdump add subsecond accuracy test tests: challenge utmpdump localization go-around tests: fix utmpdump timestamps to be in iso format utmpdump: use iso-8601 timestamp format with subsecond accuracy libcommon: add ISO_8601_GMTIME that will print UTC-0 timestamps utmpdump: use always UTC-0 timezone in textual output
| * docs: add file format note to utmpdump manual pageSami Kerola2016-06-271-0/+12
| | | | | | | | | | | | | | | | Tell that the old textual format that does not use full utmp time precision, and has issues with timezones. Warn also that the textual format may become incompatible, although there are no plans in foreseeable future to do so. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * tests: utmpdump add subsecond accuracy testSami Kerola2016-06-273-0/+42
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * tests: challenge utmpdump localization go-aroundSami Kerola2016-06-275-5/+5
| | | | | | | | | | | | | | | | The utmpdump timestamps are unambiguous, they always use UTC-0 regardless of localization. If thesse tests starts to fail after this change then the timezone forcing is not working. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * tests: fix utmpdump timestamps to be in iso formatSami Kerola2016-06-269-44/+81
| | | | | | | | | | | | | | | | The utmpdump-circle is slightly modified to use old timestamp format as basis of conversion and to do cyclic conversion via new format. This is better from test coverage point of view. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * utmpdump: use iso-8601 timestamp format with subsecond accuracySami Kerola2016-06-262-26/+38
| | | | | | | | | | | | | | | | | | | | Newer 'struct utmp' is using 'struct timeval' to represent login and logout times, so include the maximum accuracy to textual utmp format. Notice that this change does not remove support of converting earlier textual formats back to binary. But conversions from binary to former format will no longer be available. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * libcommon: add ISO_8601_GMTIME that will print UTC-0 timestampsSami Kerola2016-06-262-3/+14
| | | | | | | | | | | | | | When timestamps are intented to be conversable back from string to binary it is best to stick with UTC-0 timezone. This is needed in utmpdump(1). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * utmpdump: use always UTC-0 timezone in textual outputSami Kerola2016-06-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converting a time structure from text format that has timezone markup is practically impossible. See reference links for more information. This leads to situation where multiple utmpdump(1) conversions from binary to text and back make timestamps to shift amount of timezone offset to UTC-0. The easiest way to make multiple conversions to work without timeshifts is to always use UTC-0 timezone. Downside of this approach is that the textual format is less human readable than local timestamps would be. Reference: http://www.catb.org/esr/time-programming/#_strptime_3_and_getdate_3 Reference: http://man7.org/linux/man-pages/man3/strptime.3.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | libblkid: Add metadata signature check for IMSM on 4Kn drivesAlexey Obitotskiy2016-07-011-6/+7
| | | | | | | | | | | | | | | | | | Drives with 512 and 4K sectors have different offset for metadata signature. Without signature detected on 4Kn drives those drives will not be recognized as raid member. This patch adds checking for IMSM signature for 4Kn drives. Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
* | agetty: don't modify argv[] when parse speedsKarel Zak2016-06-301-2/+7
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* liblkid: Add length check in probe_nilfs2 before crc32Torsten Hilbrich2016-06-241-1/+8
| | | | | | | | | | | | | | | | | | | | | The bytes variable is read from the file system to probe and must be checked before used as length parameter in the crc32 call. The following problems may occur here: - bytes smaller than sumoff + 4: underflow in length calculation - bytes larger than remaining space in sb: overflow of buffer This fixes a problem where an encrypted volume had the correct magic values 0x3434 at offset 0x406 and the following uint16_t (which is read into the nilfs_super_block.s_bytes struct) was parsed as 1. Then crc32 was called with the length value 18446744073709551597 causing a segmentation fault. [kzak@redhat.com: - fix probe_nilfs2() return code] Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: make lookup_cache() more robustKarel Zak2016-06-241-2/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fix MMHZ column entry within man pageHeiko Carstens2016-06-241-3/+6
| | | | | | | | | | The indentation for the MMHZ column within the man page is wrong. Also there doesn't exist any column with the name MMHZ. The correct names would be MAXMHZ and MINMHZ. Therefore rename MMHZ to MAXMHZ and add the missong MINMHZ entry. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* lscpu: update s390-lpar-drawer testcaseHeiko Carstens2016-06-242-2/+1Star
| | | | | | | | | | | | | | | | I noticed that the "cpu" line within /proc/cpuinfo has a different meaning on powerpc and sparc than on s390. On s390 it represents the cpu number while on powerpc and sparc it represent the model name. Given that the s390 kernel patch which adds the "cpu" line to /proc/cpuinfo hasn't been merged into the kernel yet, I changed that line to "cpu number" to avoid the unnecessary conflict. Therefore this patch updates the testcase, which mainly changes the contents of /proc/cpuinfo. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* lscpu: show additional caches (s390)Heiko Carstens2016-06-242-0/+72
| | | | | | | | | | | | | | | | | | | | | | The Linux kernel exposes the cache topology via sysfs. However on virtualized machines like s390 the cache topology contains only cpu private caches. For shared caches it is not known which cpus share them. The hypervisor would have to update this information whenever a virtual cpu would be scheduled on a different physical cpu and make the guest aware of that change. Given that there is hardly any benefit, if it all, this isn't done. However it is still of interest to know about the non-private caches. Therefore this information is available via /proc/cpuinfo at least on s390. This patch adds additional lines to the summary output for all shared caches for which information can be found in /proc/cpuinfo, since we know these aren't exposed via sysfs. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* lscpu: show machine type (s390)Heiko Carstens2016-06-245-0/+16
| | | | | | | | Show also the machine type within the lscpu output. With the machine type it is possible to identify the cpu generation and the supported features. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* lscpu: show static and dynamic MHz (s390)Heiko Carstens2016-06-242-0/+10
| | | | | | | | | | | | | | | | s390 machines provide static and dynamic cpu mhz information via /proc/cpuinfo. The static cpu mhz is the normal cpu frequency a cpu is supposed to run with. The dynamic cpu mhz is the actual frequency a cpu is running with. This is usually the same as the static cpu mhz. Note that this values are different to the min/max mhz values available on other architecutes. The min/max values are unknown. This patch adds two new fields to the summary output which display these two values. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* lscpu: fix typo in summary outputHeiko Carstens2016-06-242-2/+2
| | | | | | | The new drawer support did have a type in the summary output: it reported Drawers(s) instead of Drawer(s). Fix this. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* lscpu: add s390 drawer testcaseHeiko Carstens2016-06-242-0/+35
| | | | | | | Add a new s390 testcase so we get some coverage for the new drawer cpu topology level. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* lscpu: add drawer supportHeiko Carstens2016-06-242-9/+47
| | | | | | | | | The s390 architecture gained another cpu topology level called "drawer" which is above the book level. Add support for this to lscpu. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* libfdisk: cleanup fdisk_gpt_set_npartitions()Karel Zak2016-06-213-6/+19
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) be more careful with 64bit constantsKarel Zak2016-06-211-29/+27Star
| | | | | | | | It's probably more robust (and readable) to be explicit when we count with constant and 64bit numbers. Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=1344482 Signed-off-by: Karel Zak <kzak@redhat.com>
* logger: be more precise about --port descriptionKarel Zak2016-06-211-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: don't check nonnull attributes for NULL [-Wnonnull-compare]Karel Zak2016-06-148-187/+135Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't check nonnull attributes for NULL [-Wnonnull-compare]Karel Zak2016-06-142-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chfn: chsh: use selinux_check_passwd_access()Karel Zak2016-06-144-31/+16Star
| | | | | | | | | | | * selinux/av_permissions.h and magic constants are deprecated, the recommended solution is to use string_to_security_class() and string_to_av_perm() to get access vector * it also seems that selinux_check_passwd_access() does exactly the same as our checkAccess(), let's use it. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove global dependence between widechar and ncurseswKarel Zak2016-06-091-4/+0Star
| | | | | | | | | | | It seems that globally defined dependence between ncursesw and wide-char support is overkill, because in some cases (e.g. cal(1)) we can use ncurses independently on wide-char support. It would be better to care about relation between wide-char and ncurses individually (per util). Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: fix for non-ncurses versionKarel Zak2016-06-094-0/+24
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cal: cleanup non-ncurses buildKarel Zak2016-06-091-12/+17
|
* build-sys: workaround for autoconf "present but cannot be compiled"Karel Zak2016-06-081-1/+6
| | | | | | | See also: https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Present-But-Cannot-Be-Compiled.html Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add non-action for ncurses pkg-cong testKarel Zak2016-06-081-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: clean up relation between ncurses[w] and wide-char supportKarel Zak2016-06-081-0/+9
| | | | | | | | | | | * error if wide-char enabled/supported, but (non-wide) ncurses explicitly requested * disable ncurses at all if widechar enabled/supported, but ncursesw not found Reported-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: cleanup --with-ncursesKarel Zak2016-06-081-54/+37Star
| | | | | | | | | | | * don't use UL_CHECK_LIB(), only use pkg-config to avoid complexity * split --with-ncursesw and --with-ncurses; ncurses (widechar) is the default, check for ncurses only if ncursesw disabled/unavailabled * don't use generic placeholders, just have_ncursesw and have_ncurses Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: clarify description of --classdataDaniel Shahaf2016-06-071-1/+1
| | | | | | | | Before this patch, it wasn't clear whether '0' or '7' should be used to specify "highest priority". (The answer could have been inferred from the 'Examples' section of the man page.) Signed-off-by: Daniel Shahaf <danielsh@apache.org>
* build-sys: fix uClibc-ng scanf checkWaldemar Brodkorb2016-06-061-1/+1
| | | | | | | | | | | | uClibc-ng tries to be compatible with GNU libc and defines __GLIBC__ and pretend to be version 2.2. We once changed it to 2.10, but then some hard to fix problems in different software packages (gcc) occured. It would be better if we disable the special GNU libc checks for uClibc-ng here. uClibc-ng implements the required scanf functionality. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
* more: don't include ncurses.h, fix for non-widecharKarel Zak2016-06-031-5/+2Star
| | | | | | | | It seems our crazy widechar.h is in conflict with ncurses, but it seems that nothing in more.c requires anything from ncurses. All we need is probably <term.h>. Signed-off-by: Karel Zak <kzak@redhat.com>
* include/widechar: add fallback for WEOFKarel Zak2016-06-031-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: cleanup non-widechar compilationKarel Zak2016-06-033-4/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/widechar: add missing fallbacksKarel Zak2016-06-031-2/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use UL_DEFAULT_ENABLE() only for programsKarel Zak2016-06-031-1/+1
| | | | | | | | The UL_DEFAULT_ENABLE modifies $enable_<name> according to the global --enable-all-programs. This makes sense only for programs, but not for any built-in code. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add --disable-widecharKarel Zak2016-06-031-13/+23
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add UL_REQUIRES_COMPILE macroKarel Zak2016-06-031-0/+37
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: use libsmartcols ASCII for non-widechar environmentKarel Zak2016-06-031-0/+4
| | | | | Reported-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/mbsalign: fix for non-widecharKarel Zak2016-06-031-10/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fix comments in ul.m4Karel Zak2016-06-031-8/+7Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: improve support for nvmeKarel Zak2016-06-021-1/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>