]> err.no Git - systemd/commitdiff
nspawn: better use setresuid() instead of setreuid()
authorLennart Poettering <lennart@poettering.net>
Fri, 1 Jul 2011 21:53:14 +0000 (23:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Jul 2011 21:53:14 +0000 (23:53 +0200)
TODO
src/nspawn.c

diff --git a/TODO b/TODO
index 5901a90cdd5c6733c6a9dc873ca35655f8f7cc77..92c90eec40f229a6e04c59afcb828686fc41132e 100644 (file)
--- a/TODO
+++ b/TODO
@@ -77,6 +77,8 @@ Features:
   controllers together in order to guarantee atomic creation/addition
   of cgroups
 
+* don't enter "exited" mode for sysv services with pid file
+
 * avoid DefaultStandardOutput=syslog to have any effect on StandardInput=socket services
 
 * cgroup_notify_empty(): recursively check groups up the tree, too
index bead9eea2b67a8042e90ee76ad879e1cae915bde..50d7c2e2895717a6ae8a81d19efa8410a31f2a7e 100644 (file)
@@ -797,12 +797,12 @@ int main(int argc, char *argv[]) {
                                 goto child_fail;
                         }
 
-                        if (setregid(gid, gid) < 0) {
+                        if (setresgid(gid, gid, gid) < 0) {
                                 log_error("setregid() failed: %m");
                                 goto child_fail;
                         }
 
-                        if (setreuid(uid, uid) < 0) {
+                        if (setresuid(uid, uid, uid) < 0) {
                                 log_error("setreuid() failed: %m");
                                 goto child_fail;
                         }
@@ -811,7 +811,7 @@ int main(int argc, char *argv[]) {
                 if ((asprintf((char**)(envp + 2), "HOME=%s", home? home: "/root") < 0) ||
                     (asprintf((char**)(envp + 3), "USER=%s", arg_user? arg_user : "root") < 0) ||
                     (asprintf((char**)(envp + 4), "LOGNAME=%s", arg_user? arg_user : "root") < 0)) {
-                    log_error("environment setup failed: %m");
+                    log_error("Out of memory");
                     goto child_fail;
                 }
 
@@ -821,7 +821,7 @@ int main(int argc, char *argv[]) {
                 if (argc > optind)
                         execvpe(argv[optind], argv + optind, (char**) envp);
                 else {
-                        chdir(home? home : "/root");
+                        chdir(home ? home : "/root");
                         execle("/bin/bash", "-bash", NULL, (char**) envp);
                 }