summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* generators: rename add_{root,usr}_mount to add_{sysroot,sysroot_usr}_mountZbigniew Jędrzejewski-Szmek2017-03-14
| | | | | | | | | | | | This makes it obvious that those functions are only usable in the initramfs. Also, add a warning when noauto, nofail, or automount is used for the root fs, instead of silently ignoring. Using those options would be a sign of significant misconfiguration, and if we bother to check for them, than let's go all the way and complain. Other various small cleanups and reformattings elsewhere.
* core: rework unit name validation and manipulation logicLennart Poettering2017-03-14
| | | | | | | | | | | | | | | A variety of changes: - Make sure all our calls distuingish OOM from other errors if OOM is not the only error possible. - Be much stricter when parsing escaped paths, do not accept trailing or leading escaped slashes. - Change unit validation to take a bit mask for allowing plain names, instance names or template names or an combination thereof. - Refuse manipulating invalid unit name
* util: be a bit safer in path_is_safe()Lennart Poettering2017-03-14
| | | | | | We should be more strict when verifying paths with path_is_safe() for potentially dangerous constructs, and that includes lengths of PATH_MAX-1 and larger. Be more accurate here.
* core: catch some special cases in cg_slice_to_path()Lennart Poettering2017-03-14
|
* sym: adding missing symbols to .sym fileLennart Poettering2017-03-14
|
* sd-bus,sd-login: add api for querying the slice within the the user systemd ↵Lennart Poettering2017-03-14
| | | | | | | instance of a process units are organized in slice trees, not only for the system instance, but also for user systemd instances, expose this properly.
* sd-bus: when we get ENOTTY on the HELLO ioctl assume incompatible API versionLennart Poettering2017-03-14
| | | | As perparation for future incompatible kdbus kernel API changes.
* core: rework cgroup path parse logicLennart Poettering2017-03-14
| | | | | | | Various cleanups, be stricter when parsing unit paths. Most importantly: return the root slice "-.slice" when asked for slice of paths that contain no slice component.
* sd-bus: properly handle creds that are known but undefined for a processLennart Poettering2017-03-14
| | | | | | | | | | | | | | | A number of fields do not apply to all processes, including: there a processes without a controlling tty, without parent process, without service, user services or session. To distuingish these cases from the case where we simply don't have the data, always return ENXIO for them, while returning ENODATA for the case where we really lack the information. Also update the credentials dumping code to show this properly. Fields that are known but do not apply are now shown as "n/a". Note that this also changes some of the calls in process-util.c and cgroup-util.c to return ENXIO for these cases.
* sd-bus: allow passing NULL as bus parameter to sd_bus_send()Lennart Poettering2017-03-14
| | | | | | | | If NULL is specified for the bus it is now automatically derived from the passed in message. This commit also changes a number of invocations of sd_bus_send() to make use of this.
* sd-bus: drop bus parameter from message callback prototypeLennart Poettering2017-03-14
| | | | | | This should simplify the prototype a bit. The bus parameter is redundant in most cases, and in the few where it matters it can be derived from the message via sd_bus_message_get_bus().
* bus-util: drop redundant bus argument from bus_message_map_all_properties() ↵Lennart Poettering2017-03-14
| | | | and related calls
* exit-status: introduce common exit_status_set_test() call for testing exit ↵Lennart Poettering2017-03-14
| | | | status set membership
* bus-util: print correct warnings for units that fail but for which we have a ↵Lennart Poettering2017-03-14
| | | | NULL result only
* path-util: fix fstat fallback in fd_is_mount_pointThomas Hindoe Paaboel Andersen2017-03-14
|
* sd-device: don't retry loading uevent/db files more than onceTom Gundersen2017-03-14
| | | | If for whatever reason there was nothing to load or loading failed, don't keep trying.
* sd-device: don't complain if the uevent file is missingTom Gundersen2017-03-14
| | | | Only 'real' devices are required to have an uevent file.
* logind: kill newline characters from log_error_errno() callsDaniel Mack2017-03-14
| | | | log_error_errno() already adds a newline, so drop them.
* sysctl: minor simplificationsLennart Poettering2017-03-14
|
* sd-bus: add controlling tty field to sd_creds objectLennart Poettering2017-03-14
| | | | | This is useful to print wall messages from logind with the right client tty. (to be added in a later patch)
* shutdownd: kill the old implementationDaniel Mack2017-03-14
| | | | | | Not that all functionality has been ported over to logind, the old implementation can be removed. There goes one of the oldest parts of the systemd code base.
* logind: add support for /run/nologin and /run/systemd/shutdown/scheduledDaniel Mack2017-03-14
| | | | | | Port over more code from shutdownd and teach logind to write /run/nologin at least 5 minutes before the system is going down, and /run/systemd/shutdown/scheduled when a shutdown is scheduled.
* sd-bus: when bus operations are to be executed on direct connections always failLennart Poettering2017-03-14
| | | | | Also, don't consider this an loggable event, so that code that tries to read creds from a direct connection, doesn't generate logs.
* udevd: fix REMOVE handlingTom Gundersen2017-03-14
| | | | | | | | This reverts b67f944. Lazy loading of device properties does not work for devices that are received over netlink, as these are sealed. Reinstate the unconditional loading of the device db. Reported by: Mantas Mikulėnas <grawity@gmail.com>.
* sd-bus: don't inherit connection creds into message creds when we have a ↵Lennart Poettering2017-03-14
| | | | | | | direct connection It's never a good idea, let's just not do it, not even on dierct connections.
* path-util: make use of "mnt_id" field exported in /proc/self/fdinfo/<fd> to ↵Lennart Poettering2017-03-14
| | | | | | | test for mount points It's a very recent kernel addition, but certainly makes sense to support.
* core: explicitly specify credentials for direct connections, tooLennart Poettering2017-03-14
| | | | | | So far we authenticate direct connections primarily at connection time, but let's also do this for each method individually, by attaching the creds we need for that right away.
* journalctl: rework code that checks whether we have access to /var/log/journalLennart Poettering2017-03-14
| | | | | | | | - fix some memory leaks on error conditions - handle all error cases properly, and log about failures - move HAVE_ACL and no-HAVE_ACL code closer to each other
* libudev-device: fix lazy loading of devlinks, properties and tagsTom Gundersen2017-03-14
| | | | | If the underlying device has not read in the properties yet, the generation will be 0, so make sure we trigger the reading at least once.
* logind: add code for UTMP wall messagesDaniel Mack2017-03-14
| | | | | | | | | | | | | | Add a timer to print UTMP wall messages so that it repeatedly informs users about a scheduled shutdown: * every 1 minute with less than 10 minutes to go * every 15 minutes with less than 60 minutes to go * every 30 minutes with less than 180 minutes (3 hours) to go * every 60 minutes if more than that to go This functionality only active if the .EnableWallMessages DBus property is set to true. Also, a custom string can be added to the wall message, set through the WallMessagePrefix property.
* btrfs-util: support recursive removal of read-only subvolumesLennart Poettering2017-03-14
| | | | | When deleting a read-only subsvolume with a sub-subvolume, we need to mark it writable first, otherwise the removal will not work.
* btrfs-util: fix creating recursive read-only snapshotsLennart Poettering2017-03-14
| | | | | | When creating recursive read-only snapshots we need to mark the snapshot writable immediately before creating subsnapshots within it, otherwise the operation for it will fail.
* sd-bus: handle ppid=0 more gracefully (which happens for pid=1)Lennart Poettering2017-03-14
|
* btrfs-util: be more careful when invoking btrfs file system ioctlsLennart Poettering2017-03-14
| | | | | | | | | | | If we get passed an fd that does not refer to a regular file or directory, we should not issue btrfs ioctls on it, since it might end up in a device driver or similar (note that DRM for example uses the same ioctl numbers as some file system ioctls). Hence, let's make sure to always check if something is a regular file or directory, or is on btrfs before invoking the respective ioctls. It's better to be safe than sorry.
* btrfs-util: introduce btrfs_is_filesystem() and make use of it where appropriateLennart Poettering2017-03-14
| | | | | | | Let's unify the code that checks whether an fd is on btrfs a bit. (Also, rename btrfs_is_snapshot() to btrfs_is_subvol(), since that's usually how this is referred to in our code)
* util: make sure fd refers to regular file or directory when applying file ↵Lennart Poettering2017-03-14
| | | | | | | | | | attributes Before invoking file system ioctls we need to make sure that the specified fd actually refers to a file system object, and not a device node or similar. Otherwise we might by accident invoke unrelated device driver ioctls. For example, DRM ioctls use the same ioctl numbers as the various file system ioctls.
* networkd: introduce vti6 tunnelSusant Sahani2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch add support to create vti6 tunnel test: vt6.network [Match] Name=wlan0 [Network] Tunnel=ip6vti vti6.netdev [NetDev] Name=ip6vti Kind=vti6 [Tunnel] Local=2a00:ffde:4567:edde::4987 Remote=2001:473:fece:cafe::5179 ip link 11: ip6_vti0@NONE: <NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default link/tunnel6 :: brd :: 12: ip6vti@wlan0: <POINTOPOINT,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default link/tunnel6 2a00:ffde:4567:edde::4987 peer 2001:473:fece:cafe::5179
* sd-bus: expose ppid fieldLennart Poettering2017-03-14
| | | | | kdbus has been passing us the ppid file for a while, actually make use of it.
* core: make unit deserialization more defensiveLennart Poettering2017-03-14
|
* tree-wide: get rid of more strerror() callsLennart Poettering2017-03-14
|
* tmpfiles: make /home and /var btrfs subvolumes by default when booted up ↵Lennart Poettering2017-03-14
| | | | | | | with them missing This way the root subvolume can be left read-only easily, and variable and user data writable with explicit quota set.
* tmpfiles: there's no systemd-forbid-user-logins.service serviceLennart Poettering2017-03-14
|
* log: move log_syntax() into src/shared/log.c, and make it more similar to ↵Lennart Poettering2017-03-14
| | | | the other log functions
* sd-device: set_syspath - return ENODEV when passed something that is not a ↵Tom Gundersen2017-03-14
| | | | device
* sd-bus: when augmenting creds, remember which ones were augmentedLennart Poettering2017-03-14
| | | | | Also, when we do permissions checks using creds, verify that we don't do so based on augmented creds, as extra safety check.
* sd-bus: augmenting cgroups-based creds when we have the cgroup path already ↵Lennart Poettering2017-03-14
| | | | is free
* sd-bus: when augmenting creds, don't override any creds in any caseLennart Poettering2017-03-14
| | | | Let's better be safe than sorry.
* sd-bus: when copying creds objects, make sure we copy even the implicit well ↵Lennart Poettering2017-03-14
| | | | known names
* logind: add .ScheduleShutdown and .CancelScheduledShutdown methodsDaniel Mack2017-03-14
| | | | | | | | | | | | | | | | | | | Add a method called ScheduleShutdown in org.freedesktop.login1.Manager which adds a timer to shut down the system at a later point in time. The first argument holds the type of the schedule that is about to happen, and must be one of 'reboot', 'halt' or 'poweroff'. The second argument specifies the absolute time, based on CLOCK_REALTIME in nanoseconds, at which the the operation should be executed. To cancel a previously scheduled shutdown, the CancelScheduledShutdown() can be called, which returns a bool, indicating whether a scheduled timeout was cancelled. Also add a new property called ScheduledShutdown which returns the equivalent to what was passed in via ScheduleShutdown, as '(st)' type.
* logind: factor out polkit checksDaniel Mack2017-03-14
| | | | | | | | | | | | Factor out the code to ask polkit for authorization from method_do_shutdown_or_sleep() into an own function called verify_shutdown_creds(). This is needed in order to also use the same checks when shutdown operations are scheduled. For that, it's also necessary to allow NULL values for that action{,_multiple_sessions,_ignore_inhibit) arguments, which will suppress the call if no action string is passed.