[pkg-fso-commits] [SCM] Automatic Display Manager branch, bug540201, updated. debian/0.6-1-38-g11bdc2d

Enrico Zini enrico at enricozini.org
Wed Jul 6 08:38:16 UTC 2011


The following commit has been merged in the bug540201 branch:
commit 939d92e2f715f057bd26c86b045fd6bf04e0b4a0
Author: Enrico Zini <enrico at enricozini.org>
Date:   Wed Jul 6 01:58:04 2011 +0200

    Default to current user if conf_run_as is empty

diff --git a/xsession.c b/xsession.c
index 4c5feea..3348df5 100644
--- a/xsession.c
+++ b/xsession.c
@@ -59,8 +59,13 @@ int nodm_xsession_start(struct nodm_xsession* s, const struct nodm_xserver* srv)
 
     // Validate the user using the normal system user database
     struct passwd *pw = 0;
-    if (!(pw = getpwnam(s->conf_run_as))) {
-        log_err("Unknown username: %s", s->conf_run_as);
+    if (s->conf_run_as[0] == 0)
+        pw = getpwuid(getuid());
+    else
+        pw = getpwnam(s->conf_run_as);
+    if (pw == NULL)
+    {
+        log_err("unknown username: %s", s->conf_run_as);
         return E_OS_ERROR;
     }
     child.pwent = *pw;

-- 
Automatic Display Manager



More information about the pkg-fso-commits mailing list