summaryrefslogtreecommitdiffstats
path: root/docs/manual
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2016-01-21 22:23:37 +0100
committerPeter Korsgaard <peter@korsgaard.com>2016-02-01 08:02:00 +0100
commit95dda394d9f2487d54c6ec529c3f9a7fd341a582 (patch)
tree4e3d9d842e8eda036b4dca0bc2d46810a23893d5 /docs/manual
parent3f28a38e1ab4c7556be0b5ec059dd78302e0884a (diff)
downloadbuildroot-95dda394d9f2487d54c6ec529c3f9a7fd341a582.tar.gz
buildroot-95dda394d9f2487d54c6ec529c3f9a7fd341a582.zip
package/makedevs: use the rooted /etc/passwd and /etc/group
Currently, makedevs will query the host's /etc/passwd and /etc/group to resolve usernames and group names. This is inherently flawed, as we can never guarantee that the UIDs will be the same on the target as on the host, or even whether a particular user does exist on the host. This is because getpwnam() and getgrnam() will forcibly read the system's /etc/passwd and /etc/group, and there is no way to tell them to look anywhere else. However, we can use fgetpwent() and fgetgrent() instead, for which we can pass a FILE* stream to read from to get the entries. This means we must implement the scanning-loop ourselves, but fortunately, that's pretty trivial to do. [Peter: swap errno / return value check, use bb_perror_msg_and_die, code style] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'docs/manual')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud