Skip to content

nwrap_files_cache_reload: avoid error on EBADF during stat

TJ Miller requested to merge teejaded/nss_wrapper:closed-handles-fix into master

We have a daemon that double forks then execs a process. Apparently, the child process closes all the open file handles before forking the grandchild. We were seeing the following logs before I applied this patch.

NWRAP_ERROR(223) - nwrap_files_cache_reload: fstat(/opt/aspera/etc/passwd) - -1:Bad file descriptor
NWRAP_ERROR(223) - nwrap_files_getpwuid: Error loading passwd file

Merge request reports