From 2beb8074e6d6662d92adb15321b33c20310152bd Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 12 Nov 2014 22:27:53 +0000 Subject: Fix wrong message when using pw -V with a non existent directory Add a regression test about it PR: 194971 Submitted by: Freddy DISSAUX --- pw/pw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pw/pw.c b/pw/pw.c index b0ac728..ff48db7 100644 --- a/pw/pw.c +++ b/pw/pw.c @@ -98,6 +98,7 @@ main(int argc, char *argv[]) int which = -1; char *config = NULL; struct userconf *cnf; + struct stat st; static const char *opts[W_NUM][M_NUM] = { @@ -143,6 +144,13 @@ main(int argc, char *argv[]) if (argv[1][1] == 'V') { optarg = &argv[1][2]; if (*optarg == '\0') { + if (stat(argv[2], &st) != 0) + errx(EX_OSFILE, \ + "no such directory `%s'", + argv[2]); + if (!S_ISDIR(st.st_mode)) + errx(EX_OSFILE, "`%s' not a " + "directory", argv[2]); optarg = argv[2]; ++argv; --argc; -- cgit v1.2.3 From 26a64428b0aaec32f653b6fb9955c7f132b7737e Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Mon, 24 Nov 2014 21:49:01 +0000 Subject: Convert to LIBADD. Reviewed by: bapt --- pw/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pw/Makefile b/pw/Makefile index 8c5acf9..269b145 100644 --- a/pw/Makefile +++ b/pw/Makefile @@ -8,8 +8,7 @@ SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \ WARNS?= 2 -DPADD= ${LIBCRYPT} ${LIBUTIL} -LDADD= -lcrypt -lutil +LIBADD= crypt util .include -- cgit v1.2.3 From f3f1481c2b79a9f8747738acd08571ab4c50eb3a Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Tue, 25 Nov 2014 14:29:10 +0000 Subject: Convert to usr.bin/ to LIBADD Reduce overlinking --- chpass/Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/chpass/Makefile b/chpass/Makefile index cf3acc6..9b3e878 100644 --- a/chpass/Makefile +++ b/chpass/Makefile @@ -16,11 +16,9 @@ CFLAGS+= -DYP #CFLAGS+=-DRESTRICT_FULLNAME_CHANGE CFLAGS+=-I${.CURDIR}/../../usr.sbin/pwd_mkdb -I${.CURDIR}/../../lib/libc/gen -I. -DPADD= ${LIBCRYPT} ${LIBUTIL} -LDADD= -lcrypt -lutil +LIBADD= crypt util .if ${MK_NIS} != "no" -DPADD+= ${LIBYPCLNT} -LDADD+= -lypclnt +LIBADD+= ypclnt .endif LINKS= ${BINDIR}/chpass ${BINDIR}/chfn -- cgit v1.2.3