-/* $OpenBSD: getpwent.c,v 1.67 2024/01/22 17:21:52 deraadt Exp $ */
+/* $OpenBSD: getpwent.c,v 1.68 2024/01/22 21:07:09 deraadt Exp $ */
/*
* Copyright (c) 2008 Theo de Raadt
* Copyright (c) 1988, 1993
__ypmode = YPMODE_NONE;
__getpwent_has_yppw = -1;
#endif
- if (shadow)
+ if (shadow) {
+#ifdef FORCE_DBOPEN
+ _pw_db = dbopen(_PATH_SMP_DB, O_RDONLY, 0, DB_HASH, NULL);
+#else
_pw_db = __hash_open(_PATH_SMP_DB, O_RDONLY, 0, NULL, 0);
- if (!_pw_db)
+#endif
+ }
+ if (!_pw_db) {
+#ifdef FORCE_DBOPEN
+ _pw_db = dbopen(_PATH_MP_DB, O_RDONLY, 0, DB_HASH, NULL);
+#else
_pw_db = __hash_open(_PATH_MP_DB, O_RDONLY, 0, NULL, 0);
+#endif
+ }
if (_pw_db) {
errno = saved_errno;
return (1);
-# $OpenBSD: Makefile,v 1.15 2016/03/30 06:38:45 jmc Exp $
+# $OpenBSD: Makefile,v 1.16 2024/01/22 21:07:10 deraadt Exp $
.include <bsd.own.mk>
BINMODE=4555
.PATH: ${.CURDIR}/../../lib/libc/gen
LINKS= ${BINDIR}/chpass ${BINDIR}/chfn ${BINDIR}/chpass ${BINDIR}/chsh
-CFLAGS+=-I${.CURDIR}/../../lib/libc/include
+CFLAGS+=-I${.CURDIR}/../../lib/libc/include -DFORCE_DBOPEN
DPADD+= ${LIBUTIL}
LDADD+= -lutil
-# $OpenBSD: Makefile,v 1.41 2015/11/26 19:01:47 deraadt Exp $
+# $OpenBSD: Makefile,v 1.42 2024/01/22 21:07:10 deraadt Exp $
.include <bsd.own.mk>
.PATH: ${.CURDIR}/../../lib/libc/gen
DPADD+= ${LIBRPCSVC} ${LIBUTIL}
LDADD+= -lrpcsvc -lutil
-CFLAGS+= -I${.CURDIR}
+CFLAGS+= -I${.CURDIR} -DFORCE_DBOPEN
CFLAGS+=-I${.CURDIR}/../../lib/libc/include