summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-10-06 14:59:24 +0200
committerDaniel Mack <github@zonque.org>2015-10-06 14:59:24 +0200
commit13af9152bc3c018849e1834f5ff93f2a8ed03afb (patch)
tree628d9ae3d2e8542c44c00695fd3aea5f1028f04f
parent20d2f7851ac44bd6845d060a952461f5a10e9c87 (diff)
parentd046fb936658e7239c8e2635ecb7fb32748ef535 (diff)
Merge pull request #1469 from poettering/even-more-fixed
Even more fixes
-rw-r--r--NEWS59
-rw-r--r--man/sd_listen_fds.xml2
-rw-r--r--src/activate/activate.c5
-rw-r--r--src/basic/strv.c2
-rw-r--r--src/basic/util.c8
5 files changed, 50 insertions, 26 deletions
diff --git a/NEWS b/NEWS
index 9a0d969739..8867110235 100644
--- a/NEWS
+++ b/NEWS
@@ -13,8 +13,8 @@ CHANGES WITH 227:
stopped having this file around as anything else than a
symlink to /proc/self/mounts.
- * Support for the "pids" cgroup controller has been added.
- It allows accounting the number of tasks in a cgroup and
+ * Support for the "pids" cgroup controller has been added. It
+ allows accounting the number of tasks in a cgroup and
enforcing limits on it. This adds two new setting
TasksAccounting= and TasksMax= to each unit, as well as a
global option DefaultTasksAccounting=.
@@ -44,10 +44,10 @@ CHANGES WITH 227:
'machine-id-setup --commit'. The separate binary has been
removed.
- * The WorkingDirectory= directive in unit files may now be
- set to the special value '~'. In this case, the working
- directory is set to the home directory of the user configured
- in User=.
+ * The WorkingDirectory= directive in unit files may now be set
+ to the special value '~'. In this case, the working
+ directory is set to the home directory of the user
+ configured in User=.
* "machinectl shell" will now open the shell in the home
directory of the selected user by default.
@@ -57,11 +57,12 @@ CHANGES WITH 227:
also be set through CrashReboot= in systemd.conf.
* The CrashChVT= configuration file setting is renamed to
- CrashChangeVT=, following our usual logic of not abbreviating
- unnecessarily. The old directive is still supported for compat
- reasons. Also, this directive now takes an integer value
- between 1 and 63, or a boolean value. The formerly supported
- '-1' value for disabling stays around for compat reasons.
+ CrashChangeVT=, following our usual logic of not
+ abbreviating unnecessarily. The old directive is still
+ supported for compat reasons. Also, this directive now takes
+ an integer value between 1 and 63, or a boolean value. The
+ formerly supported '-1' value for disabling stays around for
+ compat reasons.
* The PrivateTmp=, PrivateDevices=, PrivateNetwork=,
NoNewPrivileges=, TTYPath=, WorkingDirectory= and
@@ -114,12 +115,15 @@ CHANGES WITH 227:
* The RuntimeDirectory= setting now understands unit
specifiers like %i or %f.
- * networkd gained support for:
- - setting the IPv6 Router Advertisment settings via
+ * systemd-networkd gained support for:
+
+ - Setting the IPv6 Router Advertisment settings via
IPv6AcceptRouterAdvertisements= in .network files.
- - configuring the HelloTimeSec, MaxAgeSec and
- ForwardDelaySec bridge parameters in .netdev files.
- - configuring PreferredSource for static routes in
+
+ - Configuring the HelloTimeSec=, MaxAgeSec= and
+ ForwardDelaySec= bridge parameters in .netdev files.
+
+ - Configuring PreferredSource= for static routes in
.network files.
* udev will now create /dev/disk/by-path links for ATA devices
@@ -142,11 +146,24 @@ CHANGES WITH 227:
only intermittendly, and even restores state if the previous
system shutdown was abrupt rather than clean.
- * Sockets passed using socket activation are now named. A new
- API sd_listen_fds_with_names() is added to access the names.
- The default names can be overwritten either in the .socket
- file using the FileDescriptorName= parameter, or by passing
- FDNAME= when storing the filedescriptor using sd_notify().
+ * File descriptors passed during socket activation may now be
+ named. A new API sd_listen_fds_with_names() is added to
+ access the names. The default names may be overriden,
+ either in the .socket file using the FileDescriptorName=
+ parameter, or by passing FDNAME= when storing the file
+ descriptors using sd_notify().
+
+ * The journal daemon gained support for vacuuming old journal
+ files controlled by the number of files that shall remain,
+ in addition to the already existing control by size and by
+ date. This is useful as journal interleaving performance
+ degrades with too many seperate journal files, and allows
+ putting an effective limit on them. The new setting defaults
+ to 100, but this may be changed by setting SystemMaxFiles=
+ and RuntimeMaxFiles= in journald.conf. Also, the
+ "journalctl" tool gained the new --vacuum-files= switch to
+ manually vacuum journal files to leave only the specified
+ number of files in place.
* Galician, Serbian, Turkish and Korean translations were added.
diff --git a/man/sd_listen_fds.xml b/man/sd_listen_fds.xml
index ea55671e4f..ccd1266318 100644
--- a/man/sd_listen_fds.xml
+++ b/man/sd_listen_fds.xml
@@ -147,7 +147,7 @@
way. The returned array of strings has as many entries as file
descriptors has been received, plus a final NULL pointer
terminating the array. The caller needs to free the array itself
- and each of its elements with libc's <varname>free()</varname>
+ and each of its elements with libc's <function>free()</function>
call after use. If the <parameter>names</parameter> parameter is
NULL the call is entirely equivalent to
<function>sd_listen_fds()</function>.</para>
diff --git a/src/activate/activate.c b/src/activate/activate.c
index 6a8432314e..4ece1367c1 100644
--- a/src/activate/activate.c
+++ b/src/activate/activate.c
@@ -361,6 +361,11 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_FDNAME:
+ if (!fdname_is_valid(optarg)) {
+ log_error("File descriptor name %s is not valid, refusing.", optarg);
+ return -EINVAL;
+ }
+
arg_fdname = optarg;
break;
diff --git a/src/basic/strv.c b/src/basic/strv.c
index 90f0b8c741..d5169467da 100644
--- a/src/basic/strv.c
+++ b/src/basic/strv.c
@@ -784,5 +784,5 @@ rollback:
free(nl[j]);
nl[k] = NULL;
- return NULL;
+ return -ENOMEM;
}
diff --git a/src/basic/util.c b/src/basic/util.c
index 630c7ea9ff..2855993afe 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -6849,12 +6849,14 @@ int version(void) {
bool fdname_is_valid(const char *s) {
const char *p;
- /* Validates a name for $LISTEN_NAMES. We basically allow
+ /* Validates a name for $LISTEN_FDNAMES. We basically allow
* everything ASCII that's not a control character. Also, as
* special exception the ":" character is not allowed, as we
- * use that as field separator in $LISTEN_NAMES.
+ * use that as field separator in $LISTEN_FDNAMES.
*
- * Note that the empty string is explicitly allowed here.*/
+ * Note that the empty string is explicitly allowed
+ * here. However, we limit the length of the names to 255
+ * characters. */
if (!s)
return false;