time_t may change to 64-bit on 32-bit Linux kernels at some point;
at that point, it may be desireable to test for issues with dates
past 2038.
[kzak@redhat.com: - use %jd rather than %lld]
Signed-off-by: Karel Zak <kzak@redhat.com>
This reverts commit bc9007c372.
We need a better way, it seems that the original report is mostly
about udev rules disadvantages than about libblkid bug. See RH
bugzilla (#1172510) for more details.
The libmount provides way how to deal with parsing errors in fstab --
on error callback function is executed and according to the return
libmount manipulate with the malformed line, possible are three
states:
1/ fatal error; all file ignored (callback rc < 0)
2/ recoverable error; malformed line ignored (callback rc > 0)
3/ ignore the error (callback rc == 0)
The 2/ is the default if no callback specified.
Unfortunately our utils uses 3/. The correct way is to use 2/.
Signed-off-by: Karel Zak <kzak@redhat.com>
The current libmount version returns error when no able to convert
username/groupname to uid/git.
# mount mount /dev/sda1 /mnt/test -o uid=ignore
# mount: failed to parse mount options
This is regression, the original mount(8) has ignored possible unknown
user/group names and the option has been used unconverted (with the
original value). For example UDF kernel driver depends on this behavior
and "uid=ignore" (or "forgot") is a valid mount option.
Fixed version (unit test):
./test_mount_optstr --fix uid=kzak,gid=forgot,aaa,bbb
optstr: uid=kzak,gid=forgot,aaa,bbb
fixed: uid=1000,gid=forgot,aaa,bbb
Reported-By: Anthony DeRobertis <anthony@derobert.net>
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801527
Signed-off-by: Karel Zak <kzak@redhat.com>
I got a bit confused with the interaction below:
Command (m for help): p
Disk /dev/sda: 41 GiB, 43965677568 bytes, 85870464 sectors
...
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1026047 1024000 500M 83 Linux
/dev/sda2 1026048 85868543 84842496 40.5G 8e Linux LVM
Command (m for help): n
To create more partitions, first replace a primary with an extended partition.
I knew I should have had two primary partitions available, but I did
not notice that the disk was seen as full (I was trying to grow it)
This change detects available primary partitions, and if so indicates
we are out of space, rather than out of partitions.
Signed-off-by: Ian Wienand <iwienand@redhat.com>
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>
misc-utils/uuidd.c:384:13: warning: declaration of 'ret' shadows a previous
local [-Wshadow]
misc-utils/uuidd.c:327:6: note: shadowed declaration is here
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Point of this change is to replace use of signal() and alarm() system calls
using newer interfaces. Nice side effect is that the point where timer was
earlier used cannot be distracted by sending rogue SIGALRM.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The function write_output() add additional \n after each message on
TYPE_TPC. This is required by syslog daemons, otherwise you will see
multiple log messages merged together in your log file, for example:
Oct 6 09:01:40 ws kzak: AAA<14>Oct 6 09:01:40 kzak: BBB
for
printf "AAA\nBBB\n" | logger -p info -u <any-socket>
Unfortunately, the connection initialization functions keep the
default ALL_TYPES as connection type and nowhere in the control struct
is info about the final real connection type. The problem is invisible
when you specify --tpc or --udp on logger command line.
Addresses: https://github.com/karelzak/util-linux/issues/225
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch provides fix for bash-completion/fndmt script. There
is curly brace missed in the completion generation for the -M/--mountpoint
option.
In other way we will get following messages:
bash: /etc/bash_completion.d/findmnt: line 91: unexpected EOF while looking for matching `)'
bash: /etc/bash_completion.d/findmnt: line 141: syntax error: unexpected end of file
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
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>
Based on patch from Justin Akers, he wrote:
> When building Openembedded inside a Jenkins matrix job the paths can
> get quite long. This ensures libuuid won't crash when attempting to
> connect to uuidd in such a scenario.
Reported-by: Justin Akers <dafugg@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The command zramctl lists the same stat info for all devices (DATA COMPR TOTAL).
Reported-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
diff between
perf stat -e 'syscalls:sys_enter_*'
for old and new version:
- 35 syscalls:sys_enter_lseek
- 38 syscalls:sys_enter_read
+ 3 syscalls:sys_enter_read
...
- 19 syscalls:sys_enter_mmap
+ 17 syscalls:sys_enter_mmap
- 0.001083084 seconds time elapsed
+ 0.000751722 seconds time elapsed
The patch dramatically reduces malloc()+seek()+read() operations in
libblkid. The code mmaps ~2MiB of the begin and the end of the device
and it moves buffers management to kernel.
Signed-off-by: Karel Zak <kzak@redhat.com>
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>
- verify that the new partition fits to the area if the size of the
has not been modified
- fix remaining space calculation (yes, brown-paper-bag bug..)
- offer also space before first partition as free space
Signed-off-by: Karel Zak <kzak@redhat.com>
The monitor supports utab only (as documented). It's application
responsibility to use libmount in the right way. It's overkill to
check for valid environment during monitor initialization.
For example systemd checks for regular mtab during boot, it's better
than try to be smart later in libmount monitor when system is already
running.
Signed-off-by: Karel Zak <kzak@redhat.com>