* remove NAMELEN, use PATH_MAX
* mark global variables as static
* move all global variables to the begin of the code
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'hardlink' of https://github.com/rudimeier/util-linux: (25 commits)
hardlink: add first simple tests
hardlink: util-linux usage
hardlink: fix compiler warnings
hardlink: style indentations and license header
hardlink: enable build with and without pcre2
fixes for the fixes
temporal fix before re-patch (updates from Fedora repo)
Update hardlink.1
Fixed version number, added changelog about Todd Lewis' patch
exclude files via pcre
Fixed 32 bit build with gcc7 (RH Bugzilla ID 1422989)
spec file reflects the atomic hardlinking patch; removed cleaning buildroot (redundant); update FSF address at .c source file
Revert "spec file reflects the atomic hardlinking patch; removed cleaning buildroot (redundant); current FSF address at .c source file"
spec file reflects the atomic hardlinking patch; removed cleaning buildroot (redundant); current FSF address at .c source file
Mention -f option in the man page
do not allow to hardlink files across filesystems by default (#786719) (use -f option to override)
fix possible buffer overflows, integer overflows, update man page
fix URL and remove mmap() (#676962, #672917)
- update docs to describe highest verbosity -vv option (#210816) - use dist Resolves: 210816
mostly spec cleanup
...
Calling mnt_pretty_path() on network file systems can cause mangling of
the output:
root# mount | grep nfs
nfs.example.com:/home on /home type nfs4 ...
root# mkdir -p nfs.example.com:/home
root# mount | grep nfs
/root/nfs.example.com:/home on /home type nfs4 ...
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
The code is horrible. The core of the problem are signed integers
and no check for the limits.
This patch fixes c->c_column = cur_col; where c_column is "short"
and "cur_col" is int. Let's use "int" for all the variables. It's
really not perfect as for bigger lines it can segfault again...
The patch also removes some unnecessary static variables.
Addresses: https://github.com/karelzak/util-linux/issues/749
Signed-off-by: Karel Zak <kzak@redhat.com>
The HiFive Unleashed SBC's bootloader seeks for GPT partitions with
specific UUID for loading the next stage bootloader (ZSBL loads FSBL,
and FSBL loads BBL).
Add these partition type UUIDs.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
The function colors_init() checks for colors, it means it fails
on monochrome terminals, but cal(1) in this case still need to
highlight the current day.
Reported-by: Nuno Silva <nunojsilva@ist.utl.pt>
Signed-off-by: Karel Zak <kzak@redhat.com>
Clarify that the nosuid option also affects file capabilities and that
it only limits execution of programs. (setgid on directories still
inherit the group regardless of the nosuid option.) The new text is
taken from the mount(2) manual page from the man-pages project.
Addresses: https://github.com/karelzak/util-linux/issues/482
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
The check tested whether code using crypt() links without -lcrypt, but
didn't set have_crypt to yes if it succeeded.
This fixes the check erroneously failing when compiling against musl
libc.
Signed-off-by: Johannes Nixdorf <mixi@shadowice.org>
this is deemed a useful special case since journalctl will only show
either the first or last element of the message array if the field
appears multiple times.
Based on patch from: Kjetil Torgrim Homme <kjetil.homme@redpill-linpro.com>
https://github.com/karelzak/util-linux/pull/743
Addresses: https://github.com/karelzak/util-linux/issues/742
Signed-off-by: Karel Zak <kzak@redhat.com>
Currently we use libuuid to print UUID only. This code is possible to replace
by one snprintf(). It seems better to duplicate this one snprintf than force
all distros to keep libuuid together with libblkid.
Note, this scenario has been already supported on --disable-libuuid.
Reported-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
On architectures without special personalities setarch uses the contents
of a local variable with automatic storage duration after return from
the function, causing it to report a spurious error.
$ setarch m68k
setarch: Kernel cannot set architecture to m68k
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Update an error message to add --partscan to the list of options
only allowed during loop device setup.
Signed-off-by: Jeffrey Ferreira <jeffpferreira@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The --partscan functionality depends on sector size. Make sure
sector size is set before we force kernel to scan the device for
partitions. For example:
losetup -f loopfile --sector-size 4KiB --partscan --show
where 'loopfile' contains GPT with 4096 sectors.
Reported-by: Jeffrey Ferreira <jeffpferreira@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The partition scanner in kernel depends on blocksize. We need to set
the blocksize before we call LOOP_SET_STATUS64 (this ioctl triggers
the scanner).
This patch extends the internal API to save blocksize into loopdev
context to be usable later for loopcxt_setup_device().
Signed-off-by: Karel Zak <kzak@redhat.com>
Now the internal API uses loopcxt_set_...() to set context variables
as well as to call ioctls. This patch introduces loopcxt_ioctl_...()
to makes things more obvious to readers.
Signed-off-by: Karel Zak <kzak@redhat.com>
* don't duplicate info on two places -- let's keep only small note
in mkswap(8) man page, suggest to read swapon(8) man page
* add info about kernel versions for XFS and Btrfs swapfiles support
* use subsection in the NOTES
Addresses: https://github.com/karelzak/util-linux/issues/633
Signed-off-by: Karel Zak <kzak@redhat.com>
# dd if=/dev/urandom of=dummy bs=513 count=1 2>/dev/null
# losetup -f --show --offset 1 dummy
/dev/loop0
losetup: dummy: Warning: file does not fit into a 512-byte sector; the end of the file will be ignore
The warning is bogus as with offset the size of the file fits into
512-byte sector. Simple test that all is right:
# dd if=dummy bs=1 skip=1 2>/dev/null | sha256sum - /dev/loop0
da2ed0ade6ea518a802cd8a7a3c01c408ad8699ef6856b0b01f92b867d4ba9b5 -
da2ed0ade6ea518a802cd8a7a3c01c408ad8699ef6856b0b01f92b867d4ba9b5 /dev/loop0
Addresses: https://github.com/karelzak/util-linux/issues/722
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch add to support for remount-all operation to
libmount and mount(8).
For example:
mount --all -o remount,ro -t vfat
to remount read-only all VFAT filesystems.
Addresses: https://github.com/karelzak/util-linux/issues/589
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'time-fixes' of https://github.com/kerolasa/util-linux:
fsck.cramfs: use utimes() instead of utime() that is obsolete
hwclock: use monotonic time to measure how long setting time takes
include: add indirect monotonic clock id specifier
timeutils: match today day and this year correctly
Ensure utmp user name field is null terminated. Without that getpwnam() can
buffer overflow, when wtmp file is malformed.
Addresses: https://github.com/karelzak/util-linux/issues/715
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Earlier gettimeofday() was affected by discontinuous jumps. Measuring how
long time it takes to set time using function that effected by the very
thing being measured makes head spin. Lets make this less confusing with
monotonic clock that ticks on without jumps.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>