summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2013-10-04include: Add missing includesMichael Forney1-0/+3
sys/types.h: For u_char typedef sys/params.h: For MAXNAMLEN sys/ttydefaults.h: For various tty definitions (also add configure check) Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-30nologin: add new commandKarel Zak1-0/+2
Currently it's maintained as distro specific (or people use impolite /bin/false way). Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-26build-sys: fix include Makemodule.amKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: add -L to colorize outputKarel Zak1-2/+17
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (bsd) write/read PT code cleanupKarel Zak1-3/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libblkid: move bsd definitions to pt-bsd.hKarel Zak2-0/+160
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libfdisk: move mbr code to the libraryKarel Zak2-0/+106
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: add mbr_get_partition()Karel Zak1-0/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: use functions from pt-mbr.hKarel Zak1-8/+29
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libblkid: rename sys_type to sys_indKarel Zak1-1/+1
This makes struct dos_partition more compatible with the current fdisk code. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16include/pt-mbr: add functio to store leKarel Zak1-0/+8
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libblkid: move MBR definitions to include/pt-mbr.hKarel Zak1-0/+37
2013-09-16fdisk: (sgi) fix checksum calculationKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libblkid: move MBR partition types to include/Karel Zak2-0/+107
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (sgi) cleanup devparams flagsKarel Zak1-1/+12
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (sgi) cleanu sgi_info stuffKarel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (sgi) remove magic stringsKarel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: (sgi) share disk label definition with libblkidKarel Zak1-0/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libblkid: move SGI disklabel definitions to include/Karel Zak2-0/+91
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16lib/tt: add TT_FL_FREEDATAKarel Zak1-3/+5
... to call free() for line data. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-12agetty: add \S to output /etc/os-release dataKarel Zak1-0/+1
This patch allows to use a new \S or \S{VARNAME} sequence in the /etc/issue file. The sequence prints data from /etc/os-release. The reason is to keep /etc/issue file distribution and release independent. The \S{ANSI_COLOR} is converted to the real terminal escape seq. For example: \S Kernel \r on an \m (\l) or more complex example: Welcome to \S{ANSI_COLOR}\S{NAME}0m \S{VERSION} Report bugs at \S{BUG_REPORT_URL}. See http://www.freedesktop.org/software/systemd/man/os-release.html fr more details about /etc/issue. Based on patch from Bill Nottingham <notting@redhat.com>. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-11lib: add crc64()Karel Zak3-0/+11
Based on bcache code from Rolf Fokkens. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-10lib: rename time-util.c to timeutils.c, fix headersKarel Zak2-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-10lib/strutils: optimalize {starts,ends}with()Karel Zak1-3/+40
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-29lib/strutils: move *swith() functions to private librarySami Kerola1-0/+4
Avoid code dublication in libmount and time-util. Proposed-by: Karel Zak <kzak@redhat.com> Reference: http://markmail.org/message/h7zexvqsieqngtmx Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-29lib/time-util: copy time parsing functions from systemdSami Kerola2-0/+56
The functions are copied nearly as-is. Coding style has been modified to match with util-linux project, while the functionality remains untouched. CC: Lennart Poettering <lennart@poettering.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-23include: carefulput: print determined char when unprintable char is foundSami Kerola1-2/+2
This is done to allow reuse of the functin in last(1). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-06losetup: use loop-control to explicitly ask for deviceKarel Zak1-0/+1
Now we use LOOP_CTL_GET_FREE ioctl to ask for free device, for example losetup -f foo.img Unfortunately, losetup(8) allows to ask for specified device losetup /dev/loop100 foo.img and in this case we assume that the device already exists in the system. This is incorrect, we should be able to use loop-control LOOP_CTL_ADD ioctl to ask for the specified device. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-07-09include/xalloc: add warn_unused_result to allocation functionsKarel Zak2-5/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-03agetty: don't remove ECHOCTL from c_lflagKarel Zak1-4/+2
It's really unexpected that arrows keys move cursor when agetty/login asks for login name or password. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=969458 Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-20lscpu: detect more hypervisor vendorsOndrej Oprala1-0/+2
[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-13lib/tty: don't hardcode terminal fd in get_terminal_name()Karel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-07lib/colors: add colormode_or_err()Karel Zak1-0/+1
... to make the code easy to use in utils. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-06lib/colors: add support for auto, always and never modesKarel Zak1-1/+12
... to implement --color[=<when>] Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-26include: add close_fd() for noticing write errors before close()Sami Kerola1-0/+19
Essentially this helper function is similar to close_stream(), but for file descriptors. When a file descriptors are close()'d status of write is often overlooked. The close_fd() will try to determine what happen to writes with fsync() before closing the file descriptor. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-17include: fix SYS_{unshare,nsenter} usageKarel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-15libblkid: arch independent minix detectionKarel Zak1-3/+6
It seems that on-disk MINIX FS superblock is native-endian. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=833841 Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10lib/xalloc: add xstrndup()Karel Zak1-0/+15
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09loopdev: sync capacity after setting itJeff Mahoney1-0/+1
I recently tried to mount an hfsplus file system from an image file with a partition table by using the loop offset and sizelimit options to specify the location of the file system. hfsplus stores some metadata at a set offset from the end of the partition, so it's sensitive to the device size reported by the kernel. It worked with this: But failed with this: /dev/loop0: [0089]:2 (<imagefile>), offset 32768, sizelimit 102400000 /dev/loop1: [0089]:2 (<imagefile>), offset 32768, sizelimit 102400000 /proc/partitions shows the correct number of blocks to match the sizelimit. But if I set a breakpoint in mount before the mount syscall, I could see: 102400000 102432768 The kernel loop driver will set the gendisk capacity of the device at LOOP_SET_STATUS64 but won't sync it to the block device until one of two conditions are met: All open file descriptors referring to the device are closed (and it will sync when re-opened) or if the LOOP_SET_CAPACITY ioctl is called to sync it. Since mount opens the device and passes it directly to the mount syscall after LOOP_SET_STATUS64 without closing and reopening it, the sizelimit argument is effectively ignroed. The capacity needs to be synced immediately for it to work as expected. This patch adds the LOOP_SET_CAPACITY call to loopctx_setup_device since the device isn't yet released to the user, so it's safe to sync the capacity immediately. [kzak@redhat.com: - port to the current git HEAD, - use uint64_t] Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-03include/fileutils: use O_CLOEXEC for mktemp stuffKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-03include/c: add macro UL_CLOEXECSTRKarel Zak1-0/+8
... to make "e" for fopen() portable to systems without O_CLOEXEC. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-27lib/xalloc: fix mamory leak in xgethostname() [coverity scan]Karel Zak1-2/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-26include/pathnames: rename _PATH_ADJPATH to _PATH_ADJTIMEKarel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-26docs: arch is gone, use delpart as usage() function exampleSami Kerola1-1/+1
The arch.c was removed in commit 27abd809. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-03-20remove duplicate includesKarel Zak1-2/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-20lib/mbsalign: correct license header from GPLv[23] to LGPLv2+Pádraig Brady1-2/+2
* lib/mbsalign.c: s/GPLv3/LGPLv2+/ * include/mbsalign.h: s/GPLv2/LGPLv2+/ * README.licensing: Remove mention GPLv3 as it's not actually used.
2013-03-18dmesg: more colors, more funKarel Zak1-1/+1
* colorize subsystem prefix * colorize time * colorize by keywords (now "segfault" only) Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-13namespace.h: Fix typo: s/CLONE_NEWSNS/CLONE_NEWNS/Josh Triplett1-1/+1
This typo causes namespace.h to always unconditionally define CLONE_NEWNS rather than using the system definition. Bug present since the initial version of unshare in commit 4205f1fda1ac32046125a2e0f3937b666186bfab. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Anton Cherkashyn <mail@antonc.com>
2013-03-13include/timer: return setitimer return valueKarel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-13include/optutils: make collisions detection between options more robustKarel Zak1-4/+12
- don't rely on the correct ul_excl_t usage - don't print --(null) for non-existing long options Signed-off-by: Karel Zak <kzak@redhat.com>