From: Michael Tremer Date: Fri, 12 Feb 2010 00:33:38 +0000 (+0100) Subject: naoki: Create user "nobody" in chroot. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f676e6e724a7fc25bf9fc28ba2623d38aa28520;p=ipfire-3.x.git naoki: Create user "nobody" in chroot. --- diff --git a/naoki/chroot.py b/naoki/chroot.py index 1d4df266e..becf0f460 100644 --- a/naoki/chroot.py +++ b/naoki/chroot.py @@ -212,21 +212,19 @@ class Environment(object): ## XXX Could be done better self.log.debug("Creating users") f = open("/etc/passwd") + g = open(self.chrootPath("etc", "passwd"), "w") for line in f.readlines(): - if line.startswith("root"): - g = open(self.chrootPath("etc", "passwd"), "w") + if line.startswith("root") or line.startswith("nobody"): g.write("%s" % line) - g.close() - break + g.close() f.close() f = open("/etc/group") + g = open(self.chrootPath("etc", "group"), "w") for line in f.readlines(): - if line.startswith("root"): - g = open(self.chrootPath("etc", "group"), "w") + if line.startswith("root") or line.startswith("nobody"): g.write("%s" % line) - g.close() - break + g.close() f.close() def _mountall(self):