Chris Down
e92aaed30e
tree-wide: Remove O_CLOEXEC from fdopen
...
fdopen doesn't accept "e", it's ignored. Let's not mislead people into
believing that it actually sets O_CLOEXEC.
From `man 3 fdopen`:
> e (since glibc 2.7):
> Open the file with the O_CLOEXEC flag. See open(2) for more information. This flag is ignored for fdopen()
As mentioned by @jlebon in #11131 .
2018-12-12 20:47:40 +01:00
Lennart Poettering
8f3fd07ac0
Merge pull request #11105 from keszybz/path-parsing
...
Some tightening of our path parsing code
2018-12-10 15:50:08 +01:00
Lennart Poettering
2327f95499
Merge pull request #10984 from fbuihuu/tmpfiles-be-more-explicit-with-unsafe-transition
...
tmpfiles: be more explicit when an unsafe path transition is met
2018-12-10 12:31:56 +01:00
Lennart Poettering
ec68d13789
Merge pull request #10897 from keszybz/etc-fstab-parsing
...
Forbid dashes in hostnames and /etc/fstab parsing improvements
2018-12-10 12:31:30 +01:00
Zbigniew Jędrzejewski-Szmek
f8703ed7e5
basic/path-util: line-break PATH_FOREACH_PREFIX macros
...
Now I can see what they do :]
2018-12-10 11:57:26 +01:00
Zbigniew Jędrzejewski-Szmek
296acffe45
When parsing paths, reject anything above PATH_MAX
...
The check for length is done after path_simplify(), to be nice to paths which
are constructed using specifiers, and have duplicate slashes and stuff.
2018-12-10 11:57:26 +01:00
Zbigniew Jędrzejewski-Szmek
5fe7a0a7de
basic/hostname-util: do truncation last when cleaning up
...
This allows more of the original name to be used if there are invalid
chars in the beginning.
2018-12-10 09:56:56 +01:00
Zbigniew Jędrzejewski-Szmek
d65652f1f2
Partially unify hostname_is_valid() and dns_name_is_valid()
...
This makes hostname_is_valid() apply the ldh checks too, rejecting more
hostnames.
2018-12-10 09:56:56 +01:00
Franck Bui
145b8d0f68
fs-util: make CHASE_WARN effective with CHASE_NO_AUTOFS
...
This has the side effect to upgrade the log level at which the log is emitted
from debug to warning.
This might be better since after all we didn't apply a tmpfiles.d/ rule and
that actually might end up being problematic eventually.
2018-12-10 09:22:28 +01:00
Franck Bui
b85ee2ec95
fs-util: rename safe_transition() into unsafe_transition()
...
We're always interested into finding unsafe transitions so let's make the
helper return true when it finds such transitions so we don't need to negate
its results.
No functional changes.
2018-12-10 09:19:14 +01:00
Franck Bui
36c97decbe
fs-util: make chase_symlink() returns -ENOLINK when unsafe transitions are met
...
We previously returned -EPERM but it can be returned for various other reasons
too.
Let's use -ENOLINK instead as this value shouldn't be used currently. This
allows users of CHASE_SAFE to detect without any ambiguities when unsafe
transitions are encountered by chase_symlinks().
All current users of CHASE_SAFE that explicitly reacted on -EPERM have been
converted to react on -ENOLINK.
2018-12-10 09:18:27 +01:00
Lennart Poettering
be24321f3d
mount-point: honour AT_SYMLINK_FOLLOW correctly
...
Fixes : #11092
2018-12-08 22:43:55 +01:00
Yu Watanabe
5b139f86a6
missing: re-add drm related entries
...
This effectively reverts dab28f0905 .
Fixes #11075 .
2018-12-07 12:46:55 +01:00
Yu Watanabe
925fb1e1ec
missing: add ARPHRD_IP6GRE
...
This fixes TYPE field of networkctl's output for ip6gre devices.
2018-12-07 11:48:41 +09:00
Yu Watanabe
0b7d48f5f4
af-list,arphrd-list: also include relevant missing_*.h headers
2018-12-07 11:48:41 +09:00
Yu Watanabe
18bf324ab5
journal: use missing_audit.h to generate audit_type-list.txt
2018-12-07 11:48:37 +09:00
Yu Watanabe
54480d649f
cap-list: use missing_capabilty.h to generate list of capabilities
2018-12-07 11:31:22 +09:00
Yu Watanabe
e1eb35db1e
Merge pull request #11056 from poettering/resolved-ifindex
...
resolved: request incoming ifindex for DNS UDP packets, too
2018-12-06 19:29:42 +01:00
Zbigniew Jędrzejewski-Szmek
871fa294ff
Merge pull request #10935 from poettering/rlimit-nofile-safe
...
Merged by hand to resolve a trivial conflict in TODO.
2018-12-06 17:19:21 +01:00
Yu Watanabe
f0a43eb821
Merge pull request #11063 from yuwata/update-missing-v3
...
missing: split missing.h into small pieces
2018-12-06 16:54:27 +01:00
Paweł Szewczyk
6dce3bb401
fd-util: Fix error handling in safe_fclose
...
Function fclose_nointr returns negative value on error.
2018-12-06 16:15:39 +01:00
Yu Watanabe
ef118d00eb
util: drop missing.h from socket-util.h
2018-12-06 13:31:16 +01:00
Yu Watanabe
3c94e50486
util: drop missing.h from time-util.c
2018-12-06 13:31:16 +01:00
Yu Watanabe
503f480f8e
missing: move fs or mount related definitions to missing_fs.h
...
This also fixes errnous definition MS_REC -> MS_SLAVE.
2018-12-06 13:30:43 +01:00
Yu Watanabe
311c1a5d0a
missing: drop falloc related definitions
...
All these values are exposed earlier than linux-3.11.
Let's drop them.
2018-12-06 13:28:34 +01:00
Yu Watanabe
22332e339b
missing: move sched.h related definitions to missing_sched.h
2018-12-06 13:28:28 +01:00
Yu Watanabe
dab28f0905
missing: drop old drm related definitions
...
These values are exposed earlier than linux-3.11.
Let's use drm/drm.h.
2018-12-06 13:27:47 +01:00
Yu Watanabe
957c622b86
missing: drop BPF_XOR as we have linux/bpf_common.h
2018-12-06 13:27:23 +01:00
Yu Watanabe
fec6661efd
missing: drop DM_DEFERRED_REMOVE as we have dm-ioctl.h
2018-12-06 13:26:55 +01:00
Yu Watanabe
470f348b97
missing: move definition of secure_getenv() to missing_stdlib.h
2018-12-06 13:26:55 +01:00
Yu Watanabe
b19bb11142
missing: move rand related definitions to missing_random.h
2018-12-06 13:26:55 +01:00
Yu Watanabe
5ee668d2d1
missing: drop TIOCVHANGUP
...
This is defined before linux-3.11. Also, its value depnends on
architecture. So, it is not good to define in this form.
2018-12-06 13:26:48 +01:00
Yu Watanabe
c8a363eb15
missing: add memfd related definitions to missing_mman.h
2018-12-06 13:25:24 +01:00
Yu Watanabe
d7330b60a9
missing: move timer related definition to missing_timerfd.h
2018-12-06 13:25:24 +01:00
Yu Watanabe
66ffbdf933
missing: move socket related definitions to missing_socket.h
2018-12-06 13:25:24 +01:00
Yu Watanabe
dea72eda9c
missing: move fcntl related definitions to missing_fcntl.h
2018-12-06 13:25:24 +01:00
Yu Watanabe
6c76de27ee
missing: move resource related definitions to missing_resource.h
2018-12-06 13:25:24 +01:00
Yu Watanabe
0e7117d001
missing: move audit related definitions to missing_audit.h
2018-12-06 13:25:24 +01:00
Yu Watanabe
851d66fac2
missing: move syscall related definitions to missing_syscall.h
2018-12-06 13:25:24 +01:00
Yu Watanabe
bd0937ddb3
random-util: drop duplicated linux/random.h
2018-12-06 13:25:24 +01:00
Yu Watanabe
49f6103375
missing: drop old OOM related definitions
...
These are exposed earlier than linux-3.11. Let's just include linux/oom.h.
2018-12-06 13:24:37 +01:00
Yu Watanabe
8f8495702e
missing: move one more network related definition to missing_network.h
2018-12-06 13:24:32 +01:00
Yu Watanabe
9cb6c6ecb0
missing: use integer types used by kernel
...
By using them, we can decrease included headers except linux/types.h.
2018-12-06 13:24:00 +01:00
Yu Watanabe
666a84eaca
macro: include errno.h
...
As several macros touch errno.
2018-12-06 07:01:29 +01:00
Yu Watanabe
ec3f6df9cf
missing: move several network related entries to missing_network.h
2018-12-06 02:38:59 +01:00
Lennart Poettering
ec4b9671b3
resolvectl: color "comment" output grey
...
Let's de-emphasize the "comment" output a bit, by making it grey.
2018-12-05 18:46:23 +01:00
Lennart Poettering
085b39e9df
socket-util: Let's trick out ubsan when it validate struct sockaddr_un.sun_path[]
...
Linux is stupid and sometimes returns a "struct sockaddr_un" that is
longer than its fields, as it NUL terminates .sun_path[] even if it has
full length. ubsan detects this, rightfully. Since this is a Linux
misdesign let's trick out ubsan a bit.
Fixes : #11024
2018-12-04 23:28:14 +01:00
Lennart Poettering
836f9cfebd
socket-util: break lines in sockaddr_pretty() signature
...
It's soo long, let's make this more readable.
2018-12-04 23:28:14 +01:00
Lennart Poettering
994b9d4e90
socket-util: shorten code a bit
2018-12-04 23:28:14 +01:00
Lennart Poettering
ee589a1882
Merge pull request #11041 from yuwata/update-missing-v2
...
missing: separate missing.h more
2018-12-04 16:19:02 +01:00