summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* libcommon: add ISO_8601_GMTIME that will print UTC-0 timestampsSami Kerola2016-06-261-1/+2
| | | | | | | 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>
* include/widechar: add fallback for WEOFKarel Zak2016-06-031-1/+3
| | | | 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>
* lib/sysfs: be more smart for non-scsi devicesKarel Zak2016-06-021-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: Fix various typosSebastian Rasmussen2016-05-316-6/+6
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* build-sys: add missing include/plymouth-ctrl.hKarel Zak2016-05-241-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/timeutils: add strtime_short()Karel Zak2016-05-241-0/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/timeutils: rewrite iso formatting functionsKarel Zak2016-05-241-6/+10
| | | | | | | | | - use buffers rather than allocate memory - support .usec and ,usec convention - use strftime for timezone (we need to care about daylight saving time) Signed-off-by: Karel Zak <kzak@redhat.com>
* include/timeutils: use pointer for time_tKarel Zak2016-05-231-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sulogin: agetty: use the plymouth local protocol instead the plymouth binaryWerner Fink2016-05-201-0/+65
| | | | | | | | | | | | | for stopping plymouthd. That do not depend on the existence of the plymouth binary if it e.g. becomes uninstalled or an other service is providing plymouthd facilities. [kzak@redhat.com: - fix compiler warnings [-Wpointer-sign] - use sizeof() for write_all() - cast to char* for read_all] Signed-off-by: Werner Fink <werner@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/timeutils: add strxxx_iso() functionsKarel Zak2016-05-112-0/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove duplicate codeKarel Zak2016-04-221-4/+9
| | | | | | | | For petty long time we have strdup_to_struct_member() macro to avoid duplicate code when strdup() strings in setter functions. Let's use it for libmount. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: try absolute target before canonicalizeKarel Zak2016-04-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The path canonicalization is expensive and in many cases unwanted due to problems with readlink() on unreachable NFS and automounters. This patch add a possibility to search also by $(CWD)/<path> if the <path> is relative to reduce number of situation when we convert the path to the canonical absolute path. The common use-case: # cd /some/long/path # umount ./mountpoint old version: 15543: libmount: TAB: [0x560a99a54230]: lookup TARGET: './test' 15543: libmount: CACHE: [0x560a99a54290]: canonicalize path ./test 15543: libmount: CACHE: [0x560a99a54290]: add entry [ 1] (path): /mnt/test: ./test 15543: libmount: TAB: [0x560a99a54230]: lookup canonical TARGET: '/mnt/test' 15543: libmount: CXT: [0x560a99a54050]: umount fs: /mnt/test new version: 15597: libmount: TAB: [0xabf230]: lookup TARGET: './test' 15597: libmount: TAB: [0xabf230]: lookup absolute TARGET: '/mnt/test' 15597: libmount: CXT: [0xabf050]: umount fs: /mnt/test Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: Update for newer bcache superblocksKent Overstreet2016-03-232-10/+0Star
| | | | | | | | Later version of bcache add different checksum types, and allow for superblocks greater than 4k - skipping the checksum check (as in most other probes) is the easiest solution. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
* Merge branch '2016-03-02/cgns' of https://github.com/hallyn/util-linuxKarel Zak2016-03-211-0/+3
|\ | | | | | | | | * '2016-03-02/cgns' of https://github.com/hallyn/util-linux: Implement support for cgroup namespaces
| * Implement support for cgroup namespacesSerge Hallyn2016-03-031-0/+3
| | | | | | | | | | | | Currently these are supported in #for-next. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
* | libmount: improve conversion from root= to the devnameKarel Zak2016-03-151-0/+1
| | | | | | | | | | | | | | | | Currently the code supports /dev/name or PARTUUID= only. We also need to support 'maj:min' and 'hexhex' notations. Reported-by: George Spelvin <linux@horizon.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | Merge branch 'port-osx' of https://github.com/rudimeier/util-linuxKarel Zak2016-03-091-14/+40
|\ \ | | | | | | | | | | | | | | | | | | | | | * 'port-osx' of https://github.com/rudimeier/util-linux: fdisk: fix warning, uninitialized variable logger: fix compiler warning, const facilitynames include/bitops: avoid fallbacks for more systems include/bitops: add casts to bswap functions
| * | include/bitops: avoid fallbacks for more systemsRuediger Meier2016-03-081-0/+21
| | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | include/bitops: add casts to bswap functionsRuediger Meier2016-03-081-14/+19
| | | | | | | | | | | | | | | | | | Based on kernel sources include/uapi/linux/swab.h. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | | misc: remove path name definitions that are unusedSami Kerola2016-03-091-18/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this commit the following produces zero matches. $ for i in \ _PATH_DEV_TTY \ _PATH_INITTAB \ _PATH_MNTTAB_DIR \ _PATH_MOUNTED_LOCK \ _PATH_MOUNTED_TMP \ _PATH_RC \ _PATH_REBOOT \ _PATH_SECURE \ _PATH_SECURETTY \ _PATH_SHUTDOWN_CONF \ _PATH_SINGLE \ _PATH_UMOUNT \ _PATH_USERTTY do git grep $i; done Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | | include: move sys/sysmacros.h to c.hKarel Zak2016-03-081-0/+4
|/ / | | | | | | | | | | | | The file is no portable (#ifdef HAVE_SYS_SYSMACROS_H is necessary), but needed on many places. It seems better to keep it in c.h. Signed-off-by: Karel Zak <kzak@redhat.com>
* | lib: include sys/stat.h for struct statRuediger Meier2016-03-071-0/+1
| | | | | | | | | | | | | | Compiler warning: 'struct stat' will not be visible outside of this function [-Wvisibility] Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | build-sys: add and use openat build conditionalsRuediger Meier2016-03-071-0/+2
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | lib: move fopen_at() to fileutils.h, remove at.hRuediger Meier2016-03-073-23/+10Star
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | lib: remove openat fallback functions (include/at.h)Ruediger Meier2016-03-071-11/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I have validated that we are still compatible at least back to - openSUSE 11.4 - SLE 11 - RHEL/CentOS 6 - OSX 10.10.x, (Xcode 6.3) - FreeBSD 10.2 Confirmed incompatibility: - OSX 10.9.x, (Xcode 6.2) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | lib: provide fallback if mkostemp(3) missingRuediger Meier2016-02-291-0/+2
|/ | | | | | | It's missing on OSX. CC: Yuriy M. Kaminskiy <yumkam@gmail.com> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* include: provide MAP_ANONYMOUS on OSXRuediger Meier2016-02-181-0/+8
| | | | | | | Hope there are no side effect when defining _DARWIN_C_SOURCE globally. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lib: rename strmode() and setmode()Ruediger Meier2016-02-181-1/+1
| | | | | | On BSD they are part of the standard C library. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lib/color: add more ESC seq.Karel Zak2016-02-171-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: support multibyte titles, rename wrap to paddingKarel Zak2016-01-221-0/+4
| | | | | | | | | - let's support multibyte table titles - use lib/mbalign.c to align the title - rename title_wrap to title_padding (we already use "wrap" on another places for another things) Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/mbsalign: fix warnings when compile without widecharsKarel Zak2016-01-131-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/tty: Pass default width to get_terminal_width()Boris Egorov2016-01-061-1/+1
| | | | | | | | | | Almost any code calling get_terminal_width() checks returned width for non-positive values and sets it to some default value (say, 80). So, let's pass this default value directly to the function. [kzak@redhat.com: - get_terminal_width() refactoring] Signed-off-by: Karel Zak <kzak@redhat.com>
* login, mount: fix __SC_GETPW_R_SIZE_MAX usageKarel Zak2015-12-151-0/+9
| | | | | | | | | | sysconf(_SC_GETPW_R_SIZE_MAX) returns initial suggested size for pwd buffer (see getpwnam_r man page or POSIX). This is not large enough in some cases. Yes, this sysconf option is misnamed (should be _SC_GETPW_R_SIZE_MIN). Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add cgroup2 pseudo FSKarel Zak2015-12-081-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'races' of git://github.com/kerolasa/lelux-utiliteetitKarel Zak2015-12-022-0/+15
|\
| * lib/blkdev: add open_blkdev_or_file() functionSami Kerola2015-11-221-0/+3
| | | | | | | | | | | | | | | | | | Purpose of this function is to open a path that is potentially pointing to a block device or file without races. The function also proper open(3) flags are used to check the device is not busy, and finally warning is been printed if a block device happens to be misaligned. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * include/fileutils: add is_same_inode() checkSami Kerola2015-11-221-0/+12
| | | | | | | | | | | | | | Check if a file descriptor and path or stat structure are represent the same file. This function is needed for TACTOU avoidance. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | include: add missing header fileKarel Zak2015-12-011-0/+1
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | namei: move icache to lib/Karel Zak2015-11-271-0/+28
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | lslocks: use stuff from lib/procutilsKarel Zak2015-11-251-0/+1
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: remove now useless linux_reboot.h.Casper Ti. Vector2015-11-192-73/+0Star
|
* losetup: support list direct ioMing Lei2015-11-191-0/+2
| | | | | | So that user can see if DIO is set for current loop device. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
* losetup: support ioctl cmd of LOOP_SET_DIRECT_IOMing Lei2015-11-191-0/+2
| | | | | | | | From v4.4, linux kernel starts to support direct I/O and AIO to backing file for loop driver, so allow losetup to enable the feature by using LOOP_SET_DIRECT_IO ioctl cmd. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
* ctrlaltdel: display setting when ran without argumentsSami Kerola2015-10-181-0/+3
| | | | | | This is more useful than printing an error. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include/pt-mbr-partnames: remove '|' from partition type nameKarel Zak2015-10-091-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: to recognize Intel Rapid Start hibernation partitionJörg Jenderek2015-10-092-2/+5
| | | | | | | | | | | | | | | | I use Intel Rapid Start Technology on my PC. According to their User Guide "Rapid_Start_Technology_User_Guide_v1.4.pdf" I create a partition with id=84 for hibernation by this Technology. Unfortunately the software fdisk (util-linux-2.27) classifies that partition as "OS/2 hidden C:". That is not wrong, but on website https://en.wikipedia.org/wiki/Partition_type is written, that id 0x84 beside using for hiding drive C: this type is a also used as hibernation partition for Microsoft APM and also for Intel Rapid Start So I patched 2 header files so that fdisk recognize this partition type variation. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: to recognize partition type 0xEA (Rufus)Jörg Jenderek2015-10-022-0/+2
| | | | | | | | | | | | | | | | | | i used a partitioning+formatting tool product rufus 2.2. of https://rufus.akeo.ie/ This software has an extra format option for older BIOS. With this fix the main partition is created with some alignments and for the remaining unallocated space a small extra and empty partition with identification 0xEA is created. On the List of partition identifiers for PCs at http://www.win.tue.nl/~aeb/partitions/partition_types-1.html is is said that there is a freedesktop proposal to use also type ea as boot partition Unfortunately the software fdisk (util-linux-2.27) can not classify that partition. I send for the fdisk program my 2 patches so that fdisk recognize this partition type. Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/strv: add strv_extendv()Karel Zak2015-10-011-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/crc32: don't require to modify GPT headerKarel Zak2015-09-241-0/+2
| | | | | | | | | | This patch introduces smart crc32 function that is able to exclude specified. The advantage is that we does not have to modify GPT header (set the current in-header crc field to zero) when we count crc32. This allows to keep GPT header in read-only buffers and simplify code. Signed-off-by: Karel Zak <kzak@redhat.com>