- Version: master
- Platform: Linux (Ubuntu 14.04)
- Subsystem: os
Continuation of libuv/libuv#1570
Basically this line fails:
|
assert.ok(pwd.shell.includes(path.sep)); |
because os.userInfo().shell is ''. This is because os.userInfo() calls uv__getpwuid_r() which calls getpwuid_r(3), which reads the relevant line from /etc/passwd:
gib:x:1234:3210:Gibson Fahnestock:/home/gib:
However the user shell on this machine is not defined in /etc/passwd, so we get a default.
The question is whether we should just update the test (remove this check, so don't actually check that os.userInfo().shell actually returns anything, or whether os.userInfo().shell should handle this case.
I guess it comes down to whether this function's purpose is just "read the shell from /etc/passwd", or "tell you which shell the user is using". If it's the former we remove the test, if it's the latter we should check either the default shell, or process.env.SHELL.
The default shell is either just defaulting to /bin/sh, or it's coming from /etc/adduser.conf:
# The DSHELL variable specifies the default login shell on your system
DSHELL=/bin/bash
Continuation of libuv/libuv#1570
Basically this line fails:
node/test/parallel/test-os.js
Line 196 in 4843c2f
because
os.userInfo().shellis''. This is becauseos.userInfo()callsuv__getpwuid_r()which callsgetpwuid_r(3), which reads the relevant line from/etc/passwd:However the user shell on this machine is not defined in
/etc/passwd, so we get a default.The question is whether we should just update the test (remove this check, so don't actually check that
os.userInfo().shellactually returns anything, or whetheros.userInfo().shellshould handle this case.I guess it comes down to whether this function's purpose is just "read the shell from
/etc/passwd", or "tell you which shell the user is using". If it's the former we remove the test, if it's the latter we should check either the default shell, orprocess.env.SHELL.The default shell is either just defaulting to
/bin/sh, or it's coming from/etc/adduser.conf: