summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* sysusers: move various user credential validity checks to src/basic/Lennart Poettering2016-07-224-75/+185
| | | | | | | This way we can reuse them for validating User=/Group= settings in unit files (to be added in a later commit). Also, add some tests for them.
* Merge pull request #3762 from poettering/sigkill-logMartin Pitt2016-07-2213-75/+178
|\ | | | | log about all processes we forcibly kill
| * logind: always abandon session scopes before killing themLennart Poettering2016-07-201-5/+10
| | | | | | | | | | | | | | | | This way systemd is informed that we consider everything inside the scope as "left-over", and systemd can log about killing it. With this change systemd will log about all processes killed due to the session clean-up on KillUserProcesses=yes.
| * core: when a scope was abandoned, always log about processes we killLennart Poettering2016-07-202-1/+14
| | | | | | | | | | After all, if a unit is abandoned, all processes inside of it may be considered "left over" and are something we should better log about.
| * core: make sure RequestStop signal is send directedLennart Poettering2016-07-201-1/+1
| | | | | | | | | | This was accidentally left commented out for debugging purposes, let's fix that and make the signal directed again.
| * cgroup: suppress sending follow-up SIGCONT after sending SIGCONT/SIGKILL anywayLennart Poettering2016-07-201-0/+5
| |
| * core: when forcibly killing/aborting left-over unit processes log about itLennart Poettering2016-07-209-59/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's lot at LOG_NOTICE about any processes that we are going to SIGKILL/SIGABRT because clean termination of them didn't work. This turns the various boolean flag parameters to cg_kill(), cg_migrate() and related calls into a single binary flags parameter, simply because the function now gained even more parameters and the parameter listed shouldn't get too long. Logging for killing processes is done either when the kill signal is SIGABRT or SIGKILL, or on explicit request if KILL_TERMINATE_AND_LOG instead of LOG_TERMINATE is passed. This isn't used yet in this patch, but is made use of in a later patch.
| * util: don't send SIGCONT following a SIGCONT or SIGKILL in kill_and_sigcont()Lennart Poettering2016-07-201-2/+4
| |
| * logind: minor coding style improvementsLennart Poettering2016-07-201-9/+6
| |
* | Merge pull request #3764 from poettering/assorted-stuff-2Martin Pitt2016-07-228-24/+30
|\ \ | | | | | | Assorted fixes
| * | basic: fix macro definition in nss-util.hLennart Poettering2016-07-201-1/+1
| | | | | | | | | | | | Fix a copy/paste mistake.
| * | execute: make sure JoinsNamespaceOf= doesn't leak ns fds to executed processesLennart Poettering2016-07-201-1/+1
| | |
| * | namespace: add a (void) castLennart Poettering2016-07-201-1/+1
| | |
| * | nspawn: when netns is on, mount /proc/sys/net writableLennart Poettering2016-07-202-12/+12
| | | | | | | | | | | | | | | | | | Normally we make all of /proc/sys read-only in a container, but if we do have netns enabled we can make /proc/sys/net writable, as things are virtualized then.
| * | nspawn: document why the uid shift range is the way it isLennart Poettering2016-07-201-1/+3
| | |
| * | conf-parser: minor coding style improvementsLennart Poettering2016-07-201-2/+4
| | |
| * | core: normalize header inclusion in execute.h a bitLennart Poettering2016-07-202-3/+5
| | | | | | | | | | | | | | | | | | | | | We don't actually need any functionality from cgroup.h in execute.h, hence don't include that. However, we do need the Unit structure from unit.h, hence include that, and move it as late as possible, since it needs the definitions from execute.h.
| * | execute: normalize connect_logger_as() parameters slightlyLennart Poettering2016-07-201-3/+3
| | | | | | | | | | | | | | | All other functions in execute.c that need the unit id take a Unit* parameter as first argument. Let's change connect_logger_as() to follow a similar logic.
* | | nspawn: enable major=0/minor=0 devices inside the container (#3773)Alessandro Puccetti2016-07-212-2/+7
| | | | | | | | | | | | | | | | | | https://github.com/systemd/systemd/pull/3685 introduced /run/systemd/inaccessible/{chr,blk} to map inacessible devices, this patch allows systemd running inside a nspawn container to create /run/systemd/inaccessible/{chr,blk}.
* | | missing_syscall: add __NR_copy_file_range for powerpc architecture (#3772)Alessio Igor Bogani2016-07-211-0/+2
| | |
* | | Merge pull request #3770 from AlexanderKurtz/masterLennart Poettering2016-07-211-5/+5
|\ \ \ | | | | | | | | bootctl: Always use upper case for "/EFI/BOOT" and "/EFI/BOOT/BOOT*.EFI".
| * | | bootctl: Always use upper case for "/EFI/BOOT" and "/EFI/BOOT/BOOT*.EFI".Alexander Kurtz2016-07-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the ESP is not mounted with "iocharset=ascii", but with "iocharset=utf8" (which is for example the default in Debian), the file system becomes case sensitive. This means that a file created as "FooBarBaz" cannot be accessed as "foobarbaz" since those are then considered different files. Moreover, a file created as "FooBar" can then also not be accessed as "foobar", and it also prevents such a file from being created, as both would use the same 8.3 short name "FOOBAR". Even though the UEFI specification [0] does give the canonical spelling for the files mentioned above, not all implementations completely conform to that, so it's possible that those files would already exist, but with a different spelling, causing subtle bugs when scanning or modifying the ESP. While the proper fix would of course be that everybody conformed to the standard, we can work around this problem by just referencing the files by their 8.3 short names, i.e. using upper case. Fixes: #3740 [0] <http://www.uefi.org/specifications>, version 2.6, section 3.5.1.1
| * | | bootctl: Use lower case string constants in case-insensitive comparisons.Alexander Kurtz2016-07-211-1/+1
| | | |
* | | | core: remove duplicate includes (#3771)Thomas H. P. Andersen2016-07-212-2/+0
|/ / /
* | | namespace: fix wrong return value from mount(2) (#3758)Topi Miettinen2016-07-201-1/+2
|/ / | | | | | | | | Fix bug introduced by #3263: mount(2) return value is 0 or -1, not errno. Thanks to Evgeny Vereshchagin (@evverx) for reporting.
* | namespace: minor improvementsLennart Poettering2016-07-201-8/+5
| | | | | | | | | | | | | | | | We generally try to avoid strerror(), due to its threads-unsafety, let's do this here, too. Also, let's be tiny bit more explanatory with the log messages, and let's shorten a few things.
* | core: hide legacy bus propertiesLennart Poettering2016-07-201-3/+3
|/ | | | | | | | We usually hide legacy bus properties from introspection. Let's do that for the InaccessibleDirectories= properties too. The properties stay accessible if requested, but they won't be listed anymore if people introspect the unit.
* Merge pull request #3685 from kinvolk/alessandro/inaccessible-pathsLennart Poettering2016-07-1910-57/+107
|\ | | | | namespace: unify limit behavior on non-directory paths
| * doc,core: Read{Write,Only}Paths= and InaccessiblePaths=Alessandro Puccetti2016-07-197-40/+47
| | | | | | | | | | | | | | | | | | | | | | This patch renames Read{Write,Only}Directories= and InaccessibleDirectories= to Read{Write,Only}Paths= and InaccessiblePaths=, previous names are kept as aliases but they are not advertised in the documentation. Renamed variables: `read_write_dirs` --> `read_write_paths` `read_only_dirs` --> `read_only_paths` `inaccessible_dirs` --> `inaccessible_paths`
| * namespace: unify limit behavior on non-directory pathsAlessandro Puccetti2016-07-195-17/+60
| | | | | | | | | | | | | | | | | | | | | | Despite the name, `Read{Write,Only}Directories=` already allows for regular file paths to be masked. This commit adds the same behavior to `InaccessibleDirectories=` and makes it explicit in the doc. This patch introduces `/run/systemd/inaccessible/{reg,dir,chr,blk,fifo,sock}` {dile,device}nodes and mounts on the appropriate one the paths specified in `InacessibleDirectories=`. Based on Luca's patch from https://github.com/systemd/systemd/pull/3327
* | sd-journal: suppress empty linesLennart Poettering2016-07-191-1/+10
| | | | | | | | | | Let's make sure our logging APIs is in sync with how stdout/stderr logging works.
* | journalctl: make sure that journalctl's --all switch also has an effect on ↵Lennart Poettering2016-07-191-2/+2
| | | | | | | | | | | | | | | | | | | | json output With this change, binary record data is formatted as string if --all is specified when using json output. This is inline with the effect of --all on the other available output modes. Fixes: #3416
* | sd-journal: when formatting log messages, implicitly strip trailing whitespaceLennart Poettering2016-07-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When converting log messages from human readable text into binary records to send off to journald in sd_journal_print(), strip trailing whitespace in the log message. This way, handling of logs made via syslog(), stdout/stderr and sd_journal_print() are treated the same way: trailing (but not leading) whitespace is automatically removed, in particular \n and \r. Note that in case of syslog() and stdout/stderr based logging the stripping takes place server-side though, while for the native protocol based transport this takes place client-side. This is because in the former cases conversion from free-form human-readable strings into structured, binary log records takes place on the server-side while for journal-native logging it happens on the client side, and after conversion into binary records we probably shouldn't alter the data anymore. See: #3416
* | kernel-install: recognize /boot/efi mountpoint (#3751)Harald Hoyer2016-07-192-2/+11
| | | | | | install everything in /boot/efi, if this is a mountpoint
* | resolved: replace bitwise and with logical andThomas Hindoe Paaboel Andersen2016-07-181-1/+1
| |
* | treewide: remove unused variablesThomas Hindoe Paaboel Andersen2016-07-184-4/+2
| |
* | basic: fix whitespaceThomas Hindoe Paaboel Andersen2016-07-181-1/+1
| |
* | network: fix indentationThomas Hindoe Paaboel Andersen2016-07-181-1/+1
| |
* | sd-boot: Fix waiting for keyboard input (#3735)Jan Janssen2016-07-181-6/+2
|/ | | | | | | WaitForKeyEx may never return on some UEFI systems depending on firmware, hardware configuration and the phase of the moon. Use ConIn->WaitForKey unconditionally instead. Fixes #3632
* nspawn: decrease mkdir error logging in /sys to debug priority (#3748)tblume2016-07-181-1/+1
| | | | | | | | Such mkdir errors happen for example when trying to mkdir /sys/fs/selinux. /sys is documented to be readonly in the container, so mkdir errors below /sys can be expected. They shouldn't be logged as warnings since they lead users to think that there is something wrong.
* Merge pull request #3745 from keszybz/fix-make-nulstr-confusionLennart Poettering2016-07-183-9/+32
|\ | | | | Fix make nulstr confusion
| * basic/strv: add an extra NUL after strings in strv_make_nulstrZbigniew Jędrzejewski-Szmek2016-07-173-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strv_make_nulstr was creating a nulstr which was not a valid nulstr, because it was missing the terminating NUL. This didn't cause any issues, because strv_parse_nulstr correctly parsed the result, using the separately specified length. But it's confusing to have something called nulstr which really isn't. It is likely that somebody will try to use strv_make_nulstr() in some other place, incorrectly. This patch changes strv_parse_nulstr() to produce a valid nulstr, and changes the output length parameter to be the minimum number of bytes which can be later on parsed by strv_parse_nulstr(). This allows the only user in ask-password-api to be slightly simplified. Based-on-patch-by: Jean-Sébastien Bour <jean-sebastien@bour.name> Fixes #3689.
| * basic/strv: exhibit strv_make_nulstr missing final NUL char ↵Jean-Sébastien Bour2016-07-171-0/+7
| | | | | | | | (systemd/systemd#3689)
* | Merge pull request #3746 from keszybz/trivial-fixesDaniel Mack2016-07-182-7/+6
|\ \ | |/ |/| Trivial fixes
| * Drop parentheses in two placesZbigniew Jędrzejewski-Szmek2016-07-171-2/+1
| |
| * systemd-resolve: remove spurious newline with no global settingsZbigniew Jędrzejewski-Szmek2016-07-171-1/+1
| |
| * systemd-resolve: use plural "DNS Servers"Zbigniew Jędrzejewski-Szmek2016-07-171-4/+4
| | | | | | | | | | Usually multiple DNS servers are configured, and it looks strange to have singular in the heading.
* | manager: don't skip sigchld handler for main and control pid for services ↵Lukáš Nykrýn2016-07-161-1/+4
|/ | | | | | | | | | | | (#3738) During stop when service has one "regular" pid one main pid and one control pid and the sighld for the regular one is processed first the unit_tidy_watch_pids will skip the main and control pid and does not remove them from u->pids(). But then we skip the sigchld event because we already did one in the iteration and there are two pids in u->pids. v2: Use general unit_main_pid() and unit_control_pid() instead of reaching directly to service structure.
* networkd: fix for 3692 (#3699)Susant Sahani2016-07-151-1/+1
| | | We should look that the kind is invalid rather than pointer is NULL.
* tree-wide: get rid of selinux_context_t (#3732)Zbigniew Jędrzejewski-Szmek2016-07-155-16/+16
| | | | | | https://github.com/SELinuxProject/selinux/commit/9eb9c9327563014ad6a807814e7975424642d5b9 deprecated selinux_context_t. Replace with a simple char* everywhere. Alternative fix for #3719.