[systemd-commits] 2 commits - Makefile.am configure.ac src/core src/journal src/shared src/timesync

Lennart Poettering lennart at kemper.freedesktop.org
Tue May 20 17:36:59 PDT 2014


 Makefile.am                   |    4 +++-
 configure.ac                  |   22 ++++++++++++++++++++++
 src/core/systemd.pc.in        |    2 ++
 src/journal/journald-server.c |    2 +-
 src/shared/clean-ipc.c        |    4 ++--
 src/timesync/timesyncd.c      |    2 +-
 6 files changed, 31 insertions(+), 5 deletions(-)

New commits:
commit a57a27b2effe92f749a565df4f1276376b2d6dbc
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed May 21 09:36:42 2014 +0900

    timesyncd: fix english language typo

diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
index 6935635..b13db1a 100644
--- a/src/timesync/timesyncd.c
+++ b/src/timesync/timesyncd.c
@@ -175,7 +175,7 @@ static int load_clock(uid_t uid, gid_t gid) {
         ct = now(CLOCK_REALTIME);
         if (nt > ct) {
                 struct timespec ts;
-                log_info("System clock time unset or jumed backwards, restoring.");
+                log_info("System clock time unset or jumped backwards, restoring.");
 
                 if (clock_settime(CLOCK_REALTIME, timespec_store(&ts, nt)) < 0)
                         log_error("Failed to restore system clock: %m");

commit f7dc3ab9f43b67abcbd34062b9352ab42debec49
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed May 21 09:31:22 2014 +0900

    logind: don't apply RemoveIPC= to system users
    
    We shouldn't destroy IPC objects of system users on logout.
    
    http://lists.freedesktop.org/archives/systemd-devel/2014-April/018373.html
    
    This introduces SYSTEM_UID_MAX defined to the maximum UID of system
    users. This value is determined compile-time, either as configure switch
    or from /etc/login.defs. (We don't read that file at runtime, since this
    is really a choice for a system builder, not the end user.)
    
    While we are at it we then also update journald to use SYSTEM_UID_MAX
    when we decide whether to split out log data for a specific client.

diff --git a/Makefile.am b/Makefile.am
index f2a3bbd..1808f80 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4879,7 +4879,9 @@ substitutions = \
        '|PYTHON=$(PYTHON)|' \
        '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
        '|NTP_SERVERS=$(NTP_SERVERS)|' \
-       '|DNS_SERVERS=$(DNS_SERVERS)|'
+       '|DNS_SERVERS=$(DNS_SERVERS)|' \
+       '|systemuidmax=$(SYSTEM_UID_MAX)|' \
+       '|systemgidmax=$(SYSTEM_GID_MAX)|'
 
 SED_PROCESS = \
 	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
diff --git a/configure.ac b/configure.ac
index 9a849ff..c41f6c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -854,6 +854,26 @@ AC_ARG_WITH(time-epoch,
 AC_DEFINE_UNQUOTED(TIME_EPOCH, [$TIME_EPOCH], [Time Epoch])
 
 # ------------------------------------------------------------------------------
+AC_ARG_WITH(system-uid-max,
+        AS_HELP_STRING([--with-system-uid-max=UID]
+                [Maximum UID for system users]),
+        [SYSTEM_UID_MAX="$withval"],
+        [SYSTEM_UID_MAX="`awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' /etc/login.defs 2>/dev/null || echo 999`"])
+
+AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
+AC_SUBST(SYSTEM_UID_MAX)
+
+# ------------------------------------------------------------------------------
+AC_ARG_WITH(system-gid-max,
+        AS_HELP_STRING([--with-system-gid-max=GID]
+                [Maximum GID for system groups]),
+        [SYSTEM_GID_MAX="$withval"],
+        [SYSTEM_GID_MAX="`awk 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }' /etc/login.defs 2>/dev/null || echo 999`"])
+
+AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
+AC_SUBST(SYSTEM_GID_MAX)
+
+# ------------------------------------------------------------------------------
 have_localed=no
 AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
 if test "x$enable_localed" != "xno"; then
@@ -1256,6 +1276,8 @@ AC_MSG_RESULT([
         Extra start script:      ${RC_LOCAL_SCRIPT_PATH_START}
         Extra stop script:       ${RC_LOCAL_SCRIPT_PATH_STOP}
         Debug shell:             ${SUSHELL} @ ${DEBUGTTY}
+        Maximum System UID:      ${SYSTEM_UID_MAX}
+        Maximum System GID:      ${SYSTEM_GID_MAX}
 
         CFLAGS:                  ${OUR_CFLAGS} ${CFLAGS}
         CPPFLAGS:                ${OUR_CPPFLAGS} ${CPPFLAGS}
diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in
index de0f649..f8bccb5 100644
--- a/src/core/systemd.pc.in
+++ b/src/core/systemd.pc.in
@@ -19,6 +19,8 @@ systemduserunitpath=${systemduserconfdir}:/etc/systemd/user:/run/systemd/user:/u
 systemdsystemgeneratordir=@systemgeneratordir@
 systemdusergeneratordir=@usergeneratordir@
 catalogdir=@catalogdir@
+systemuidmax=@systemuidmax@
+systemgidmax=@systemgidmax@
 
 Name: systemd
 Description: systemd System and Service Manager
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 0439caf..381d80a 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -258,7 +258,7 @@ static JournalFile* find_journal(Server *s, uid_t uid) {
         if (s->runtime_journal)
                 return s->runtime_journal;
 
-        if (uid <= 0)
+        if (uid <= SYSTEM_UID_MAX)
                 return s->system_journal;
 
         r = sd_id128_get_machine(&machine);
diff --git a/src/shared/clean-ipc.c b/src/shared/clean-ipc.c
index ddd42cc..cb17226 100644
--- a/src/shared/clean-ipc.c
+++ b/src/shared/clean-ipc.c
@@ -332,8 +332,8 @@ fail:
 int clean_ipc(uid_t uid) {
         int ret = 0, r;
 
-        /* Refuse to clean IPC of the root user */
-        if (uid == 0)
+        /* Refuse to clean IPC of the root and system users */
+        if (uid <= SYSTEM_UID_MAX)
                 return 0;
 
         r = clean_sysvipc_shm(uid);



More information about the systemd-commits mailing list