]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
5 years agoumount: fix --quiet
Karel Zak [Mon, 10 Dec 2018 13:34:12 +0000 (14:34 +0100)] 
umount: fix --quiet

Addresses: https://github.com/karelzak/util-linux/commit/d5fd9ac6b208c5acdb6c0023757a7e2827474482#commitcomment-31610748
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agochoom: fix negative adjust score usage
Karel Zak [Mon, 10 Dec 2018 13:26:04 +0000 (14:26 +0100)] 
choom: fix negative adjust score usage

It's really bad idea to use uint64_t (ul_path_write_u64(()) when write
signed number.

Addresses: https://github.com/karelzak/util-linux/issues/723
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibuuid: fix man page typos
Seth Girvan [Fri, 7 Dec 2018 10:02:00 +0000 (02:02 -0800)] 
libuuid: fix man page typos

Signed-off-by: Seth Girvan <snth@snthhacks.com>
5 years agofstrim: fix usage()
Karel Zak [Mon, 10 Dec 2018 11:03:18 +0000 (12:03 +0100)] 
fstrim: fix usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: do not require crypt()
Karel Zak [Thu, 22 Nov 2018 11:53:00 +0000 (12:53 +0100)] 
build-sys: do not require crypt()

The function is necessary only for newgrp and sulogin.

Addresses: https://github.com/karelzak/util-linux/issues/584
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: do not require dirfd()
Karel Zak [Wed, 24 Oct 2018 12:32:29 +0000 (14:32 +0200)] 
build-sys: do not require dirfd()

The dirfd() is required on many places, but it should not be required for
all utils by ./configure.ac.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoinclude/c: re-add type checking in container_of()
Ruediger Meier [Sun, 2 Dec 2018 18:23:45 +0000 (19:23 +0100)] 
include/c: re-add type checking in container_of()

This reverts parts of commit eb06d5d4, which seems to be based on
Linux kernel commit c7acec71. Unlike the original kernel patch we did
not add that even stronger type checking by using macro BUILD_BUG_ON_MSG.
So basically we removed a useful warning when compiling such
broken code:

      struct st {
            int a;
            char b;
      };
      struct st t = { .a = 1, .b = 2 };
      struct st *x = container_of(&t.a, struct st, b);
      printf("%p %p\n", (void *)&t, (void *)x);

Moreover we also introduced a new compiler warning for intel/icc:
   "arithmetic on pointer to void or function type"

Let's just revert the update of container_of() because adding a
kernel-like BUILD_BUG_ON_MSG would be too much noise and also
problematic (see kernel commit c03567a8). Also note that the original
problem addressed by the kernel commit seems to be only reproducible
with gcc 4.9, not with any later gcc nor clang,icc. Moreover, currently
we have no such use-case in the UL sources anyways.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
5 years agotests: make lsns-netnsid portable
Karel Zak [Fri, 30 Nov 2018 11:24:15 +0000 (12:24 +0100)] 
tests: make lsns-netnsid portable

It seems ip(8) link-show command does not provide link-netnsid in all
cases (versions ?). Let's try to use "ip netns list-id" as fallback.

This commit also add possibility to debug the script by $LOG variable.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: enlarge backing file for fstab-btrfs
Karel Zak [Fri, 30 Nov 2018 11:22:48 +0000 (12:22 +0100)] 
tests: enlarge backing file for fstab-btrfs

It seems the new limit for Btrfs is 47MiB.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agomkswap: fix page size warning message
Noel Cragg [Thu, 29 Nov 2018 10:38:41 +0000 (11:38 +0100)] 
mkswap: fix page size warning message

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: make fdisk, sfdisk, cfdisk optional (enabled by default)
Carlos Santos [Thu, 22 Nov 2018 15:05:49 +0000 (13:05 -0200)] 
build-sys: make fdisk, sfdisk, cfdisk optional (enabled by default)

Useful for embedded systems, on which only few utilities are required.

[kzak@redhat.com: - rename to --disable-fdisks
                  - use $enable_{c,s,}fdisk in code]

Signed-off-by: Carlos Santos <casantos@datacom.com.br>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosetarch: fix obscure sparc32bash use-case
Karel Zak [Thu, 22 Nov 2018 10:03:35 +0000 (11:03 +0100)] 
setarch: fix obscure sparc32bash use-case

Reported-by: Carlos Santos <casantos@datacom.com.br>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: Return old behavior with empty logname
Stanislav Brabec [Mon, 19 Nov 2018 23:38:14 +0000 (00:38 +0100)] 
agetty: Return old behavior with empty logname

c094fcd37 introduced a behavior change: When Return is entered with empty
logname, nothing happens. As it confuses users, return back the old
behavior: re-prompt.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
5 years agofstrim: Add Documentation key to fstrim.service
Andreas Henriksson [Mon, 12 Nov 2018 18:45:51 +0000 (19:45 +0100)] 
fstrim: Add Documentation key to fstrim.service

5 years agouuidd: Add Documentation key to uuidd.service
Andreas Henriksson [Mon, 12 Nov 2018 18:39:45 +0000 (19:39 +0100)] 
uuidd: Add Documentation key to uuidd.service

5 years agofix a bug where switch_root would erroneously try to parse initargs
Paul Asmuth [Fri, 9 Nov 2018 16:02:11 +0000 (17:02 +0100)] 
fix a bug where switch_root would erroneously try to parse initargs

before this change, switch_root would try to parse all arguments,
including 'initargs', using getopt, which would lead to an 'unrecognized
option' error when trying to pass a flag to the init program

5 years agoagetty: fix output of escaped characters
Christian Hesse [Wed, 7 Nov 2018 12:55:06 +0000 (13:55 +0100)] 
agetty: fix output of escaped characters

Signed-off-by: Christian Hesse <mail@eworm.de>
5 years agolibblkid: fix detection of dm-integrity superblock
Milan Broz [Wed, 7 Nov 2018 11:48:37 +0000 (12:48 +0100)] 
libblkid: fix detection of dm-integrity superblock

Some new features in Linux kernel 4.19 for dm-integrity use metadata
format version 2, patch adds it to detection.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
5 years agoagetty: fix portability issues
Samuel Thibault [Mon, 12 Nov 2018 10:31:17 +0000 (11:31 +0100)] 
agetty: fix portability issues

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: run oids test only when uuidgen tool was built
Thomas Deutschmann [Sun, 11 Nov 2018 01:17:55 +0000 (02:17 +0100)] 
tests: run oids test only when uuidgen tool was built

oids test did not check if uuidgen was available.

oids test was also calling uuidgen from PATH which could result
in wrong results if uuidgen from a previous util-linux installation
was used.

With this commit we will check if uuidgen was built and make sure
that we only call the uuidgen binary we just built. If uuidgen is
not available we will skip this test.

5 years agobuild-sys: release++ (v2.33) v2.33
Karel Zak [Tue, 6 Nov 2018 11:08:46 +0000 (12:08 +0100)] 
build-sys: release++ (v2.33)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update v2.33-ReleaseNotes
Karel Zak [Tue, 6 Nov 2018 11:06:56 +0000 (12:06 +0100)] 
docs: update v2.33-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update AUTHORS file
Karel Zak [Tue, 6 Nov 2018 11:03:34 +0000 (12:03 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: merge changes
Karel Zak [Tue, 6 Nov 2018 11:00:00 +0000 (12:00 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update uk.po (from translationproject.org)

5 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update pt_BR.po (from translationproject.org)

5 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update pl.po (from translationproject.org)

5 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update ja.po (from translationproject.org)

5 years agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update fr.po (from translationproject.org)

5 years agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update es.po (from translationproject.org)

5 years agopo: update cs.po (from translationproject.org)
Petr Písař [Tue, 6 Nov 2018 10:43:56 +0000 (11:43 +0100)] 
po: update cs.po (from translationproject.org)

5 years agoMerge branch 'spelling' of https://github.com/jwilk-forks/util-linux
Karel Zak [Tue, 6 Nov 2018 09:56:03 +0000 (10:56 +0100)] 
Merge branch 'spelling' of https://github.com/jwilk-forks/util-linux

5 years agoeject: use err() rather than abort()
Karel Zak [Mon, 5 Nov 2018 09:34:10 +0000 (10:34 +0100)] 
eject: use err() rather than abort()

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1645920
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: fix typos
Jakub Wilk [Sat, 3 Nov 2018 19:55:45 +0000 (20:55 +0100)] 
docs: fix typos

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
5 years agoagetty: when logname is erased, re-enable reloads
Stanislav Brabec [Fri, 26 Oct 2018 13:02:17 +0000 (15:02 +0200)] 
agetty: when logname is erased, re-enable reloads

When user starts to enter logname, 8b58ffdd blocks issue reloads.
Reloads remain blocked even if user deletes all typed characters.

Make things visually consistent: If no characters are entered,
re-enable reloads.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
Reviewed-by: Lubomir Rintel <lkundrak@v3.sk>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
5 years agodocs: add info about branches; update travis.yml
Karel Zak [Wed, 24 Oct 2018 11:02:59 +0000 (13:02 +0200)] 
docs: add info about branches; update travis.yml

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoblkzone: fix report zones sector offset check
Masato Suzuki [Tue, 23 Oct 2018 09:31:35 +0000 (18:31 +0900)] 
blkzone: fix report zones sector offset check

To catch an offset error, an offset should be begger than or equal to
a device size in the condition.

Signed-off-by: Masato Suzuki <masato.suzuki@wdc.com>
5 years agoagetty: don't put the VC into canonical mode
Lubomir Rintel [Fri, 19 Oct 2018 20:08:17 +0000 (22:08 +0200)] 
agetty: don't put the VC into canonical mode

The wait_for_term_input()'s select() needs to be tripped when the user
starts typing. Otherwise the reloads can abort an already in-progress login.

Coupled with \4 and \6 expansions that happen to be there on Fedora Server,
this means reload on every netlink event. With a couple of IPv6 routers
announcing their networks and temporary addresses in use can make it
sometimes virtually impossible to log in.

Seems like zero lflags do the job just fine on a Linux VT. Reset it to
canonical mode before running login.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: release++ (v2.33-rc2) v2.33-rc2
Karel Zak [Fri, 19 Oct 2018 10:19:32 +0000 (12:19 +0200)] 
build-sys: release++ (v2.33-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update v2.33-ReleaseNotes
Karel Zak [Fri, 19 Oct 2018 10:18:07 +0000 (12:18 +0200)] 
docs: update v2.33-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update AUTHORS file
Karel Zak [Fri, 19 Oct 2018 10:16:45 +0000 (12:16 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: merge changes
Karel Zak [Fri, 19 Oct 2018 10:14:52 +0000 (12:14 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: don't use __u32
Karel Zak [Thu, 11 Oct 2018 12:22:08 +0000 (14:22 +0200)] 
agetty: don't use __u32

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: make output more robust
Karel Zak [Thu, 11 Oct 2018 11:29:39 +0000 (13:29 +0200)] 
agetty: make output more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: cleanup issue output change, remove bool
Karel Zak [Thu, 11 Oct 2018 11:21:23 +0000 (13:21 +0200)] 
agetty: cleanup issue output change, remove bool

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: move all issue variables to struct
Karel Zak [Thu, 11 Oct 2018 11:12:02 +0000 (13:12 +0200)] 
agetty: move all issue variables to struct

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoagetty: Reload only if it is really needed
Stanislav Brabec [Wed, 10 Oct 2018 17:26:34 +0000 (19:26 +0200)] 
agetty: Reload only if it is really needed

If netlink event arrives and related escapes are part of issue, agetty
reloads and re-display the prompt. Reload is triggered not only by IP
address change, but also by IPv6 RAs. In some environments it causes
reload several times in a minute, and even complicates the login.

To prevent this, reload only if a real change appears.

This consists of:
split print_issue_file() to several functions:

eval_issue_file() prints issue to memory. It does not affect terminal in
any way.

print_issue_file() prints issue file from memory.

cmp_issue_file() compares the issue file and returns true, if reload is
needed.

The implementation requires additional change:

do_prompt() does not evaluate the issue file. It is responsibility of
calling function.

Test suite:

Use issue that contais \4 and/or \6 escape.

After installing new instance, restart agetty by typing a letter and then
Enter 6 times.

To check whether reload happens, type a letter. When reload happens,
letter disappears.

1. Unplug network cable. Wait a while and re-plug network cable.
You should see 2 reloads on single stack and 3 reloads on dual stack.

2. Run a loop
while : ; do
sed -i '$areload_test' /etc/issue
agetty --reload
sleep 3
sed -i '/reload_test/d' /etc/issue
agetty --reload
sleep 3
done
You should see regular reload every 3 seconds.

3. Run a loop
while : ; do
agetty --reload
sleep 3
done
Before: You see regular reload every 3 seconds.
After: No reloads.

4. Run a loop
while : ; do
ifconfig lo 127.0.0.1 netmask 255.0.0.0
sleep 3
ifconfig lo 127.0.0.2 netmask 255.0.0.0
sleep 3
done
Before: You see regular reload every 3 seconds.
After: No reloads.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
5 years agoagetty: Watch only protocol requested by issue escapes
Stanislav Brabec [Wed, 10 Oct 2018 17:26:27 +0000 (19:26 +0200)] 
agetty: Watch only protocol requested by issue escapes

To decrease number of reloads, watch only protocol requested by \4 and \6
escapes in issue file.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
5 years agoagetty: rename variable changed to triggered
Stanislav Brabec [Wed, 10 Oct 2018 17:26:21 +0000 (19:26 +0200)] 
agetty: rename variable changed to triggered

changed variable name is not correct. It does not say that network
interface changed its address. It just says that the netlink message
processing was triggered.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
5 years agobash-completion: cleanup mount and umount --namespace
Karel Zak [Fri, 5 Oct 2018 09:48:04 +0000 (11:48 +0200)] 
bash-completion: cleanup mount and umount --namespace

* use only PATHs rather than PIDs to namespaces

* add --namespace to umount too

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch '2018wk40' of https://github.com/kerolasa/util-linux
Karel Zak [Fri, 5 Oct 2018 09:42:59 +0000 (11:42 +0200)] 
Merge branch '2018wk40' of https://github.com/kerolasa/util-linux

* '2018wk40' of https://github.com/kerolasa/util-linux:
  bash-completion: catch up with option changes

5 years agolibmount: keep namespaces support optional
Karel Zak [Fri, 5 Oct 2018 09:04:04 +0000 (11:04 +0200)] 
libmount: keep namespaces support optional

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: add USE_LIBMOUNT_SUPPORT_NAMESPACES
Karel Zak [Fri, 5 Oct 2018 09:02:26 +0000 (11:02 +0200)] 
build-sys: add USE_LIBMOUNT_SUPPORT_NAMESPACES

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobash-completion: catch up with option changes
Sami Kerola [Thu, 4 Oct 2018 20:36:22 +0000 (21:36 +0100)] 
bash-completion: catch up with option changes

Check what has changed in usage functions in between v2.32..a77bd80d5 and
update bash-completion files accordingly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
5 years agosfdisk: disable --activate for Hybrid GPT/MBR
Karel Zak [Thu, 4 Oct 2018 12:06:45 +0000 (14:06 +0200)] 
sfdisk: disable --activate for Hybrid GPT/MBR

Addresses: https://github.com/karelzak/util-linux/issues/699
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: add getopt to TODO
Karel Zak [Thu, 4 Oct 2018 10:54:05 +0000 (12:54 +0200)] 
docs: add getopt to TODO

Addresses: https://github.com/karelzak/util-linux/issues/701
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosfdisk: be more verbose about PMBR on --activate
Karel Zak [Thu, 4 Oct 2018 10:40:10 +0000 (12:40 +0200)] 
sfdisk: be more verbose about PMBR on --activate

Addresses: https://github.com/karelzak/util-linux/issues/699
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agorename: avoid undefined function prototype for `fpurge`
Patrick Steinhardt [Wed, 26 Sep 2018 06:23:09 +0000 (08:23 +0200)] 
rename: avoid undefined function prototype for `fpurge`

In case where the non-standard `fpurge` function is available, we
redefine `__fpurge` to `fpurge`. We can do so because the only
difference between both functions is that one returns an error code
while the other does not. But as we do not check the error code either
way, we do not care about which one of them we use.

The above redefinition happens unconditionally if we know that `fpurge`
exists. Most notably, we also redefine it if we already do have an
`__fpurge` function available that could be used. This causes problems
on musl-based platforms, where we detect availability of `fpurge` in
libc, but where no function declaration for it exists in "stdio_ext.h".
The compiler thus prints a warning due to an unknown function, even
though it will link just fine.

Avoid this warning by only redefining `__fpurge` to `fpurge` when
HAVE___FPURGE is not defined.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
5 years agolsblk: fix unknown type `stat` caused by missing header
Patrick Steinhardt [Wed, 26 Sep 2018 06:23:08 +0000 (08:23 +0200)] 
lsblk: fix unknown type `stat` caused by missing header

The structure `blkdev_cxt` has a `struct stat` member embedded, whose
size may not be known on some systems because of a missing include for
"sys/stat.h". On glibc-based systems, this header is included
transitively via "sys/statvfs.h", but on musl-based systems it is not.

Fix the resulting compile error due to unknown size of the struct by
including "sys/stat.h".

Signed-off-by: Patrick Steinhardt <ps@pks.im>
5 years agolibfdisk: fix printf format modifier
Ruediger Meier [Tue, 25 Sep 2018 22:37:29 +0000 (00:37 +0200)] 
libfdisk: fix printf format modifier

libfdisk/src/script.c: In function ‘fdisk_script_read_context’:
libfdisk/src/script.c:452:33: error: format ‘%zu’ expects argument of type ‘size_t’, but argument 4 has type ‘long unsigned int’ [-Werror=format=]
   snprintf(buf, sizeof(buf), "%zu", fdisk_get_grain_size(cxt));
                                 ^

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
5 years agolibfdisk: fix OSX compiler warning
Ruediger Meier [Tue, 25 Sep 2018 22:37:28 +0000 (00:37 +0200)] 
libfdisk: fix OSX compiler warning

libfdisk/src/context.c:1354:54: error: unused parameter 'cxt' [-Werror,-Wunused-parameter]
const char *fdisk_get_devmodel(struct fdisk_context *cxt)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
5 years agoagetty: cleanup code to copy to log strings
Karel Zak [Wed, 3 Oct 2018 15:08:11 +0000 (17:08 +0200)] 
agetty: cleanup code to copy to log strings

man utmp:
  String fields are terminated by a null byte ('\0') if they are shorter
  than the size of the field.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosu: cleanup code to copy to log strings
Karel Zak [Wed, 3 Oct 2018 15:08:11 +0000 (17:08 +0200)] 
su: cleanup code to copy to log strings

man utmp:
  String fields are terminated by a null byte ('\0') if they are shorter
  than the size of the field.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agologin: cleanup code to copy to log strings
Karel Zak [Wed, 3 Oct 2018 15:08:11 +0000 (17:08 +0200)] 
login: cleanup code to copy to log strings

man utmp:
  String fields are terminated by a null byte ('\0') if they are shorter
  than the size of the field.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agomkfs.cramfs: properly copy disk name
Karel Zak [Wed, 3 Oct 2018 15:07:37 +0000 (17:07 +0200)] 
mkfs.cramfs: properly copy disk name

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolast: make sure domain is zero terminated
Karel Zak [Wed, 3 Oct 2018 15:06:33 +0000 (17:06 +0200)] 
last: make sure domain is zero terminated

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agowall: make sure line is zero terminated
Karel Zak [Wed, 3 Oct 2018 15:06:12 +0000 (17:06 +0200)] 
wall: make sure line is zero terminated

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoinclude/c: add str2memcpy() and mem2strcpy()
Karel Zak [Wed, 3 Oct 2018 15:03:11 +0000 (17:03 +0200)] 
include/c: add str2memcpy() and mem2strcpy()

str2memcpy() - copy zero terminated string to optionally terminated buffer

mem2strcpy() - copy from buffer to zero terminated string

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoinclude/ttyutils: define values if missing.
Sevan Janiyan [Sat, 29 Sep 2018 13:49:02 +0000 (14:49 +0100)] 
include/ttyutils: define values if missing.

Upstreamed from pkgsrc.

Addresses: https://github.com/karelzak/util-linux/pull/695
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoinclude/c: add NAME_MAX compat
Sevan Janiyan [Sat, 29 Sep 2018 13:50:04 +0000 (14:50 +0100)] 
include/c: add NAME_MAX compat

Upstreamed from pkgsrc.

Addresses: https://github.com/karelzak/util-linux/pull/695
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: always use "part" as TYPE for partitions
Karel Zak [Wed, 3 Oct 2018 12:39:57 +0000 (14:39 +0200)] 
lsblk: always use "part" as TYPE for partitions

The current code uses "part" or "disk" only if nothing else is
possible to recognize. It means for example partitions on loops (or
RAIDs, etc) are marked as "loop" rather than "part".

Addresses: https://github.com/karelzak/util-linux/issues/700
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agomount: add note about MS_BIND and _netdev
Karel Zak [Tue, 2 Oct 2018 10:50:40 +0000 (12:50 +0200)] 
mount: add note about MS_BIND and _netdev

Addresses: https://github.com/karelzak/util-linux/issues/697
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agobuild-sys: release++ (v2.33-rc1) v2.33-rc1
Karel Zak [Tue, 25 Sep 2018 09:26:58 +0000 (11:26 +0200)] 
build-sys: release++ (v2.33-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: add choom to build-sys test
Karel Zak [Mon, 24 Sep 2018 09:37:13 +0000 (11:37 +0200)] 
tests: add choom to build-sys test

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: fix gtkdoc warning
Karel Zak [Mon, 24 Sep 2018 09:21:09 +0000 (11:21 +0200)] 
docs: fix gtkdoc warning

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update v2.33-ReleaseNotes
Karel Zak [Thu, 20 Sep 2018 12:27:55 +0000 (14:27 +0200)] 
docs: update v2.33-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agodocs: update AUTHORS file
Karel Zak [Thu, 20 Sep 2018 10:19:06 +0000 (12:19 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: merge changes
Karel Zak [Wed, 19 Sep 2018 10:54:05 +0000 (12:54 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agopo: update sv.po (from translationproject.org)
Sebastian Rasmussen [Wed, 19 Sep 2018 10:49:46 +0000 (12:49 +0200)] 
po: update sv.po (from translationproject.org)

5 years agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Wed, 19 Sep 2018 10:49:46 +0000 (12:49 +0200)] 
po: update pt_BR.po (from translationproject.org)

5 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Wed, 19 Sep 2018 10:49:46 +0000 (12:49 +0200)] 
po: update ja.po (from translationproject.org)

5 years agolibfdisk: (docs) add missing function
Karel Zak [Wed, 19 Sep 2018 10:00:59 +0000 (12:00 +0200)] 
libfdisk: (docs) add missing function

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: move udev and blkid stuff to lsblk-properties.c
Karel Zak [Wed, 19 Sep 2018 09:25:08 +0000 (11:25 +0200)] 
lsblk: move udev and blkid stuff to lsblk-properties.c

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: cleanup udev/blkid properties code
Karel Zak [Wed, 19 Sep 2018 09:04:35 +0000 (11:04 +0200)] 
lsblk: cleanup udev/blkid properties code

* split properties to separate struct which is allocated only when
  udev or blkid provides some information

* use separate function for udev and blkid and hide details in generic
  get_device_properties()

* make sure we do not overwrite stuff udev and blkid (but this is only
  theoretic issue as we do not call get_properties_by_blkid() directly
  from code)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agotests: update sfdisk resize
Karel Zak [Mon, 17 Sep 2018 14:22:14 +0000 (16:22 +0200)] 
tests: update sfdisk resize

due to 2f35c1ead621f42f32f7777232568cb03185b473

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibfdisk: count gaps to possible size when resize
Karel Zak [Mon, 17 Sep 2018 09:58:50 +0000 (11:58 +0200)] 
libfdisk: count gaps to possible size when resize

The current code counts only partition sizes when it counts possible
space, but we have gaps between the partitions. It seems better to
count all based on offsets rather than sizes.

Addresses: https://github.com/karelzak/util-linux/issues/693
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: encapsulate stat() usage
Karel Zak [Fri, 14 Sep 2018 14:27:26 +0000 (16:27 +0200)] 
lsblk: encapsulate stat() usage

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolib/strutils: return from xstrmode()
Karel Zak [Fri, 14 Sep 2018 14:26:38 +0000 (16:26 +0200)] 
lib/strutils: return from xstrmode()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: differentiate between swap and mount
Karel Zak [Fri, 14 Sep 2018 13:57:45 +0000 (15:57 +0200)] 
lsblk: differentiate between swap and mount

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: use lsblk_ prefix mountpoint getter
Karel Zak [Fri, 14 Sep 2018 13:49:00 +0000 (15:49 +0200)] 
lsblk: use lsblk_ prefix mountpoint getter

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: init/deinit libmount stuff
Karel Zak [Fri, 14 Sep 2018 13:45:53 +0000 (15:45 +0200)] 
lsblk: init/deinit libmount stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: move mount stuff to lsblk-mnt.c
Karel Zak [Fri, 14 Sep 2018 13:41:39 +0000 (15:41 +0200)] 
lsblk: move mount stuff to lsblk-mnt.c

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: add lsblk.h
Karel Zak [Fri, 14 Sep 2018 13:36:59 +0000 (15:36 +0200)] 
lsblk: add lsblk.h

* move core struct to the header file
* move debug stuff to the header file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: add columns FSAVAIL,FSSIZE,FSUSED,FSUSE%
Karel Zak [Thu, 13 Sep 2018 10:11:06 +0000 (12:11 +0200)] 
lsblk: add columns FSAVAIL,FSSIZE,FSUSED,FSUSE%

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolibfdisk: accept grain script header
Karel Zak [Wed, 12 Sep 2018 11:18:08 +0000 (13:18 +0200)] 
libfdisk: accept grain script header

The "grain" variable is used to calculate partitions alignment. The
default is 1MiB (or minimal I/O size). The libfdisk provides API to overwrite
this default, but this feature has been nowhere accessible for
end-user.

This patch support for "grain: <size>" in libfdisk scripts.

Addresses: https://github.com/karelzak/util-linux/issues/688
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agosfdisk: document script GPT headers
Karel Zak [Wed, 12 Sep 2018 10:26:06 +0000 (12:26 +0200)] 
sfdisk: document script GPT headers

Add first-lba, last-lba and table-length to the sfdisk man page.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agoMerge branch 'more' of https://github.com/kerolasa/util-linux
Karel Zak [Tue, 11 Sep 2018 11:42:52 +0000 (13:42 +0200)] 
Merge branch 'more' of https://github.com/kerolasa/util-linux

* 'more' of https://github.com/kerolasa/util-linux:
  more: rename functions
  more: rename variable names
  more: remove unnecessary ifdef preprosessor directives
  more: do not call fileno() for std{in,out,err} streams
  more: remove 'register' keywords
  more: remove pointless functions
  more: return is statement not a function
  more: remove dead code and useless comments

5 years agounshare: remove -s from --help output
Karel Zak [Tue, 11 Sep 2018 10:43:03 +0000 (12:43 +0200)] 
unshare: remove -s from --help output

The code and man page do not assume -s to be short alias to
--setgroups.

This commit also a little bit change --help output formatting to make
it more readable and structured.

Addresses: https://github.com/karelzak/util-linux/pull/692
Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agolsblk: don't ask udev when --sysroot specified
Karel Zak [Tue, 11 Sep 2018 07:53:18 +0000 (09:53 +0200)] 
lsblk: don't ask udev when --sysroot specified

We use --sysroot to get information about block devices from /proc and
/sys dumps. In this case does not make sense to read anything from
udev as udevd is about the current system devices.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 years agofallocate: add missing semicolon
Matti Niemenmaa [Mon, 10 Sep 2018 12:21:31 +0000 (15:21 +0300)] 
fallocate: add missing semicolon

This broke compilation when HAVE_POSIX_FALLOCATE was undefined. The typo
dates to the original posix_fallocate support added in commit
833f9a7aae713278eec5f85266597482f18c7370.

Signed-off-by: Matti Niemenmaa <matti.niemenmaa+git@iki.fi>