From: Michael Tremer Date: Thu, 22 Apr 2010 18:17:20 +0000 (+0200) Subject: naoki: Hardcode the environment users. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5467c0f3d0446afa84fa106986cf11b98839aab;p=ipfire-3.x.git naoki: Hardcode the environment users. There are differences in the host system that cause the old approach to break. --- diff --git a/naoki/chroot.py b/naoki/chroot.py index a1888fd9c..7623c200b 100644 --- a/naoki/chroot.py +++ b/naoki/chroot.py @@ -209,22 +209,15 @@ class Environment(object): os.umask(prevMask) def _setupUsers(self): - ## 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") or line.startswith("nobody"): - g.write("%s" % line) - g.close() + f = open(self.chrootPath("etc", "passwd"), "w") + f.write("root:x:0:0:root:/root:/bin/bash\n") + f.write("nobody:x:99:99:Nobody:/:/sbin/nologin\n") f.close() - f = open("/etc/group") - g = open(self.chrootPath("etc", "group"), "w") - for line in f.readlines(): - if line.startswith("root") or line.startswith("nobody"): - g.write("%s" % line) - g.close() + f = open(self.chrootPath("etc", "group"), "w") + f.write("root:x:0:root\n") + f.write("nobody:x:99:\n") f.close() def _setupDns(self):