]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc-start-ephemeral: Parse passwd directly 667/head
authorColin Watson <cjwatson@ubuntu.com>
Wed, 30 Sep 2015 12:37:10 +0000 (13:37 +0100)
committerColin Watson <cjwatson@ubuntu.com>
Wed, 30 Sep 2015 12:52:32 +0000 (13:52 +0100)
commitc6be89f8570be19c33af49198d4eb8e6d27d626f
treed9fafdf9d7a1c0195d8cdd048697e58f00c7fa0e
parent4928c7186c4d3578de73fddb3d88038a25a327b3
lxc-start-ephemeral: Parse passwd directly

On Ubuntu 15.04, lxc-start-ephemeral's call to pwd.getpwnam always
fails.  While I haven't been able to prove it or track down an exact
cause, I strongly suspect that glibc does not guarantee that you can
call NSS functions after a context switch without re-execing.  (Running
"id root" in a subprocess from the same point works fine.)

It's safer to use getent to extract the relevant line from the passwd
file and parse it directly.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
src/lxc/lxc-start-ephemeral.in