portmap(8) does not use setpassent(3) which is the only way of causing a
successful call to getpwnam(3) not to close the password database,
therefore the call to endpwent(3) seems to be unnecessary.
The following patch removes the call to endpwent(3):
Index: portmap.c
===================================================================
RCS file: /cvs/src/usr.sbin/portmap/portmap.c,v
retrieving revision 1.50
diff -u -p -r1.50 portmap.c
--- portmap.c 28 Jun 2019 13:32:49 -0000 1.50
+++ portmap.c 14 Jul 2019 15:29:27 -0000
@@ -245,7 +245,6 @@ main(int argc, char *argv[])
exit(1);
}
}
- endpwent();
if (pledge("stdio inet proc", NULL) == -1)
err(1, "pledge");