summaryrefslogtreecommitdiff
path: root/src/basic/missing.h
Commit message (Collapse)AuthorAge
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-08-24
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-08-24
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* missing: define kernel internal limit TASK_COMM_LEN in userspace tooLennart Poettering2018-08-24
| | | | | We already use it at two places, and we are about to add one too. Arbitrary literally hardcoded limits suck.
* tree-wide: remove some double newlines in headers, tooLennart Poettering2018-08-24
|
* missing: add IPV4_MIN_MTULennart Poettering2018-08-24
| | | | Similar to IPV6_MIN_MTU, let's add the same for IPv4.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* xattr-util: use crtime/btime if statx() is available for implementation of ↵Lennart Poettering2018-05-30
| | | | | | | | | | | | | | fd_setcrtime() and friends The Linux kernel exposes the birth time now for files through statx() hence make use of it where available. We keep the xattr logic in place for this however, since only a subset of file systems on Linux currently expose the birth time. NFS and tmpfs for example do not support it. OTOH there are other file systems that do support the birth time but might not support xattrs (smb…), hence make the best of the two, in particular in order to deal with journal files copied between file system types and to maintain compatibility with older file systems that are updated to newer version of the file system.
* process-util: be more careful in is_kernel_thread()Lennart Poettering2018-05-30
| | | | | | | | | | | | This reworks is_kernel_thread() a bit. Instead of checking whether /proc/$pid/cmdline is entirely empty we now parse the 'flags' field from /proc/$pid/stat and check the PF_KTHREAD flag, which directly encodes whether something is a kernel thread. Why all this? With current kernels userspace processes can set their command line to empty too (through PR_SET_MM_ARG_START and friends), and could potentially confuse us. Hence, let's use a more reliable way to detect kernels like this.
* fs-util: add new unlinkat_deallocate() helperLennart Poettering2018-05-30
| | | | | | | | | This new helper not only removes a file from a directory but also ensures its space on disk is deallocated, by either punching a hole over the full file or truncating the file afterwards if the file's link counter is 0. This is useful in "vacuuming" algorithms to ensure that client's can't keep the disk space the vacuuming is supposed to recover pinned simply by keeping an fd open to it.
* journal: move code that checks for network fs to stat-util.[ch]Lennart Poettering2018-05-30
| | | | | We have similar code in stat-util.[ch] and managing this at a central place almost definitely is the better choice.
* kernel 3.10 compat: RTAX_QUICKACK not added until 3.11.0 (#8094)MilhouseVH2018-05-30
|
* fs-util: add new unlinkat_deallocate() helperLennart Poettering2018-05-30
| | | | | | | | | | | This new helper not only removes a file from a directory but also ensures its space on disk is deallocated, by either punching a hole over the full file or truncating the file afterwards if the file's link counter is 0. This is useful in "vacuuming" algorithms to ensure that client's can't keep the disk space the vacuuming is supposed to recover pinned simply by keeping an fd open to it. (cherry picked from commit 43767d9d5e0ce8923828aebf9154da7af83916f7)
* journal: move code that checks for network fs to stat-util.[ch]Lennart Poettering2018-05-30
| | | | | | | We have similar code in stat-util.[ch] and managing this at a central place almost definitely is the better choice. (cherry picked from commit 77f9fa3b8ea46c27e5a5e9270f71bf1b4000c3e0)
* kernel 3.10 compat: RTAX_QUICKACK not added until 3.11.0 (#8094)MilhouseVH2018-05-30
| | | | (cherry picked from commit ec79af69a1d159a43deb68c9ec1c31fe89743b6f)
* socket-util: add new getpeergroups() callLennart Poettering2018-05-30
| | | | | It's a wrapper around the new SO_PEERGROUPS sockopt, similar in style as getpeersec() and getpeercred().
* networkd: Add support for ipvlan L3s and flags (#7726)Susant Sahani2018-05-30
| | | | | This works supports to configure L3S mode and flags such as bridge, private and vepa
* missing: Add DM_DEFERRED_REMOVEHenrik Grindal Bakken2018-05-30
| | | | Also include missing.h in dissect-image.c to pick it up.
* missing: Define SMACK_MAGIC if it's missingHenrik Grindal Bakken2018-05-30
|
* missing: Define EFIVARFS_MAGIC if missingHenrik Grindal Bakken2018-05-30
|
* missing: Add MAX_HANDLE_SZHenrik Grindal Bakken2018-05-30
|
* missing: Add PR_SET_MM_{ARG,ENV}_{START,END}Henrik Grindal Bakken2018-05-30
|
* missing: Add some more btrfs structs and constantsHenrik Grindal Bakken2018-05-30
|
* Prep v236 : Add missing SPDX-License-Identifier (2/9) src/basicSven Eden2018-03-26
|
* Add elogind-growfs toolZbigniew Jędrzejewski-Szmek2017-10-23
|
* networkd: introduce vxcan netdev. (#7150)Susant Sahani2017-11-22
| | | | | | | | Similar to the virtual ethernet driver veth, vxcan implements a local CAN traffic tunnel between two virtual CAN network devices. When creating a vxcan, two vxcan devices are created as pair When one end receives the packet it appears on its pair and vice versa. The vxcan can be used for cross namespace communication.
* Prep v237.3: Make all supportable API functions visibleSven Eden2017-12-12
| | | | (v233 addition).
* build-sys: use #if Y instead of #ifdef Y everywhereZbigniew Jędrzejewski-Szmek2017-11-23
| | | | | | | | | | | | | | | The advantage is that is the name is mispellt, cpp will warn us. $ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/" $ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;' $ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g' $ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g' + manual changes to meson.build squash! build-sys: use #if Y instead of #ifdef Y everywhere v2: - fix incorrect setting of HAVE_LIBIDN2
* build-sys: change all HAVE_DECL_ macros to HAVE_Zbigniew Jędrzejewski-Szmek2017-11-22
| | | | | | | This is a legacy of autotools, where one detection routine used a different prefix then the others. $ git grep -e HAVE_DECL_ -l|xargs sed -i s/HAVE_DECL_/HAVE_/g
* core: add new per-unit setting KeyringMode= for controlling kernel keyring setupLennart Poettering2017-09-14
| | | | | | | | | | | | | | | Usually, it's a good thing that we isolate the kernel session keyring for the various services and disconnect them from the user keyring. However, in case of the cryptsetup key caching we actually want that multiple instances of the cryptsetup service can share the keys in the root user's user keyring, hence we need to be able to disable this logic for them. This adds KeyringMode=inherit|private|shared: inherit: don't do any keyring magic (this is the default in elogind --user) private: a private keyring as before (default in elogind --system) shared: the new setting
* networkd: add support to configure IP Rule (#5725)Susant Sahani2017-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Routing Policy rule manipulates rules in the routing policy database control the route selection algorithm. This work supports to configure Rule ``` [RoutingPolicyRule] TypeOfService=0x08 Table=7 From= 192.168.100.18 ``` ``` ip rule show 0: from all lookup local 0: from 192.168.100.18 tos 0x08 lookup 7 ``` V2 changes: 1. Added logic to handle duplicate rules. 2. If rules are changed or deleted and networkd restarted then those are deleted when networkd restarts next time V3: 1. Add parse_fwmark_fwmask
* basic: ensure O_TMPFILE is always defined (#6816)Davide Cavalca2017-09-14
|
* Revert "core: link user keyring to session keyring (#6275)" (#6342)Lennart Poettering2017-07-25
| | | | | | | This reverts commit 437a85112e02042b62751395b9e7225628c1b708. The outcome of this isn't that clear, let's revert this for now, see discussion on #6286.
* udev: move the KEY_* defines to missing.h (#6278)Peter Hutterer2017-07-25
|
* core: link user keyring to session keyring (#6275)Christian Hesse2017-07-25
| | | | | | | | | | Commit 74dd6b515fa968c5710b396a7664cac335e25ca8 (core: run each system service with a fresh session keyring) broke adding keys to user keyring. Added keys could not be accessed with error message: keyctl_read_alloc: Permission denied So link the user keyring to our session keyring.
* logind: make use of EVIOCSMASK input ioctl to mask out events we aren't ↵Lennart Poettering2017-07-25
| | | | | | | | | | | | | | | interested in This way logind will get woken up only when an actual event took place, and not for every key press on the system. The ioctl EVIOCSMASK was added by @dvdhrm already in October 2015, for the use in logind, among others, hence let's actually make use of it now. While we are at it, also fix usage of the EVIOCGSW ioctl, where we assumed a byte array, even though a unsigned long native endian array is returned.
* Add Geneve netlink properties to missing.hSusant Sahani2017-07-25
|
* basic/missing.h: drop inclusion of macro.hZbigniew Jędrzejewski-Szmek2017-07-25
| | | | It's not necessary for anything.
* missing.h: add vxlan netlink propertiesSusant Sahani2017-07-25
|
* Prep v233.2: Mask unneeded functions and definitions in src/basicSven Eden2017-07-18
|
* Prep v233: Unmask now needed functions in src/basicSven Eden2017-07-17
|
* missing.h: add AF_VSOCK bitsStefan Hajnoczi2017-07-17
| | | | | | | | | | Ubuntu 14.04 (Trusty) kernel header packages ship without <linux/vm_sockets.h>. Only struct sockaddr_vm and VMADDR_CID_ANY will be needed by elogind and they are simple enough to go in missing.h. CentOS 7 <sys/socket.h> does not define AF_VSOCK. Define it so the code can compile although actual socket(2) calls may fail at runtime if the address family isn't available.
* core: run each system service with a fresh session keyringLennart Poettering2017-07-17
| | | | | | | | | | | | | | | | | This patch ensures that each system service gets its own session kernel keyring automatically, and implicitly. Without this a keyring is allocated for it on-demand, but is then linked with the user's kernel keyring, which is OK behaviour for logged in users, but not so much for system services. With this change each service gets a session keyring that is specific to the service and ceases to exist when the service is shut down. The session keyring is not linked up with the user keyring and keys hence only search within the session boundaries by default. (This is useful in a later commit to store per-service material in the keyring, for example the invocation ID) (With input from David Howells)
* nspawn: support ephemeral boots from imagesLennart Poettering2017-07-17
| | | | | | | | | | | Previously --ephemeral was only supported with container trees in btrfs subvolumes (i.e. in combination with --directory=). This adds support for --ephemeral in conjunction with disk images (i.e. --image=) too. As side effect this fixes that --ephemeral was accepted but ignored when using -M on a container that turned out to be an image. Fixes: #4664
* core: add "khash" API to src/basic/ (as wrapper around kernel AF_ALG)Lennart Poettering2017-07-17
| | | | | | | | | | | | | | | | | Let's take inspiration from bluez's ELL library, and let's move our cryptographic primitives away from libgcrypt and towards the kernel's AF_ALG cryptographic userspace API. In the long run we should try to remove the dependency on libgcrypt, in favour of using only the kernel's own primitives, however this is unlikely to happen anytime soon, as the kernel does not provide Elliptic Curve APIs to userspace at this time, and we need them for the DNSSEC cryptographic. This commit only covers hashing for now, symmetric encryption/decryption or even asymetric encryption/decryption is not available for now. "khash" is little more than a lightweight wrapper around the kernel's AF_ALG socket API.
* Link: port to new ethtool ETHTOOL_xLINKSETTINGSSusant Sahani2017-07-17
| | | | | | | | | | | | | | Link: port to new ethtool ETHTOOL_xLINKSETTINGS This patch defines a new ETHTOOL_GLINKSETTINGS/SLINKSETTINGS API, handled by the new get_link_ksettings/set_link_ksettings . This is a WIP version based on this [kernel patch](https://patchwork.kernel.org/patch/8411401/). commit 0527f1c http://github.com/torvalds/linux/commit/3f1ac7a700d039c61d8d8b99f28d605d489a60cfommit 35afb33
* missing: add a bunch of mount flagsZbigniew Jędrzejewski-Szmek2017-07-05
|
* networkd: address add support to configure flags (#4201)Susant Sahani2017-07-05
| | | | | | | | | | This patch enables to configure IFA_F_HOMEADDRESS IFA_F_NODAD IFA_F_MANAGETEMPADDR IFA_F_NOPREFIXROUTE IFA_F_MCAUTOJOIN
* missing.h: add missing definitions for __O_TMPFILEYann E. MORIN2017-07-05
| | | | | | | | | | | | | | | | | | | Currently, a missing __O_TMPFILE was only defined for i386 and x86_64, leaving any other architectures with an "old" toolchain fail miserably at build time: src/import/export-raw.c: In function 'reflink_snapshot': src/import/export-raw.c:271:26: error: 'O_TMPFILE' undeclared (first use in this function) new_fd = open(d, O_TMPFILE|O_CLOEXEC|O_NOCTTY|O_RDWR, 0600); ^ __O_TMPFILE (and O_TMPFILE) are available since glibc 2.19. However, a lot of existing toolchains are still using glibc-2.18, and some even before that, and it is not really possible to update those toolchains. Instead of defining it only for i386 and x86_64, define __O_TMPFILE with the specific values for those archs where it is different from the generic value. Use the values as found in the Linux kernel (v4.8-rc3, current as of time of commit).
* cgroup: detect cgroup namespacesChristian Brauner2017-07-05
| | | | | - define CLONE_NEWCGROUP - add fun to detect whether cgroup namespaces are supported
* Prep v231.2: Apply some minor style fixesSven Eden2017-06-19
|