Commit Graph

13973 Commits

Author SHA1 Message Date
Karel Zak ae63d7e832 fstrim: do not use Protect setting in systemd service
The ProtectHome= and ProtectSystem= settings mounts all stuff for the service in read-only mode.

The fstrim ioctl operates on read-only mountpoint file descriptor, but
on some read-only filesystem the operation can fail, so since
2d22ac64e4 we check for read-only volumes and skip it.

References: Upstream: 2d22ac64e4
Addresses: https://github.com/karelzak/util-linux/issues/948
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-02-04 16:24:10 +01:00
Karel Zak da0debad53 sfdisk: fix ref-counting for the script
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-02-04 15:54:53 +01:00
Karel Zak d74b16bdf1 libfdisk: (script) fix memory leak
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-02-04 15:54:10 +01:00
Karel Zak d8c68b52cc libfdisk: (script) accept sector-size, ignore unknown headers
- add sector-size between supported headers (already in --dump output)

- report unknown headers by -ENOTSUP

- ignore ENOTSUP in sfdisk (but print warning) and in fdisk_script_read_file()

Addresses: https://github.com/karelzak/util-linux/issues/949
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-02-04 15:11:19 +01:00
jonnyh64 fcc3078754 chrt: Use sched_setscheduler system call directly
musl libc does not support the sched_setscheduler library function
because the underlying Linux system call does not confirm to Posix;
this patch makes chrt use the system call directly

[kzak@redhat.com:
    - note that musl libc implements sched_setscheduler()
      but returns -ENOSYS all time...
    - add ifdefs to the patch
    - make sure we include syscall.h]

References: http://git.musl-libc.org/cgit/musl/commit/src/sched/sched_setscheduler.c?id=1e21e78bf7a5c24c217446d8760be7b7188711c2
Addresses: https://github.com/karelzak/util-linux/issues/943
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-30 10:45:32 +01:00
Karel Zak caa37b6e18 libfdisk: fix __copy_partition()
The code called free() for pointers copied from the source partition.

Addresses: https://github.com/systemd/systemd/pull/14677
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-28 12:46:39 +01:00
Karel Zak 3534b2c7c7 lib/randutils: use explicit data types for bit ops
ASAN is pretty unhappy with getpid() << 16, it seems better to save
into unsigned int and than do the bit-op.

Addresses: https://github.com/karelzak/util-linux/issues/942
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-28 12:30:23 +01:00
Karel Zak dfe28f0e01 libfdisk: make sure we use NULL after free
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-28 12:29:44 +01:00
Karel Zak 0683647c70 lib/strutils: add test for strdup_to_struct_member()
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-28 11:34:04 +01:00
Karel Zak 88f04bf9e6 libmount: fix x- options use for non-root users
libmount returns EPERM for all X- and x- mount options for non-root
users when evaluate X-mount.mkdir. It's bug, we need to be sensitive
to only X-mount.mkdir and only if the target directory is missing.

Addresses: https://github.com/karelzak/util-linux/issues/941
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-28 10:54:33 +01:00
Karel Zak e8c21c894e build-sys: add --disable-hwclock-gplv3
The currently used date/time parser (for hwclock --set --date <date>)
is gnulib based code with GPLv3.

This patch allows to avoid this code and replace it with minimalistic
date/time parser.

Addresses: https://github.com/karelzak/util-linux/issues/891
Reported-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-27 16:23:21 +01:00
Karel Zak c2e33769bb Merge branch 'master' of https://github.com/yurchor/util-linux
* 'master' of https://github.com/yurchor/util-linux:
  po: update uk.po (from translationproject.org)
2020-01-23 15:57:37 +01:00
Karel Zak f0b3df38c5 Merge branch 'patch-2' of https://github.com/yurchor/util-linux
* 'patch-2' of https://github.com/yurchor/util-linux:
  Fix minor typo: aliast -> alias
2020-01-23 15:53:19 +01:00
Karel Zak 704156ad63 Merge branch 'patch-1' of https://github.com/yurchor/util-linux
* 'patch-1' of https://github.com/yurchor/util-linux:
  Fix minor typo: ussuported -> unsupported
2020-01-23 15:52:44 +01:00
Karel Zak b1bc5ae39e libfdisk: (gpt) cleanup entries array size calculations
- move all calculations to inline functions
- remove duplicate code
- keep the same names for the same stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-23 15:50:53 +01:00
Karel Zak 3c3b7648c9 libfdisk: fix const char mess
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-23 15:50:42 +01:00
Karel Zak 65e27d545c sfdisk: add --disk-id to change disk UUID/ID
Addresses: https://github.com/karelzak/util-linux/issues/916
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-23 15:50:28 +01:00
Karel Zak e5f3144616 libfdisk: add fdisk_set_disklabel_id_from_string()
We have fdisk_set_disklabel_id(), but it's old ask-API based function.
It's not comfortable if you want to avoid dialog or template.

Addresses: https://github.com/karelzak/util-linux/issues/916
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-23 15:50:12 +01:00
Karel Zak 34fed3ff17 blkdiscard: use O_EXCL, add --force
Let's make it more robust and safe. O_EXCL is an elegant way how to avoid
unwanted discard on mounted device.

Addresses: https://github.com/karelzak/util-linux/issues/915
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-23 15:49:55 +01:00
Karel Zak e3e7cd659e Merge branch 'dmverity_sig' of https://github.com/bluca/util-linux
* 'dmverity_sig' of https://github.com/bluca/util-linux:
  libmount: add support for signed verity devices
2020-01-23 15:47:15 +01:00
Karel Zak 5db212c033 flock: make examples in man page more readable
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-23 15:43:23 +01:00
Karel Zak 304323fed1 Merge branch 'Jookia-patch-1' of https://github.com/Jookia/util-linux
* 'Jookia-patch-1' of https://github.com/Jookia/util-linux:
  flock: Add new example using shell IO redirection
2020-01-23 15:39:42 +01:00
Karel Zak 9fabc6d5fa sfdisk: remove broken step alignment for --move
* remove unnecessary and broken step alignment
* improve reported information in move log
* improve final progress bar update

Addresses: https://github.com/karelzak/util-linux/issues/938
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-23 15:07:32 +01:00
Karel Zak 2b26438c4b sfdisk: make sure we do not overlap on --move
The area we need to move does not have to be aligned to optimal I/O
size (step size) -- we need to be sure we do not move data
after/before the area.

Addresses: https://github.com/karelzak/util-linux/issues/938
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-23 12:44:58 +01:00
Jookia 966bcac37a
flock: Add new example using shell IO redirection 2020-01-23 04:55:35 +00:00
Yuri Chornoivan 495ed36ad7 po: update uk.po (from translationproject.org) 2020-01-22 20:52:11 +02:00
Karel Zak d355735912 build-sys: release++ (v2.35)
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-21 11:15:21 +01:00
Karel Zak 05bfb8267e docs: update v2.35-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-21 11:12:49 +01:00
Karel Zak 4c783547c3 docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-21 11:07:27 +01:00
Karel Zak b529c736ca po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-21 11:03:19 +01:00
Pedro Albuquerque aaa14eefab po: update pt.po (from translationproject.org) 2020-01-21 10:57:45 +01:00
Rafael Fontenelle acda89cb6f po: update pt_BR.po (from translationproject.org) 2020-01-21 10:57:45 +01:00
Jakub Bogusz 6bf7ad87a9 po: update pl.po (from translationproject.org) 2020-01-21 10:57:45 +01:00
Takeshi Hamasaki ad721f1d31 po: update ja.po (from translationproject.org) 2020-01-21 10:57:45 +01:00
Božidar Putanec 7e551d1e97 po: update hr.po (from translationproject.org) 2020-01-21 10:57:45 +01:00
Frédéric Marchal 552499a2f1 po: update fr.po (from translationproject.org) 2020-01-21 10:57:45 +01:00
Antonio Ceballos Roa 88f240929f po: update es.po (from translationproject.org) 2020-01-21 10:57:45 +01:00
Mario Blättermann 955d2cbc14 po: update de.po (from translationproject.org) 2020-01-21 10:57:45 +01:00
Petr Písař 2f3b9b81cc po: update cs.po (from translationproject.org) 2020-01-21 10:57:45 +01:00
Karel Zak 0d74f2628c scriptreplay: restrict header name size
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-20 13:04:59 +01:00
Karel Zak eae8661e68 libmount: (monitor) remove dead code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-15 14:08:06 +01:00
Karel Zak 810dfb7de6 libmount: use vsnprintf() in more robust way [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-15 13:59:42 +01:00
Karel Zak 3b28b4686c lslogins: assume unterminated strings in wtmp/btmp [coverity scan]
Let's use mem2strcpy() to be robust.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-15 13:20:23 +01:00
Karel Zak 00130885ab script: follow --logging-format on -t
Let's use new logic for timing file format also for old -t command
line option.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-15 13:01:06 +01:00
Karel Zak 01aedbecfe strutils: fix double free in strrealloc() [coverity scan]
* fix double free
* keep strrealloc() semantic compatible with classic realloc() (do not
  free original pointer on failed memory allocation).
* remove unnecessary goto

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-15 13:00:43 +01:00
Karel Zak 319029e8b4 sfdisk: remove never read value [clang scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-15 12:38:19 +01:00
Karel Zak e1d7c65a5c sfdisk: check fdisk_script_set_header() return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-15 12:35:38 +01:00
Karel Zak a8955bf07a cfdisk: check mnt_table_parse_fstab() return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-15 11:56:00 +01:00
Luca Boccassi 123b1a6708 libmount: add support for signed verity devices
A new API was added to libcryptsetup to make use of the kernel's new
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG feature, which allows to sign
root hashes. Add a verity.roothashsig option to use it.
Device reuse will be allowed only if signatures are used by all, or
by none.
2020-01-13 12:24:55 +00:00
Karel Zak f6e182078a libblkid: (zfs) don't probe whole-disk areas covered by partitions
Addresses: https://github.com/karelzak/util-linux/issues/918
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-13 13:00:14 +01:00