Lennart Poettering [Mon, 26 Oct 2015 22:20:41 +0000 (23:20 +0100)]
util-lib: split out umask-related code to umask-util.h
Lennart Poettering [Mon, 26 Oct 2015 22:01:30 +0000 (23:01 +0100)]
util-lib: move more locale-related calls to locale-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 21:34:47 +0000 (22:34 +0100)]
util-lib: move status printing stuff into src/core/
It's very specific to the core, and not used elsewhere, hence move it
out of terminal-util.[ch].
Lennart Poettering [Mon, 26 Oct 2015 21:31:05 +0000 (22:31 +0100)]
util-lib: move string table stuff into its own string-table.[ch]
Lennart Poettering [Mon, 26 Oct 2015 21:01:44 +0000 (22:01 +0100)]
util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 20:26:33 +0000 (21:26 +0100)]
util: move string_is_safe() to string-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 20:16:26 +0000 (21:16 +0100)]
util-lib: move a number of fs operations into fs-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 19:39:23 +0000 (20:39 +0100)]
util-lib: split out file attribute calls to chattr-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 19:26:23 +0000 (20:26 +0100)]
util-lib: split xattr-related calls into xattr-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 19:07:55 +0000 (20:07 +0100)]
util-lib: introduce dirent-util.[ch] for directory entry calls
Also, move a couple of more path-related functions to path-util.c.
Lennart Poettering [Mon, 26 Oct 2015 18:40:43 +0000 (19:40 +0100)]
util-lib: split out resource limits related calls into rlimit-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 18:08:09 +0000 (19:08 +0100)]
util-lib: move take_password_lock() to user-util.[ch]
Also, rename it take_etc_passwd_lock(), in order to make it more
expressive.
Lennart Poettering [Mon, 26 Oct 2015 17:59:36 +0000 (18:59 +0100)]
util: move filename_is_valid() and path_is_safe() to path-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 17:44:13 +0000 (18:44 +0100)]
util-lib: move mount related utility calls to mount-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 17:43:29 +0000 (18:43 +0100)]
util-lib: move fstab_node_to_udev_node() to fstab-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 17:05:03 +0000 (18:05 +0100)]
util-lib: move more file I/O related calls into fileio.[ch]
Lennart Poettering [Mon, 26 Oct 2015 16:30:56 +0000 (17:30 +0100)]
util: remove path_get_parent(), in favour of dirname_malloc()
We don't need two functions that do essentialy the same, hence drop
path_get_parent(), and stick to dirname_malloc(), but move it to
path-util.[ch].
Lennart Poettering [Mon, 26 Oct 2015 15:41:43 +0000 (16:41 +0100)]
util-lib: split out hex/dec/oct encoding/decoding into its own file
Lennart Poettering [Mon, 26 Oct 2015 15:18:16 +0000 (16:18 +0100)]
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]
Tom Gundersen [Tue, 27 Oct 2015 10:41:06 +0000 (11:41 +0100)]
Merge pull request #1693 from ssahani/word
timesysnd: port to extract_first_word
Susant Sahani [Tue, 27 Oct 2015 03:54:23 +0000 (09:24 +0530)]
resolved: port to extract_first_word
Susant Sahani [Tue, 27 Oct 2015 03:42:04 +0000 (09:12 +0530)]
timesysnd: port to extract_first_word
Lennart Poettering [Tue, 27 Oct 2015 02:07:24 +0000 (03:07 +0100)]
Merge pull request #1688 from phomes/typo-fix
path-util: do not return NULL as int
Thomas Hindoe Paaboel Andersen [Mon, 26 Oct 2015 21:26:49 +0000 (22:26 +0100)]
path-util: do not return NULL as int
strv_split will only return NULL on oom so we should return -ENOMEM
instead.
Looks like an oversight from the changes in
0f474365
Lennart Poettering [Mon, 26 Oct 2015 16:53:59 +0000 (17:53 +0100)]
Merge pull request #1679 from evverx/refuse-manual-start-by-reload-or-restart
core: don't allow manual start with reload-or-restart too
Lennart Poettering [Mon, 26 Oct 2015 16:52:37 +0000 (17:52 +0100)]
Merge pull request #1686 from medhefgo/remount-ro-fix
unmount: Pass in mount options when remounting read-only
Jan Janssen [Mon, 26 Oct 2015 14:13:28 +0000 (15:13 +0100)]
unmount: Pass in mount options when remounting read-only
man 2 mount says that the mountflags and data parameteres should
match the original values except for the desired changes. We only
bother with the mount options since the only flags we can change
are MS_RDONLY, MS_SYNCHRONOUS and MS_MANDLOCK; which shouldn't
matter too much.
Fixes: #351
Tom Gundersen [Mon, 26 Oct 2015 12:21:41 +0000 (13:21 +0100)]
Merge pull request #1676 from poettering/util-lib-2
split up util.[ch] into more pieces, and other stuff
Tom Gundersen [Mon, 26 Oct 2015 12:12:30 +0000 (13:12 +0100)]
journal: add missing include
Lennart Poettering [Mon, 26 Oct 2015 11:25:34 +0000 (12:25 +0100)]
Merge pull request #1681 from ssahani/journal
journald-server: port to extract_first_word
Susant Sahani [Mon, 26 Oct 2015 09:58:03 +0000 (15:28 +0530)]
journald-server: port to extract_first_word
Evgeny Vereshchagin [Mon, 26 Oct 2015 04:23:09 +0000 (04:23 +0000)]
core: don't allow manual start with reload-or-restart too
fix bug: systemctl reload-or-restart starts a service with RefuseManualStart=yes
Lennart Poettering [Mon, 26 Oct 2015 00:43:23 +0000 (01:43 +0100)]
Merge pull request #1675 from evverx/run-protect-home
systemd-run can launch units with ProtectHome
Lennart Poettering [Mon, 26 Oct 2015 00:13:11 +0000 (01:13 +0100)]
process-util: move more process related calls to process-util.[ch]
Lennart Poettering [Mon, 26 Oct 2015 00:09:02 +0000 (01:09 +0100)]
socket-util: move remaining socket-related calls from util.[ch] to socket-util.[ch]
Lennart Poettering [Sun, 25 Oct 2015 23:56:12 +0000 (00:56 +0100)]
build-sys: add missing makefile symlink
Lennart Poettering [Sun, 25 Oct 2015 23:54:08 +0000 (00:54 +0100)]
util-lib: move ether_addr_to_string() into ether-addr-util.c
Lennart Poettering [Sun, 25 Oct 2015 23:46:40 +0000 (00:46 +0100)]
path-util: minor coding style fix
We usually avoid relying on C's degrade-to-boolean functionality when
comparing numerical variables with 0. We use it only for pointers and
actual booleans.
Lennart Poettering [Sun, 25 Oct 2015 23:45:32 +0000 (00:45 +0100)]
core: rename SmackFileSystemRoot= to SmackFileSystemRootLabel=
That way it's in sync with the other SMACK label settings.
https://github.com/systemd/systemd/pull/1664#issuecomment-
150891270
Lennart Poettering [Sun, 25 Oct 2015 23:38:21 +0000 (00:38 +0100)]
user-util: never hand out or accept invalid UIDs
libc isn't that strict, but it's a good idea if we are, to not create
confusion around invalid user ids.
Lennart Poettering [Sun, 25 Oct 2015 22:20:05 +0000 (23:20 +0100)]
util: remove lookup_uid(), replace by uid_to_name()
So far we had two pretty much identical calls in user-util.[ch]:
lookup_uid() and uid_to_name(). Get rid of the former, in favour of the
latter, and while we are at it, rewrite it, to use getpwuid_r()
correctly, inside an allocation loop, as POSIX intended.
Lennart Poettering [Sun, 25 Oct 2015 21:37:43 +0000 (22:37 +0100)]
user-util: simplify uid parsing a bit
Lennart Poettering [Sun, 25 Oct 2015 21:32:30 +0000 (22:32 +0100)]
util-lib: split out user/group/uid/gid calls into user-util.[ch]
Lennart Poettering [Sun, 25 Oct 2015 13:08:25 +0000 (14:08 +0100)]
util-lib: split out IO related calls to io-util.[ch]
Evgeny Vereshchagin [Mon, 26 Oct 2015 00:22:34 +0000 (00:22 +0000)]
shell-completion: systemd-run: add the property ProtectHome
Evgeny Vereshchagin [Mon, 26 Oct 2015 00:20:49 +0000 (00:20 +0000)]
run: can launch units with ProtectHome
Lennart Poettering [Sun, 25 Oct 2015 23:41:45 +0000 (00:41 +0100)]
Merge pull request #1674 from evverx/run-fix-couldnot-find-executable
run: fix "couldn't find executable" for the existing executables
Lennart Poettering [Sun, 25 Oct 2015 21:58:00 +0000 (22:58 +0100)]
Merge pull request #1673 from mustrumr/date-fixes
Date fixes
Evgeny Vereshchagin [Sun, 25 Oct 2015 18:29:24 +0000 (18:29 +0000)]
run: fix "couldn't find executable" for the existing executables
Fixes: #1672
Hristo Venev [Sun, 25 Oct 2015 16:32:05 +0000 (18:32 +0200)]
man: fix systemd.time RAS syndrome and line length
"UTC time" is a RAP phrase (redundant acronym phrase phrase).
Hristo Venev [Sun, 25 Oct 2015 16:25:58 +0000 (18:25 +0200)]
test: "today UTC" is not always "today UTC"
On Oct 25 2015 in EET/EEST there is a UTC+3->UTC+2 transition. This
means that the representation of "today UTC" as local time is ambiguous.
Hristo Venev [Sun, 25 Oct 2015 16:24:39 +0000 (18:24 +0200)]
basic: use the return value of endswith
It returns the position where the suffix begins, which can be used for
strndup to extract the prefix without calling strlen.
Ronny Chevalier [Sun, 25 Oct 2015 16:19:30 +0000 (17:19 +0100)]
Merge pull request #1671 from keszybz/zsh-journalctl-identifier
zsh-completion: journalctl --identifier
Zbigniew Jędrzejewski-Szmek [Sun, 25 Oct 2015 14:49:19 +0000 (10:49 -0400)]
zsh-completion: journalctl --identifier
Fixes #1549.
Tom Gundersen [Sun, 25 Oct 2015 13:35:40 +0000 (14:35 +0100)]
Merge pull request #1668 from ssahani/net1
networkd: fix asserts
Tom Gundersen [Sun, 25 Oct 2015 13:22:43 +0000 (14:22 +0100)]
Merge pull request #1654 from poettering/util-lib
Various changes to src/basic/
Lennart Poettering [Sun, 25 Oct 2015 12:56:40 +0000 (13:56 +0100)]
Merge pull request #1667 from evverx/run-protect-system
systemd-run can launch units with ProtectSystem
Lennart Poettering [Sun, 25 Oct 2015 12:16:10 +0000 (13:16 +0100)]
util-lib: move formats-util.h from shared/ to basic/
It's only a header file, definining format strings for basic system
types, hence it should be in src/basic/, not src/shared/.
Lennart Poettering [Sun, 25 Oct 2015 12:14:12 +0000 (13:14 +0100)]
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over.
Zbigniew Jędrzejewski-Szmek [Sun, 25 Oct 2015 04:14:51 +0000 (00:14 -0400)]
Merge pull request #1663 from poettering/journal-compress-fix
journal: fix error handling when compressing journal objects
Susant Sahani [Sun, 25 Oct 2015 03:55:54 +0000 (09:25 +0530)]
vxlan: fix assert
Susant Sahani [Sun, 25 Oct 2015 03:55:16 +0000 (09:25 +0530)]
veth: fix assert
Susant Sahani [Sun, 25 Oct 2015 03:54:59 +0000 (09:24 +0530)]
ipvlan: fix assert
Susant Sahani [Sun, 25 Oct 2015 03:54:31 +0000 (09:24 +0530)]
bond: fix assert
Susant Sahani [Sun, 25 Oct 2015 04:00:17 +0000 (09:30 +0530)]
vlan: fix assert
Evgeny Vereshchagin [Sat, 24 Oct 2015 22:49:46 +0000 (22:49 +0000)]
shell-completion: systemd-run: add the property ProtectSystem
Evgeny Vereshchagin [Sat, 24 Oct 2015 22:48:33 +0000 (22:48 +0000)]
run: can launch units with ProtectSystem
Lennart Poettering [Sat, 24 Oct 2015 21:57:23 +0000 (23:57 +0200)]
Merge pull request #1665 from evverx/unit-printf-fixes
core: various small fixes to unit-printf
Lennart Poettering [Sat, 24 Oct 2015 21:42:56 +0000 (23:42 +0200)]
sd-*.h: clean up exported (or to-be-exported) header files
Exported header files should not include internal headers. Fix that.
Exported header files should not use the bool type. So far we opted to
stick to C89 for exported headers, and hence use "int" for bools in
them. Continue to do so.
Exported header files should have #include lines for everything they use
including inttypes.h and sys/types.h, so that they may be included in
any order.
Exported header files should have C++ guards, hence add them.
Exported header files should not use gcc extensions like #pragma once,
get rid of it.
Lennart Poettering [Sat, 24 Oct 2015 21:30:40 +0000 (23:30 +0200)]
util: move logind_running() to login-util.[ch]
Evgeny Vereshchagin [Sat, 24 Oct 2015 20:55:56 +0000 (20:55 +0000)]
core: various small fixes to unit-printf
* check memory allocation errors in specifier_cgroup_slice
* %I doesn't fail for non-instantiated units (%i doesn't fail too)
* EOPNOTSUPP for consistency
Lennart Poettering [Sat, 24 Oct 2015 21:05:51 +0000 (23:05 +0200)]
man: let's enclose * in shell examples in ''
Technically, it's safer that way, since dnf is supposed to parse the
"*", not the shell. It doesn't really matter too much in real life (as
the expression is too complex), but let's better be safe than sorry, and
make sure people won't file bugs about this...
Lennart Poettering [Sat, 24 Oct 2015 20:58:24 +0000 (22:58 +0200)]
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files.
Lennart Poettering [Fri, 23 Oct 2015 16:52:53 +0000 (18:52 +0200)]
util: split out escaping code into escape.[ch]
This really deserves its own file, given how much code this is now.
Lennart Poettering [Fri, 23 Oct 2015 16:20:54 +0000 (18:20 +0200)]
util-lib: rework extract_first_word_and_warn() a bit
- Really warn in all error cases, not just some. We need to make sure
that all errors are logged to not confuse the user.
- Explicitly check for EINVAL error code before claiming anything about
invalid escapes, could be ENOMEM after all.
Lennart Poettering [Thu, 22 Oct 2015 18:12:31 +0000 (20:12 +0200)]
util: split out extract_first_word() and related calls into extract-word.[ch]
This is quite a lot of code these days, hence move it to its own source
file.
Lennart Poettering [Thu, 22 Oct 2015 17:54:29 +0000 (19:54 +0200)]
path-util: unify how we process paths specified on the command line
Let's introduce a common function that makes relative paths absolute and
warns about any errors while doing so.
Lennart Poettering [Thu, 22 Oct 2015 17:28:31 +0000 (19:28 +0200)]
util-lib: get_current_dir_name() can return errors other than ENOMEM
get_current_dir_name() can return a variety of errors, not just ENOMEM,
hence don't blindly turn its errors to ENOMEM, but return correct errors
in path_make_absolute_cwd().
This trickles down into a couple of other functions, some of which
receive unrelated minor fixes too with this commit.
Lennart Poettering [Thu, 22 Oct 2015 16:24:59 +0000 (18:24 +0200)]
path-util: rework find_binary(), fsck_exists() and mkfs_exists()
Modernize the code a bit:
- Get rid of FOREACH_WORD_SEPARATOR() loop in favour of a
extract_first_word() loop.
- Remove find_binary()'s "local" flag. It's not reasonably possible to
look for binaries on remote systems, we hence should not pretend we
could.
- When we cannot find a suitable binary, return the last error returned
from access() rather than ENOENT unconditionally.
- Rework fsck_exists() and mkfs_exists() to return 1 on success, 0 if
the implementation is missing and negative on real errors. This is
more like we do it in other functions.
- Make sure we also detect direct fsck symlinks to "true", rather than
just absolute ones to /bin/true.
Lennart Poettering [Sat, 24 Oct 2015 13:08:15 +0000 (15:08 +0200)]
journal: irrelevant coding style fixes
Lennart Poettering [Sat, 24 Oct 2015 12:58:51 +0000 (14:58 +0200)]
Merge pull request #1664 from again4you/devel/tmp-smack_#5
mount: add new SmackFileSystemRoot= setting for mount unit (v4)
Sangjung Woo [Wed, 21 Oct 2015 12:48:13 +0000 (21:48 +0900)]
units: add 'SmackFileSystemRoot=*' option into tmp.mount
If SMACK is enabled, 'smackfsroot=*' option should be specified when
/tmp is mounted since many non-root processes use /tmp for temporary
usage. If not, /tmp is labeled as '_' and smack denial occurs when
writing.
In order to do that, 'SmackFileSystemRoot=*' is newly added into
tmp.mount.
Sangjung Woo [Wed, 21 Oct 2015 08:42:34 +0000 (17:42 +0900)]
mount: add new SmackFileSystemRoot= setting for mount unit
This option specifies the label to assign the root of the file system if
it lacks the Smack extended attribute. Note that this option will be
ignored if kernel does not support the Smack feature by runtime
checking.
Lennart Poettering [Sat, 24 Oct 2015 11:17:54 +0000 (13:17 +0200)]
journal: fix error handling when compressing journal objects
Let's make sure we handle compression errors properly, and don't
misunderstand an error for success.
Also, let's actually compress things if lz4 is enabled.
Fixes #1662.
Lennart Poettering [Sat, 24 Oct 2015 10:17:41 +0000 (12:17 +0200)]
Merge pull request #1657 from phomes/tmpfiles-simplification
tmpfiles: simplify mountpoint detection
Lennart Poettering [Sat, 24 Oct 2015 09:52:52 +0000 (11:52 +0200)]
Merge pull request #1659 from vcaputo/journal_verify_envalid
journal: s/Envalid/Invalid/
Vito Caputo [Fri, 23 Oct 2015 23:12:31 +0000 (16:12 -0700)]
journal: s/Envalid/Invalid/
Thomas Hindoe Paaboel Andersen [Fri, 23 Oct 2015 18:15:17 +0000 (20:15 +0200)]
tmpfiles: simplify mountpoint detection
No functional change. Just a simplification. A || (!A && B) is
the same as A || B
Introduced in
78a92a5a2306709e4587e332728a76901323ade9
Lennart Poettering [Fri, 23 Oct 2015 15:42:24 +0000 (17:42 +0200)]
Merge pull request #1653 from keszybz/lz4-compress-time
Limit test-compress-benchmark to approx. 12 s of runtime
Zbigniew Jędrzejewski-Szmek [Sun, 18 Oct 2015 21:59:40 +0000 (17:59 -0400)]
test-compress-benchmark: properly initialize buffer
We were compressing unitialized memory, which should not result in
any problems, but is inelegant.
Zbigniew Jędrzejewski-Szmek [Sun, 18 Oct 2015 21:10:51 +0000 (17:10 -0400)]
test-compress-benchmark: limit default runtime to 2 seconds per subtest
If both lz4 and xz are enabled, this results in a limit of
2×3×2 s ~= 12 s runtime.
Previous implementation started with really small buffer sizes. When
combined with a short time limit this resulteded in abysmal results for xz.
It seems that the initialization overead is really significant for small
buffers. Since xz will not be used by default anymore, this does not
seem worth fixing. Instead buffer sizes are changed to run a
pseudo-random non-repeating pattern. This should allow reasonable testing
for all buffer sizes. For testing, both runtime and the buffer size seed
can be specified on the command line. Sufficiently large runtime allows
all buffer sizes up to 1MB to be tested.
Lennart Poettering [Fri, 23 Oct 2015 11:46:03 +0000 (13:46 +0200)]
Merge pull request #1652 from filbranden/extract1
util: Replace state with separate booleans in extract_first_word
Lennart Poettering [Fri, 23 Oct 2015 11:18:55 +0000 (13:18 +0200)]
Merge pull request #1647 from evverx/use-extract-in-namespace-parsing
core: use extract_first_word for namespace parsing
Lennart Poettering [Fri, 23 Oct 2015 10:47:07 +0000 (12:47 +0200)]
Merge pull request #1648 from evverx/clarify-journalctl-quiet-option
journalctl: clarify -q option
Daniel Mack [Fri, 23 Oct 2015 08:50:53 +0000 (10:50 +0200)]
Merge pull request #1641 from poettering/btrfs-quota
btrfs quota beef up and various other unrelated changes
Filipe Brandenburger [Fri, 23 Oct 2015 06:12:31 +0000 (23:12 -0700)]
util: Replace state with separate booleans in extract_first_word
This simplifies the logic and uniformizes the way single and double
quotes are handled. In the end, the code is about 40 lines shorter.
Tested by running the excellent test cases from test-util. Also
installed the systemd binaries including this patch and booted a
system with it, everything looked normal.
Evgeny Vereshchagin [Thu, 22 Oct 2015 23:18:17 +0000 (23:18 +0000)]
journalctl: clarify -q option
-q suppresses info messages too
Evgeny Vereshchagin [Thu, 22 Oct 2015 20:28:28 +0000 (20:28 +0000)]
core: use extract_first_word for namespace parsing
see https://github.com/systemd/systemd/pull/1632#issuecomment-
149903791
We should port this loop over to extract_first_word(), too.
Lennart Poettering [Thu, 22 Oct 2015 18:28:50 +0000 (20:28 +0200)]
Merge pull request #1646 from keszybz/man-dnf-install
dnf install command update
Zbigniew Jędrzejewski-Szmek [Thu, 22 Oct 2015 18:11:22 +0000 (14:11 -0400)]
man: also add --enablerepo=updates to dnf invocation
Without the updates repo, we are installing packages from the time
that that version of Fedora was released. Normally, during the
lifetime of the release most packages are updated, so most of the
packages installed would be outdated, and the first update after
installation would update a massive set of packages. Avoid all this
by installing from the updates repo from the start.