summaryrefslogtreecommitdiffstats
path: root/bftw.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-02-06 23:18:11 -0500
committerTavian Barnes <tavianator@tavianator.com>2019-02-06 23:18:11 -0500
commit9009456c1ad07f8cd781c21c9d63bde354da7d41 (patch)
treef8e9bf1315fa77fa648ee28963a5b94cf7ea7a3f /bftw.c
parentd53a1b6b572370e303e42e9238abc458d4c22b64 (diff)
downloadbfs-9009456c1ad07f8cd781c21c9d63bde354da7d41.tar.xz
Fix -nouser/-nogroup error handling
The proper way to check for nonexistent users/groups is to set errno to 0 before the get{grg,pwu}id() call, and check it afterwards. On doing this, it becomes obvious that the call can fail if bftw() is using all the available FDs, so give them some ephemeral FDs. It would be ideal to read the user/group table only once, but this fixes the bug for now.
Diffstat (limited to 'bftw.c')
0 files changed, 0 insertions, 0 deletions