Hacker News new | ask | show | jobs
by LukeShu 3491 days ago
The problem isn't really that they used strace+id, it's that they abbreviated the output a bit too much. A better clipping would have been:

    $ strace -e open id 1000   
    ...
    open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
    ...
    open("/usr/lib/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 3
    ...
    open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
    open("/etc/group", O_RDONLY|O_CLOEXEC)  = 3
    ...
Where nsswitch.conf informs it how to look up the information; the default on most systems being

    passwd: files
    group: files
which tells it to the functions in /usr/lib/libnss_files.so to access the "passwd" (user) and "group" databases. libnss_files.so uses /etc/passwd and /etc/group respectively for these.