summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am4
-rw-r--r--NEWS2
-rw-r--r--TODO16
-rw-r--r--man/busctl.xml6
-rw-r--r--man/sd_bus_get_fd.xml2
-rw-r--r--man/systemd-nspawn.xml4
-rw-r--r--man/systemd.netdev.xml2
-rw-r--r--man/systemd.time.xml15
-rw-r--r--src/basic/calendarspec.c88
-rw-r--r--src/basic/fd-util.c6
-rw-r--r--src/basic/fd-util.h1
-rw-r--r--src/basic/terminal-util.c4
-rw-r--r--src/core/manager.c2
-rw-r--r--src/import/import-common.c8
-rw-r--r--src/import/importd.c4
-rw-r--r--src/import/pull-common.c4
-rw-r--r--src/libsystemd/sd-resolve/sd-resolve.c4
-rw-r--r--src/login/logind-core.c2
-rw-r--r--src/nspawn/nspawn-network.c2
-rw-r--r--src/run/run.c2
-rw-r--r--src/test/test-calendarspec.c12
-rw-r--r--src/test/test-strv.c2
-rw-r--r--test/test-functions9
23 files changed, 133 insertions, 68 deletions
diff --git a/Makefile.am b/Makefile.am
index e3a350578b..c9fb4917ad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4863,7 +4863,7 @@ test_keymap_util_SOURCES = \
src/locale/keymap-util.h
test_keymap_util_LDADD = \
- libshared.la \
+ libsystemd-shared.la \
-ldl
tests += \
@@ -6419,7 +6419,7 @@ install-tree: all
.PHONY: valgrind-tests
valgrind-tests: $(TESTS)
$(AM_V_GEN)for f in $(filter-out %.pl %.py, $^); do \
- if file $$f | grep -q shell; then \
+ if $(LIBTOOL) --mode=execute file $$f | grep -q shell; then \
echo -e "$${x}Skipping non-binary $$f"; else \
echo -e "$${x}Running $$f"; \
$(LIBTOOL) --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
diff --git a/NEWS b/NEWS
index e4efb476c6..7a0d1d573e 100644
--- a/NEWS
+++ b/NEWS
@@ -851,7 +851,7 @@ CHANGES WITH 227:
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
+ degrades with too many separate 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
diff --git a/TODO b/TODO
index ea359c3768..5208bdb818 100644
--- a/TODO
+++ b/TODO
@@ -43,6 +43,21 @@ Features:
* ProtectKeyRing= to take keyring calls away
+* PrivateUsers= which maps the all user ids except root and the one specified
+ in User= to nobody
+
+* Add AllocateUser= for allowing dynamic user ids per-service
+
+* Add DataDirectory=, CacheDirectory= and LogDirectory= to match
+ RuntimeDirectory=, and create it as necessary when starting a service, owned by the right user.
+
+* Add BindDirectory= for allowing arbitrary, private bind mounts for services
+
+* Beef up RootDirectory= to use namespacing/bind mounts as soon as fs
+ namespaces are enabled by the service
+
+* Add RootImage= for mounting a disk image or file as root directory
+
* RestrictNamespaces= or so in services (taking away the ability to create namespaces, with setns, unshare, clone)
* nspawn: make /proc/sys/net writable?
@@ -550,7 +565,6 @@ Features:
o CLOCK_REALTIME makes jumps (TFD_TIMER_CANCEL_ON_SET)
o DST changes
- Support 2012-02~4 as syntax for specifying the fourth to last day of the month.
- - calendarspec: support value ranges with ".." notation. Example: 2013-4..8-1
- Modulate timer frequency based on battery state
* add libsystemd-password or so to query passwords during boot using the password agent logic
diff --git a/man/busctl.xml b/man/busctl.xml
index b71a174634..052a33097f 100644
--- a/man/busctl.xml
+++ b/man/busctl.xml
@@ -119,8 +119,10 @@
<term><option>--match=<replaceable>MATCH</replaceable></option></term>
<listitem><para>When showing messages being exchanged, show only the
- subset matching <replaceable>MATCH</replaceable>.</para></listitem>
- <!-- TODO: link to sd_bus_add_match when it is written? -->
+ subset matching <replaceable>MATCH</replaceable>.
+ See
+ <citerefentry><refentrytitle>sd_bus_add_match</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
+ </para></listitem>
</varlistentry>
<varlistentry>
diff --git a/man/sd_bus_get_fd.xml b/man/sd_bus_get_fd.xml
index 49162a6e65..9f7019069f 100644
--- a/man/sd_bus_get_fd.xml
+++ b/man/sd_bus_get_fd.xml
@@ -68,7 +68,7 @@
project='die-net'><refentrytitle>select</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry
project='die-net'><refentrytitle>poll</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
- or similar functions to wait for incmming messages.
+ or similar functions to wait for incoming messages.
</para>
<para>
diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml
index c436f42948..cb0468fbf5 100644
--- a/man/systemd-nspawn.xml
+++ b/man/systemd-nspawn.xml
@@ -109,9 +109,9 @@
service in the background. In this mode each container instance runs as its own service instance; a default
template unit file <filename>systemd-nspawn@.service</filename> is provided to make this easy, taking the container
name as instance identifier. Note that different default options apply when <command>systemd-nspawn</command> is
- invoked by the template unit file than interactively on the commnd line. Most importanly the template unit file
+ invoked by the template unit file than interactively on the command line. Most importantly the template unit file
makes use of the <option>--boot</option> which is not the default in case <command>systemd-nspawn</command> is
- invoked from the interactive command line. Further differences with the defaults are documented dalong with the
+ invoked from the interactive command line. Further differences with the defaults are documented along with the
various supported options below.</para>
<para>The <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry> tool may
diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml
index 2be1efee2f..571e9aa946 100644
--- a/man/systemd.netdev.xml
+++ b/man/systemd.netdev.xml
@@ -163,7 +163,7 @@
<entry>A virtual extensible LAN (vxlan), for connecting Cloud computing deployments.</entry></row>
<row><entry><varname>vrf</varname></entry>
- <entry>A Virtual Routing and Forwarding (<ulink url="https://www.kernel.org/doc/Documentation/networking/vrf.txt">VRF</ulink>) interface to create seperate routing and forwarding domains.</entry></row>
+ <entry>A Virtual Routing and Forwarding (<ulink url="https://www.kernel.org/doc/Documentation/networking/vrf.txt">VRF</ulink>) interface to create separate routing and forwarding domains.</entry></row>
</tbody>
</tgroup>
diff --git a/man/systemd.time.xml b/man/systemd.time.xml
index ffcac82263..9f0b2e1120 100644
--- a/man/systemd.time.xml
+++ b/man/systemd.time.xml
@@ -217,8 +217,8 @@
should consist of one or more English language weekday names,
either in the abbreviated (Wed) or non-abbreviated (Wednesday)
form (case does not matter), separated by commas. Specifying two
- weekdays separated by <literal>-</literal> refers to a range of
- continuous weekdays. <literal>,</literal> and <literal>-</literal>
+ weekdays separated by <literal>..</literal> refers to a range of
+ continuous weekdays. <literal>,</literal> and <literal>..</literal>
may be combined freely.</para>
<para>In the date and time specifications, any component may be
@@ -227,7 +227,8 @@
values separated by commas. Values may also be suffixed with
<literal>/</literal> and a repetition value, which indicates that
the value and all values plus multiples of the repetition value
- are matched.</para>
+ are matched. Each component may also contain a range of values
+ separated by <literal>..</literal>.</para>
<para>The seconds component may contain decimal fractions both in
the value and the repetition. All fractions are rounded to 6
@@ -262,17 +263,18 @@
<para>Examples for valid timestamps and their
normalized form:</para>
-<programlisting> Sat,Thu,Mon-Wed,Sat-Sun → Mon-Thu,Sat,Sun *-*-* 00:00:00
+<programlisting> Sat,Thu,Mon..Wed,Sat..Sun → Mon..Thu,Sat,Sun *-*-* 00:00:00
Mon,Sun 12-*-* 2,1:23 → Mon,Sun 2012-*-* 01,02:23:00
Wed *-1 → Wed *-*-01 00:00:00
- Wed-Wed,Wed *-1 → Wed *-*-01 00:00:00
+ Wed..Wed,Wed *-1 → Wed *-*-01 00:00:00
Wed, 17:48 → Wed *-*-* 17:48:00
-Wed-Sat,Tue 12-10-15 1:2:3 → Tue-Sat 2012-10-15 01:02:03
+Wed..Sat,Tue 12-10-15 1:2:3 → Tue..Sat 2012-10-15 01:02:03
*-*-7 0:0:0 → *-*-07 00:00:00
10-15 → *-10-15 00:00:00
monday *-12-* 17:00 → Mon *-12-* 17:00:00
Mon,Fri *-*-3,1,2 *:30:45 → Mon,Fri *-*-01,02,03 *:30:45
12,14,13,12:20,10,30 → *-*-* 12,13,14:10,20,30:00
+ 12..14:10,20,30 → *-*-* 12,13,14:10,20,30:00
mon,fri *-1/2-1,3 *:30:45 → Mon,Fri *-01/2-01,03 *:30:45
03-05 08:05:40 → *-03-05 08:05:40
08:05:40 → *-*-* 08:05:40
@@ -281,6 +283,7 @@ Wed-Sat,Tue 12-10-15 1:2:3 → Tue-Sat 2012-10-15 01:02:03
Sat,Sun 08:05:40 → Sat,Sun *-*-* 08:05:40
2003-03-05 05:40 → 2003-03-05 05:40:00
05:40:23.4200004/3.1700005 → 05:40:23.420000/3.170001
+ 2003-02..04-05 → 2003-02,03,04-05 00:00:00
2003-03-05 05:40 UTC → 2003-03-05 05:40:00 UTC
2003-03-05 → 2003-03-05 00:00:00
03-05 → *-03-05 00:00:00
diff --git a/src/basic/calendarspec.c b/src/basic/calendarspec.c
index 6e0bab9b94..e4cfab364e 100644
--- a/src/basic/calendarspec.c
+++ b/src/basic/calendarspec.c
@@ -32,6 +32,8 @@
#include "parse-util.h"
#include "string-util.h"
+/* Longest valid date/time range is 1970..2199 */
+#define MAX_RANGE_LEN 230
#define BITS_WEEKDAYS 127
static void free_chain(CalendarComponent *c) {
@@ -200,7 +202,7 @@ static void format_weekdays(FILE *f, const CalendarSpec *c) {
};
int l, x;
- bool need_colon = false;
+ bool need_comma = false;
assert(f);
assert(c);
@@ -211,10 +213,10 @@ static void format_weekdays(FILE *f, const CalendarSpec *c) {
if (c->weekdays_bits & (1 << x)) {
if (l < 0) {
- if (need_colon)
+ if (need_comma)
fputc(',', f);
else
- need_colon = true;
+ need_comma = true;
fputs(days[x], f);
l = x;
@@ -223,7 +225,7 @@ static void format_weekdays(FILE *f, const CalendarSpec *c) {
} else if (l >= 0) {
if (x > l + 1) {
- fputc(x > l + 2 ? '-' : ',', f);
+ fputs(x > l + 2 ? ".." : ",", f);
fputs(days[x-1], f);
}
@@ -232,7 +234,7 @@ static void format_weekdays(FILE *f, const CalendarSpec *c) {
}
if (l >= 0 && x > l + 1) {
- fputc(x > l + 2 ? '-' : ',', f);
+ fputs(x > l + 2 ? ".." : ",", f);
fputs(days[x-1], f);
}
}
@@ -357,6 +359,7 @@ static int parse_weekdays(const char **p, CalendarSpec *c) {
skip = strlen(day_nr[i].name);
if ((*p)[skip] != '-' &&
+ (*p)[skip] != '.' &&
(*p)[skip] != ',' &&
(*p)[skip] != ' ' &&
(*p)[skip] != 0)
@@ -394,7 +397,18 @@ static int parse_weekdays(const char **p, CalendarSpec *c) {
return 0;
}
- if (**p == '-') {
+ if (**p == '.') {
+ if (l >= 0)
+ return -EINVAL;
+
+ if ((*p)[1] != '.')
+ return -EINVAL;
+
+ l = day_nr[i].nr;
+ *p += 1;
+
+ /* Support ranges with "-" for backwards compatibility */
+ } else if (**p == '-') {
if (l >= 0)
return -EINVAL;
@@ -448,8 +462,26 @@ static int parse_component_decimal(const char **p, bool usec, unsigned long *res
return 0;
}
+static int const_chain(int value, CalendarComponent **c) {
+ CalendarComponent *cc = NULL;
+
+ assert(c);
+
+ cc = new0(CalendarComponent, 1);
+ if (!cc)
+ return -ENOMEM;
+
+ cc->value = value;
+ cc->repeat = 0;
+ cc->next = *c;
+
+ *c = cc;
+
+ return 0;
+}
+
static int prepend_component(const char **p, bool usec, CalendarComponent **c) {
- unsigned long value, repeat = 0;
+ unsigned long i, value, range_end, range_inc, repeat = 0;
CalendarComponent *cc;
int r;
const char *e;
@@ -471,6 +503,30 @@ static int prepend_component(const char **p, bool usec, CalendarComponent **c) {
if (repeat == 0)
return -ERANGE;
+ } else if (e[0] == '.' && e[1] == '.') {
+ e += 2;
+ r = parse_component_decimal(&e, usec, &range_end);
+ if (r < 0)
+ return r;
+
+ if (value >= range_end)
+ return -EINVAL;
+
+ range_inc = usec ? USEC_PER_SEC : 1;
+
+ /* Don't allow impossibly large ranges... */
+ if (range_end - value >= MAX_RANGE_LEN * range_inc)
+ return -EINVAL;
+
+ /* ...or ranges with only a single element */
+ if (range_end - value < range_inc)
+ return -EINVAL;
+
+ for (i = value; i <= range_end; i += range_inc) {
+ r = const_chain(i, c);
+ if (r < 0)
+ return r;
+ }
}
if (*e != 0 && *e != ' ' && *e != ',' && *e != '-' && *e != ':')
@@ -495,24 +551,6 @@ static int prepend_component(const char **p, bool usec, CalendarComponent **c) {
return 0;
}
-static int const_chain(int value, CalendarComponent **c) {
- CalendarComponent *cc = NULL;
-
- assert(c);
-
- cc = new0(CalendarComponent, 1);
- if (!cc)
- return -ENOMEM;
-
- cc->value = value;
- cc->repeat = 0;
- cc->next = *c;
-
- *c = cc;
-
- return 0;
-}
-
static int parse_chain(const char **p, bool usec, CalendarComponent **c) {
const char *t;
CalendarComponent *cc = NULL;
diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c
index 8b466cff15..5c820332a5 100644
--- a/src/basic/fd-util.c
+++ b/src/basic/fd-util.c
@@ -186,6 +186,12 @@ int fd_cloexec(int fd, bool cloexec) {
return 0;
}
+void stdio_unset_cloexec(void) {
+ fd_cloexec(STDIN_FILENO, false);
+ fd_cloexec(STDOUT_FILENO, false);
+ fd_cloexec(STDERR_FILENO, false);
+}
+
_pure_ static bool fd_in_set(int fd, const int fdset[], unsigned n_fdset) {
unsigned i;
diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h
index b86e41698a..34b98d4aec 100644
--- a/src/basic/fd-util.h
+++ b/src/basic/fd-util.h
@@ -63,6 +63,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(DIR*, closedir);
int fd_nonblock(int fd, bool nonblock);
int fd_cloexec(int fd, bool cloexec);
+void stdio_unset_cloexec(void);
int close_all_fds(const int except[], unsigned n_except);
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c
index d8cca55378..df56d85317 100644
--- a/src/basic/terminal-util.c
+++ b/src/basic/terminal-util.c
@@ -888,9 +888,7 @@ int make_stdio(int fd) {
/* Explicitly unset O_CLOEXEC, since if fd was < 3, then
* dup2() was a NOP and the bit hence possibly set. */
- fd_cloexec(STDIN_FILENO, false);
- fd_cloexec(STDOUT_FILENO, false);
- fd_cloexec(STDERR_FILENO, false);
+ stdio_unset_cloexec();
return 0;
}
diff --git a/src/core/manager.c b/src/core/manager.c
index 1323df7d88..902c2a0a27 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1733,7 +1733,7 @@ static void invoke_sigchld_event(Manager *m, Unit *u, const siginfo_t *si) {
UNIT_VTABLE(u)->sigchld_event(u, si->si_pid, si->si_code, si->si_status);
u->sigchldgen = iteration;
} else
- log_debug("%s already issued a sigchld this iteration %llu, skipping. Pids still being watched %d", u->id, iteration, set_size(u->pids));
+ log_debug("%s already issued a sigchld this iteration %" PRIu64 ", skipping. Pids still being watched %d", u->id, iteration, set_size(u->pids));
}
}
diff --git a/src/import/import-common.c b/src/import/import-common.c
index 287a3382a1..81209cdaf6 100644
--- a/src/import/import-common.c
+++ b/src/import/import-common.c
@@ -125,9 +125,7 @@ int import_fork_tar_x(const char *path, pid_t *ret) {
if (null_fd != STDOUT_FILENO)
null_fd = safe_close(null_fd);
- fd_cloexec(STDIN_FILENO, false);
- fd_cloexec(STDOUT_FILENO, false);
- fd_cloexec(STDERR_FILENO, false);
+ stdio_unset_cloexec();
if (unshare(CLONE_NEWNET) < 0)
log_error_errno(errno, "Failed to lock tar into network namespace, ignoring: %m");
@@ -199,9 +197,7 @@ int import_fork_tar_c(const char *path, pid_t *ret) {
if (null_fd != STDIN_FILENO)
null_fd = safe_close(null_fd);
- fd_cloexec(STDIN_FILENO, false);
- fd_cloexec(STDOUT_FILENO, false);
- fd_cloexec(STDERR_FILENO, false);
+ stdio_unset_cloexec();
if (unshare(CLONE_NEWNET) < 0)
log_error_errno(errno, "Failed to lock tar into network namespace, ignoring: %m");
diff --git a/src/import/importd.c b/src/import/importd.c
index 956a82945c..28b4302cb3 100644
--- a/src/import/importd.c
+++ b/src/import/importd.c
@@ -448,9 +448,7 @@ static int transfer_start(Transfer *t) {
safe_close(null_fd);
}
- fd_cloexec(STDIN_FILENO, false);
- fd_cloexec(STDOUT_FILENO, false);
- fd_cloexec(STDERR_FILENO, false);
+ stdio_unset_cloexec();
setenv("SYSTEMD_LOG_TARGET", "console-prefixed", 1);
setenv("NOTIFY_SOCKET", "/run/systemd/import/notify", 1);
diff --git a/src/import/pull-common.c b/src/import/pull-common.c
index dc4e4667a9..2ae2a4174c 100644
--- a/src/import/pull-common.c
+++ b/src/import/pull-common.c
@@ -506,9 +506,7 @@ int pull_verify(PullJob *main_job,
cmd[k++] = "-";
cmd[k++] = NULL;
- fd_cloexec(STDIN_FILENO, false);
- fd_cloexec(STDOUT_FILENO, false);
- fd_cloexec(STDERR_FILENO, false);
+ stdio_unset_cloexec();
execvp("gpg2", (char * const *) cmd);
execvp("gpg", (char * const *) cmd);
diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c
index d8303e2e69..60aa55de3b 100644
--- a/src/libsystemd/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/sd-resolve/sd-resolve.c
@@ -585,9 +585,7 @@ static void resolve_free(sd_resolve *resolve) {
(void) pthread_join(resolve->workers[i], NULL);
/* Close all communication channels */
- for (i = 0; i < _FD_MAX; i++)
- safe_close(resolve->fds[i]);
-
+ close_many(resolve->fds, _FD_MAX);
free(resolve);
}
diff --git a/src/login/logind-core.c b/src/login/logind-core.c
index cbf8d757fe..eff5a4a36f 100644
--- a/src/login/logind-core.c
+++ b/src/login/logind-core.c
@@ -496,7 +496,7 @@ static int manager_count_external_displays(Manager *m) {
continue;
/* Ignore internal displays: the type is encoded in
- * the sysfs name, as the second dash seperated item
+ * the sysfs name, as the second dash separated item
* (the first is the card name, the last the connector
* number). We implement a whitelist of external
* displays here, rather than a whitelist, to ensure
diff --git a/src/nspawn/nspawn-network.c b/src/nspawn/nspawn-network.c
index 8da47a2ca6..428cc04de0 100644
--- a/src/nspawn/nspawn-network.c
+++ b/src/nspawn/nspawn-network.c
@@ -350,7 +350,7 @@ int setup_bridge(const char *veth_name, const char *bridge_name, bool create) {
if (create) {
/* We take a system-wide lock here, so that we can safely check whether there's still a member in the
- * bridge before removing it, without risking interferance from other nspawn instances. */
+ * bridge before removing it, without risking interference from other nspawn instances. */
r = make_lock_file("/run/systemd/nspawn-network-zone", LOCK_EX, &bridge_lock);
if (r < 0)
diff --git a/src/run/run.c b/src/run/run.c
index d6c9b6d37a..58fa49a4d1 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -187,7 +187,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "+hrH:M:p:tq", options, NULL)) >= 0)
+ while ((c = getopt_long(argc, argv, "+hrH:M:E:p:tq", options, NULL)) >= 0)
switch (c) {
diff --git a/src/test/test-calendarspec.c b/src/test/test-calendarspec.c
index 5a8c6cbfb6..4a2b93de59 100644
--- a/src/test/test-calendarspec.c
+++ b/src/test/test-calendarspec.c
@@ -91,12 +91,15 @@ static void test_next(const char *input, const char *new_tz, usec_t after, usec_
int main(int argc, char* argv[]) {
CalendarSpec *c;
- test_one("Sat,Thu,Mon-Wed,Sat-Sun", "Mon-Thu,Sat,Sun *-*-* 00:00:00");
+ test_one("Sat,Thu,Mon-Wed,Sat-Sun", "Mon..Thu,Sat,Sun *-*-* 00:00:00");
+ test_one("Sat,Thu,Mon..Wed,Sat..Sun", "Mon..Thu,Sat,Sun *-*-* 00:00:00");
test_one("Mon,Sun 12-*-* 2,1:23", "Mon,Sun 2012-*-* 01,02:23:00");
test_one("Wed *-1", "Wed *-*-01 00:00:00");
test_one("Wed-Wed,Wed *-1", "Wed *-*-01 00:00:00");
+ test_one("Wed..Wed,Wed *-1", "Wed *-*-01 00:00:00");
test_one("Wed, 17:48", "Wed *-*-* 17:48:00");
- test_one("Wed-Sat,Tue 12-10-15 1:2:3", "Tue-Sat 2012-10-15 01:02:03");
+ test_one("Wed-Sat,Tue 12-10-15 1:2:3", "Tue..Sat 2012-10-15 01:02:03");
+ test_one("Wed..Sat,Tue 12-10-15 1:2:3", "Tue..Sat 2012-10-15 01:02:03");
test_one("*-*-7 0:0:0", "*-*-07 00:00:00");
test_one("10-15", "*-10-15 00:00:00");
test_one("monday *-12-* 17:00", "Mon *-12-* 17:00:00");
@@ -124,6 +127,10 @@ int main(int argc, char* argv[]) {
test_one("2016-03-27 03:17:00.4200005", "2016-03-27 03:17:00.420001");
test_one("2016-03-27 03:17:00/0.42", "2016-03-27 03:17:00/0.420000");
test_one("2016-03-27 03:17:00/0.42", "2016-03-27 03:17:00/0.420000");
+ test_one("9..11,13:00,30", "*-*-* 09,10,11,13:00,30:00");
+ test_one("1..3-1..3 1..3:1..3", "*-01,02,03-01,02,03 01,02,03:01,02,03:00");
+ test_one("00:00:1.125..2.125", "*-*-* 00:00:01.125000,02.125000");
+ test_one("00:00:1.0..3.8", "*-*-* 00:00:01,02,03");
test_next("2016-03-27 03:17:00", "", 12345, 1459048620000000);
test_next("2016-03-27 03:17:00", "CET", 12345, 1459041420000000);
@@ -146,6 +153,7 @@ int main(int argc, char* argv[]) {
assert_se(calendar_spec_from_string("2000-03-05.23 00:00:00", &c) < 0);
assert_se(calendar_spec_from_string("2000-03-05 00:00.1:00", &c) < 0);
assert_se(calendar_spec_from_string("00:00:00/0.00000001", &c) < 0);
+ assert_se(calendar_spec_from_string("00:00:00.0..00.9", &c) < 0);
return 0;
}
diff --git a/src/test/test-strv.c b/src/test/test-strv.c
index cf5887d258..f7a1217df7 100644
--- a/src/test/test-strv.c
+++ b/src/test/test-strv.c
@@ -686,7 +686,7 @@ static void test_foreach_string(void) {
}
static void test_strv_fnmatch(void) {
- _cleanup_free_ char **v = NULL;
+ _cleanup_strv_free_ char **v = NULL;
assert_se(!strv_fnmatch(STRV_MAKE_EMPTY, "a", 0));
diff --git a/test/test-functions b/test/test-functions
index 4583c02f97..567a000b8d 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -275,10 +275,15 @@ install_systemd() {
echo LogLevel=debug >> $initdir/etc/systemd/system.conf
}
+get_ldpath() {
+ local _bin="$1"
+ objdump -p "$_bin" 2>/dev/null | awk "/R(UN)?PATH/ { print \"$initdir\" \$2 }" | paste -sd :
+}
+
install_missing_libraries() {
# install possible missing libraries
- for i in $initdir/{sbin,bin}/* $initdir/lib/systemd/*; do
- inst_libs $i
+ for i in $initdir{,/usr}/{sbin,bin}/* $initdir{,/usr}/lib/systemd/*; do
+ LD_LIBRARY_PATH=$(get_ldpath $i) inst_libs $i
done
}