| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
|
|
|
|
|
|
|
| |
[kzak@redhat.com: - cosmetic changes, add some comments]
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's possible we erase from the whole device before we erase from the
partition on the same disk:
# wipefs -a /dev/sdc /dev/sdc1
the current code calls re-read PT ioctl immediately after erase (so,
before sdc1 is processed). The result is that sdc1 node is no more
accessible:
# wipefs -a /dev/sdc /dev/sdc1
/dev/sdc: 2 bytes were erased at offset 0x000001fe (dos): 55 aa
/dev/sdc: calling ioctl to re-read partition table: Success
wipefs: error: /dev/sdc1: probing initialization failed: No such file or directory
It seems the most simple solution is to postpone the re-read ioctl and
do it as the last thing.
# wipefs -a /dev/sdc /dev/sdc1
/dev/sdc: 2 bytes were erased at offset 0x000001fe (dos): 55 aa
/dev/sdc1: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef
/dev/sdc: calling ioctl to re-read partition table: Success
The patch also adds a small delay before the re-read ioctl call. It's
not elegant, but without the usleep(25000) the first attempt returns
EBUSY.
Addresses: https://github.com/karelzak/util-linux/issues/598
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
| |
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1589148
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Matias Bjørling wrote:
The current detection code for chunk size assumes that the
underlying device is a device that uses the minor device id
as the partition id, and that the whole device has minor id 0.
This is not true for example null_blk and nvme device drivers.
Let's use sysfs_devno_to_wholedisk() to get whole-disk devno.
Addresses: https://github.com/karelzak/util-linux/pull/646
Reported-by: Matias Bjørling matias.bjorling@wdc.com
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
losetup tries to blindly use specified device as well as search for
the first free device, the result is:
# losetup /dev/loop1 -f /tmp/tfile_loop1
losetup: /dev/loop1: failed to set up loop device: Invalid argument
fixed version:
# losetup /dev/loop10 -f img
losetup: unexpected arguments
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1566432
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
agetty sets c_iflags according to interaction with serial line in
get_logname(). For --autologin it does not read from the line, so we
have no clue how to set the flags.
The current behavior is to zeroize the flags. Unfortunately, it seems
like bad idea, because the line may be already properly initialized by
kernel (or systemd, etc.).
The new behavior is not touch the flags on --autologin.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1252764
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The commit 0f9f927b6f62cb7f488fadfad76c4a5defdefe36 forces
libsmartcols to use one byte as a minimal column width. This seems
like a bug if the column is empty and without header.
$ printf ':a:b\n' | column -t -s ':' -o ':'
:a:b
Fixed version:
$ printf ':a:b\n' | column -t -s ':' -o ':'
:a:b
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
| |
The previous commit 4ebea84bb1ca6b0fa817588aba13de26c8d5e5a0 replaced
all operations by strings, but it does not work for MS_MOVE as this
operation is not supported in fstab by libmount.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Specifying MS_MGC_VAL was required in kernel versions prior to 2.4,
but since Linux 2.4 is no longer required and is ignored if specified
The minimal kernel requirement for util-linux is Linux v2.6.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libmount allows to split one library (mount(8)) call to multiple mount(2)
syscalls, for example
--rbind --make-rslave
in this case we have to be careful with MS_REC because the flag is
applied to multiple operations.
# strace -e mount mount --rbind --make-rslave /mnt/A /mnt/B
Old version:
mount("/mnt/A", "/mnt/B", 0x13ecac0, MS_MGC_VAL|MS_BIND, NULL) = 0
mount("none", "/mnt/B", NULL, MS_REC|MS_SLAVE, NULL) = 0
Fixed version:
mount("/mnt/A", "/mnt/B", 0x1f22ac0, MS_MGC_VAL|MS_BIND|MS_REC, NULL) = 0
mount("none", "/mnt/B", NULL, MS_REC|MS_SLAVE, NULL) = 0
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1584443
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
It's better to inform libmount about operations by string than by
flags, because for example "rbind,slave" cannot be specified by
MS_REC|MS_BIND|MS_SLAVE.
https://bugzilla.redhat.com/show_bug.cgi?id=1584443
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
| |
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=891812
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
| |
Reported-by: Rosberg Nascimento Freitas Rodrigues <rosberg.berg@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current libmount MS_REMOUNT|MS_BIND support is restricted to
MS_RDONLY (read-only bind mount). This is too restrictive as Linux
kernel supports bind-remount for arbitrary VFS flags.
After this update you can use
# mount /dev/sdc1 /mnt/A
# mount --bind -onosuid,noexec /mnt/A /mnt/B
# findmnt /dev/sdc1 -oTARGET,SOURCE,FS-OPTIONS,VFS-OPTIONS
TARGET SOURCE FS-OPTIONS VFS-OPTIONS
/mnt/A /dev/sdc1 rw,stripe=512,data=ordered rw,relatime
/mnt/B /dev/sdc1 rw,stripe=512,data=ordered rw,nosuid,noexec,relatime
The "mount --bind" is composed from two syscalls of course (1st is
bind, 2nd is bind,remount,nosuid,noexec).
Addresses: https://github.com/karelzak/util-linux/issues/637
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
| |
[sys-utils/mountpoint.c:79]: (style) Redundant condition:
ctl->st.st_dev==pst.st_dev. 'A || (!A && B)' is equivalent to 'A || B'
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc -fsanitize=undefined gives following warning.
include/pt-mbr.h:27:51: runtime error: left shift of 248 by 24 places cannot
be represented in type 'int'
It looks like char is converted internally to int before bit-shift, and that
type overflows when char value is greater than 127. Following code snippet
will show the effect what is stored when undefined behaviour happens.
#include <stdio.h>
#include <inttypes.h>
int main(int argc, unsigned char **argv)
{
char p[] = { 170, 170, 170, 170 };
unsigned int uint = p[3];
uint64_t res = 0;
/* overflow */
res = p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
printf("%" PRIu64 "\n", res);
/* this is fine */
res = 0;
res = p[0] | (p[1] << 8) | (p[2] << 16) | (uint << 24);
printf("%" PRIu64 "\n", res);
return 0;
}
I tested gcc 8.1.0, clang 6.0.0, and tcc 0.9.27 and they all printed the
same values.
$ ./a.out
18446744073709551530
4294967210
Because output is result of undefined behavior what is stored may change in
future, and other compilers / version might do something different. In the
case of what pt-mbr.h the destination data type size was commonly 32 bits in
size, that truncated excess rubbish from bitshift. Needless to say that was
not very robust code.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
| |
While looking earlier commit I noticed everything but formatting was removed
from a message in namei.c file. That inspired me to look if there are more
strings that does not need translation project attention. This change
removes at least some of them, if not all.
Reference: e19cc7b65b31c57f0fe9cb73c9afad5197796f82
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
| |
No space after device name is not entirely right, but that's better than
missing argument completions.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
| |
Mark also file names read-only.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix shellcheck error.
if ! [ "$paraller_jobs" -ge 0 2>/dev/null ]; then
^-- SC1009: The mentioned parser error was in this if expression.
^-- SC1073: Couldn't parse this test expression.
^-- SC1072: Expected test to end here (don't
wrap commands in []/[[]]). Fix any
mentioned problems and try again.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
| |
Addresses: https://github.com/karelzak/util-linux/issues/643
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|\
| |
| |
| |
| | |
* 'master' of https://github.com/pali/util-linux:
libblkid: udf: Fix reporting UDF 2.60 revision
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
According to the UDF 2.60 specification, the Minimum UDF Read Revision
value shall be at most #0250 for all media with a UDF 2.60 file system.
So in this case use Minimum UDF Write Revision as ID_FS_VERSION to
distinguish between UDF 2.50 and UDF 2.60 discs.
This commit also adds a testing Blu-Ray Recordable image with UDF revision
2.60 created by Nero which really sets Minimum UDF Read Revision to 2.50.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
|
|/
|
|
|
| |
Addresses: https://github.com/karelzak/util-linux/issues/641
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Windows 10 Creators edition has extended the ntfs cluster limit to
2MB. As a consequence blkid does not identify recent partitions with
clusters beyond 65K as ntfs ones.
Addresses: https://github.com/karelzak/util-linux/issues/641
Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Jean-Pierre André <jean-pierre.andre@wanadoo.fr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Seen on OSX 10.13, xcode 9.3.
disk-utils/cfdisk.c:1860:45: error: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
DBG(UI, ul_debug("get_size (default=%ju)", *res));
~~~ ^~~~
%llu
disk-utils/cfdisk.c:267:60: note: expanded from macro 'DBG'
#define DBG(m, x) __UL_DBG(cfdisk, CFDISK_DEBUG_, m, x)
^
./include/debug.h:67:4: note: expanded from macro '__UL_DBG'
x; \
^
disk-utils/cfdisk.c:1889:25: error: incompatible pointer types passing 'uint64_t *' (aka 'unsigned long long *') to parameter of type 'uintmax_t *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]
rc = parse_size(buf, &user, &pwr); /* parse */
^~~~~
./include/strutils.h:15:51: note: passing argument to parameter 'res' here
extern int parse_size(const char *str, uintmax_t *res, int *power);
^
2 errors generated.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
|
| |
Reported-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Let's follow the standard $id$salt$encrypted password format in
verification code.
The current code is useless and for example PWD-LOCK column is always
FALSE.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1581611
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
| |
Punctuation marks have been left in the only argument of two-fonts
macros, instead of being separated from it to make the second one.
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
|
|
|
|
|
|
|
| |
Use the correct macro "I" for one argument, instead of the
two-fonts macro "IR".
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
|
|
|
|
|
|
|
|
| |
Use the correct macro (I, B) for the font change of one argument, not
those that are used for alternating two fonts, like "BR", "IR", "RB",
or "RI".
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
|
|
|
|
|
|
|
| |
Group include, defines and such together, and move items inbetween functions
on top of the source file so that everything can be seen easily.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
| |
Noticed on 32bit builds. Types changed in 0da73643.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
| |
Reported-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces [...] to store extra information about terminal
to the typescript header. For example:
Script started on 2018-05-14 12:52:32+02:00 [TERM="xterm-256color" TTY="/dev/pts/3" COLS="190" LINES="53"]
or
Script started on 2018-05-14 12:54:01+02:00 [<not executed on terminal>]
if stdout is not terminal.
Addresses: https://github.com/karelzak/util-linux/issues/583
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
| |
* always save "done" timestamp to typescript (use done() for this)
* use FORMAT_TIMESTAMP_MAX as buffer size
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|