YP/NIS code: remove unnecessary endgrent() calls which can cause fail on next try over chroot (descriptor closed). getgrnam() used already handles endgrent() properly and honors _gr_stayopen. Automatically call setgroupent(1) when _pw_stayopen is set (for YP/NIS code).
YP/NIS code: remove unnecessary endgrent() calls which can cause fail on
next try over chroot (descriptor closed). getgrnam() used already handles
endgrent() properly and honors _gr_stayopen. Automatically call
setgroupent(1) when _pw_stayopen is set (for YP/NIS code).

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase