summaryrefslogtreecommitdiff
path: root/src/basic/socket-util.c
Commit message (Collapse)AuthorAge
* basic/path-util: allow flags for path_equal_or_files_sameZbigniew Jędrzejewski-Szmek2017-07-25
| | | | | No functional change, just a new parameters and the tests that AT_SYMLINK_NOFOLLOW works as expected.
* Make IDN support conditionalWaldemar Brodkorb2017-07-25
| | | | [zj: rename HAVE_IDN to ENABLE_IDN]
* Prep v233.2: Mask unneeded functions and definitions in src/basicSven Eden2017-07-18
|
* socket-util: introduce address_label_validSusant Sahani2017-07-17
|
* fs-util: unify code we use to check if dirent's d_name is "." or ".."Lennart Poettering2017-07-17
| | | | | We use different idioms at different places. Let's replace this is the one true new idiom, that is even a bit faster...
* socket-utils: revert f1811313f42dc7ddaed3c47edc834c2bfd1309b2Susant Sahani2017-07-17
| | | | ':' in not a a valid interface name.
* network: accept colons in network interface names, normally used for alias ↵peoronoob2017-07-17
| | | | interfaces (#5117)
* socket-util: add AF_VSOCK address familyStefan Hajnoczi2017-07-17
| | | | | | | | The AF_VSOCK address family facilitates guest<->host communication on VMware and KVM (virtio-vsock). Adding support to elogind allows guest agents to be launched through .socket unit files. Today guest agents are stand-alone daemons running inside guests that do not take advantage of elogind socket activation.
* socket-util: introduce port argument in sockaddr_port()Stefan Hajnoczi2017-07-17
| | | | | | | | sockaddr_port() either returns a >= 0 port number or a negative errno. This works for AF_INET and AF_INET6 because port ranges are only 16-bit. In AF_VSOCK ports are 32-bit so an int cannot represent all port number and negative errnos. Separate the port and the return code.
* Rename formats-util.h to format-util.hZbigniew Jędrzejewski-Szmek2017-07-17
| | | | | | We don't have plural in the name of any other -util files and this inconsistency trips me up every time I try to type this file name from memory. "formats-util" is even hard to pronounce.
* Prep v232.2: Mask more unneeded functionsSven Eden2017-07-07
|
* sd-device/networkd: unify code to get a socket for issuing netdev ioctls onLennart Poettering2017-07-05
| | | | | | | | | | | As suggested here: https://github.com/elogind/elogind/pull/4296#issuecomment-251911349 Let's try AF_INET first as socket, but let's fall back to AF_NETLINK, so that we can use a protocol-independent socket here if possible. This has the benefit that our code will still work even if AF_INET/AF_INET6 is made unavailable (for exmple via seccomp), at least on current kernels.
* basic: fix for IPv6 status (#4224)Susant Sahani2017-07-05
| | | | | | | | | | | | | | | | | | | | | | Even if ``` cat /proc/sys/net/ipv6/conf/all/disable_ipv6 1 ``` is disabled cat /proc/net/sockstat6 ``` TCP6: inuse 2 UDP6: inuse 1 UDPLITE6: inuse 0 RAW6: inuse 0 FRAG6: inuse 0 memory 0 ``` Looking for /proc/net/if_inet6 is the right choice.
* core: add a concept of "dynamic" user ids, that are allocated as long as a ↵Lennart Poettering2017-07-05
| | | | | | | | | | | | | | | | | | | service is running This adds a new boolean setting DynamicUser= to service files. If set, a new user will be allocated dynamically when the unit is started, and released when it is stopped. The user ID is allocated from the range 61184..65519. The user will not be added to /etc/passwd (but an NSS module to be added later should make it show up in getent passwd). For now, care should be taken that the service writes no files to disk, since this might result in files owned by UIDs that might get assigned dynamically to a different service later on. Later patches will tighten sandboxing in order to ensure that this cannot happen, except for a few selected directories. A simple way to test this is: elogind-run -p DynamicUser=1 /bin/sleep 99999
* socket-util: Run the fallback when the kernel complains about the null ↵Kai Ruhnau2017-06-16
| | | | | | | | | | | buffer (#3541) Calling recv with a NULL buffer returns EFAULT instead of EOPNOTSUPP on older kernels (3.14). Fixes #3407 Signed-off-by: Kai Ruhnau <kai.ruhnau@target-sg.com>
* tree-wide: htonl() is weird, let's use htobe32() instead (#3538)Lennart Poettering2017-06-16
| | | | Super-important change, yeah!
* Prep v230: Apply missing upstream fixes and updates (2/8) src/basic.Sven Eden2017-06-16
|
* Prep v229: Add missing fixes from upstream [1/6] src/basicSven Eden2017-05-17
|
* coredump: rework coredumping logicLennart Poettering2017-05-17
| | | | | | | | | | | | | | | | This reworks the coredumping logic so that the coredump handler invoked from the kernel only collects runtime data about the crashed process, and then submits it for processing to a socket-activate coredump service, which extracts a stacktrace and writes the coredump to disk. This has a number of benefits: the disk IO and stack trace generation may take a substantial amount of resources, and hence should better be managed by PID 1, so that resource management applies. This patch uses RuntimeMaxSec=, Nice=, OOMScoreAdjust= and various sandboxing settings to ensure that the coredump handler doesn't take away unbounded resources from normally priorized processes. This logic is also nice since this makes sure the coredump processing and storage is delayed correctly until /var/elogind/coredump is mounted and writable. Fixes: #2286
* journal: unbreak sd_journal_sendvZbigniew Jędrzejewski-Szmek2017-05-17
| | | | | | | | | | | | Borked since commit 3ee897d6c2401effbc82f5eef35fce405781d6c8 Author: Lennart Poettering <lennart@poettering.net> Date: Wed Sep 23 01:00:04 2015 +0200 tree-wide: port more code to use send_one_fd() and receive_one_fd() because here our fd is not connected and we need to specify the address.
* basic: re-sort includesThomas Hindoe Paaboel Andersen2017-05-17
| | | | | My previous patch to only include what we use accidentially placed the added inlcudes in non-sorted order.
* journal-remote: split-mode=host, remove port from journal filenameKlearchos Chaloulos2017-05-17
| | | | | When constructing the journal filename to store logs from a remote host, remove the port of the tcp connection, as the port will change with every reboot/connection loss between sender/reveiver machines. Having the port in the filename will cause a new journal file to be created for every reboot or connection loss. For the implementation, a new argument "bool include_port" is added to the getpeername_pretty() function. This is passed to the sockaddr_pretty() function. The value of the include_port argument is set to true in all calls of getpeername_pretty(), except for 2 calls in journal-remote.c, where it is set to false.
* basic: include only what we useThomas Hindoe Paaboel Andersen2017-05-17
| | | | | This is a cleaned up result of running iwyu but without forward declarations on src/basic.
* Prep v228: Condense elogind source masks (3/5)Sven Eden2017-04-26
|
* Prep v228: Clean up the new src/basic/*-util-[hc] files:Sven Eden2017-04-26
| | | | | | | | | | | | | - src/basic/capability-util.[hc] - src/basic/cgroup-util.[hc] - src/basic/fd-util.[hc] - src/basic/fs-util.[hc] - src/basic/memfd-util.[hc] - src/basic/path-util.[hc] - src/basic/socket-util.[hc] - src/basic/terminal-util.[hc] - src/basic/user-util.[hc] - src/basic/xattr-util.[hc]
* Prep v228: Add remaining updates from upstream (1/3)Sven Eden2017-04-26
The util.[hc] files have been stripped of a lot of functions, that got sorted into various new files representing the type of utility. This commit adds the missing files.