Florian wrote:
after a successful write, cfdisk remains on the "Write" cursor and
furthermore when navigating to "Quit" will continue to show
"...without writing changes", despite there were writes. This patch
addresses that.
Based on patch from Florian Zimmermann <florian.zimmermann@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The libcommon is a binary archive to keep compilation and maintenance
simple. The library is not linked as shared or so. The unused symbols
are removed from binaries (for example, by "make install-strip").
But it isn't evident for license analyzers (and some humans) that the
library uses GPL and non-GPL stuff simultaneously. Let's avoid doubts
and keep pager.c (with GPL license) out of the archive
Signed-off-by: Karel Zak <kzak@redhat.com>
We need to be a little bit more promiscuou in fsck to see also
inconsistent superblocks.
It would be possible to do not use libmount to ask for filesystem type
and ask directly libblkid, but libmount is also used to parse fstab
and search in the file and in this case it caches FS tags. It seems
better to continue with libmount to reduce overhead and keep the code
simple.
Addresses: https://github.com/util-linux/util-linux/issues/2214
Signed-off-by: Karel Zak <kzak@redhat.com>
Do not accept slashes in names or the special entries "." and ".." in
directories while extracting files.
[kzak@redhat.com: - add errx_path() to report the path]
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
The error message for a failing chmod call contains chown as reason.
Fix this by stating that chmod failed.
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
* 'signal_safety' of https://github.com/crrodriguez/util-linux:
sulogin: only assign to variables written by signal handlers
hardlink: calling putchar is off-limits on a signal handler
hardlink: last_signal should be a volatile sig_atomic_t
pg: calling exit on signal handler is not allowed
lib📟 fix signal safety issues
write: signal_received should be volatile qualified
flock: timeout_expired must be volatile qualified
last: should not use errx/warnx on signal handlers
su-common: bool is a distinct type in c2x
fsck: only assign to cancel_requested
fsck: use sig_atomic_t type fot signal handler global vars
On 32-bit systems the file length check does not handle files correctly
which are larger than 4 GB. Use an unsigned long long which is already
in place for blkdev_get_size.
Proof of Concept:
- Prepare a file containing a CramFS
```
mkdir owo
mkfs.cramfs owo owo.iso
dd if=/dev/zero of=owo.iso bs=1 seek=4294967296 count=1 conv=notrunc
fsck.cramfs owo.iso
```
- Check the file
```
fsck.cramfs owo.iso
```
You will see: `fsck.cramfs: file length too short`
Better message is: `fsck.cramfs: file extends past end of filesystem`
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
If blkdev_get_size fails, then size is not set. Exit with an error code
and indicate what went wrong instead of continuing with random stack
content.
Proof of Concept:
```
$ mkswap /dev/null
mkswap: warning: truncating swap area to 17179869180 KiB
mkswap: /dev/null: insecure permissions 0666, fix with: chmod 0600 /dev/null
mkswap: unable to assign device to libblkid probe
```
The first output line depends on stack content and sometimes does not
show up at all. Abort operation if argument is neither regular file nor
block device.
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
* 'meson-debian' of https://github.com/zeha/util-linux:
meson: install uuidd.rc with -Dsysvinit=enabled
meson: fix pkg-config name of libaudit
meson: fix build with -Dselinux=enabled
A error in disk-utils/fsck.c, if run the fsck -N command, processes
don't execute, just show what would be done. However, the pid whose
value is -1 is added to the instance_list list in the execute
function,if the kill_all function is called later, kill(-1, signum)
is executed, Signals are sent to all processes except the number one
process and itself. Other processes will be killed if they use the
default signal processing function.
Signed-off-by: zhanchengbin <zhanchengbin1@huawei.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
This define is specific to autotools. Not defining the macro will lead
to silently miscompiled code as has happened with the meson build.
Instead use macros provided by the compiler itself. It does not need any
support from the buildsystem and is supported by both gcc and clang.
If a compiler does not support this feature we will get a loud error
instead of silent miscompilation.
Furthermore it probably better supports universal binaries on macOS
which compiles multiple architectures in a single build.