1 # $NetBSD: Makefile,v 1.11 2008/10/19 22:05:24 apb Exp $
4 WARNS?
= 1 # XXX: -Wsign-compare -Wcast-qual
8 CPPFLAGS
+= -DEXTENSIONS
-DPW_MKDB_ARGC
=2
12 LINKS
+= ${BINDIR}/user
${BINDIR}/useradd
13 LINKS
+= ${BINDIR}/user
${BINDIR}/userdel
14 LINKS
+= ${BINDIR}/user
${BINDIR}/usermod
15 LINKS
+= ${BINDIR}/user
${BINDIR}/group
16 LINKS
+= ${BINDIR}/user
${BINDIR}/groupadd
17 LINKS
+= ${BINDIR}/user
${BINDIR}/groupdel
18 LINKS
+= ${BINDIR}/user
${BINDIR}/groupmod
19 LINKS
+= ${BINDIR}/user
${BINDIR}/userinfo
20 LINKS
+= ${BINDIR}/user
${BINDIR}/groupinfo
23 MAN
= user
.8 useradd
.8 userdel
.8 usermod
.8 userinfo
.8 usermgmt.conf
.5
24 MAN
+= group
.8 groupadd
.8 groupdel
.8 groupmod
.8 groupinfo
.8
25 MLINKS
= useradd
.8 adduser
.8
27 # this target checks the built-in default group, and, if it doesn't exist,
30 @ln
-fs
${.OBJDIR
}/user
${.OBJDIR
}/group
; \
31 defgrp
=`${.OBJDIR}/user add -D | \
32 ${TOOL_AWK} '/^group/ { print $$2 }'`; \
33 if
${.OBJDIR
}/group
info -e
$$defgrp; then \
34 defgid
=`${.OBJDIR}/group info $$defgrp | \
35 ${TOOL_AWK} '/^gid/ { print $$2 }'`; \
38 while
[ $$defgid -gt
0 ]; do \
39 ${.OBJDIR
}/group
info -e
$$defgid || break
; \
40 defgid
=`expr $$defgid - 1`; \
42 if
[ $$defgid -eq
0 ]; then \
44 while
[ $$defgid -lt
60000 ]; do \
45 ${.OBJDIR
}/group
info -e
$$defgid || break
; \
46 defgid
=`expr $$defgid + 1`; \
48 if
[ $$defgid -eq
60000 ]; then \
49 echo
"No gids left"; \
53 ${.OBJDIR
}/group add
-g
$$defgid $$defgrp; \
55 echo
"Default group is $$defgrp ($$defgid):"; \
56 ${.OBJDIR
}/group
info $$defgrp
58 .
include <bsd.prog.mk
>
61 @echo
"No news is good news"
62 @echo
"1. Adding new user"
65 -.
/useradd
-m
-g
=uid test1.1
66 @echo
"2. Modifying new user"
67 -.
/${PROG} mod
-l test1.2 test1.1
68 @echo
"3. Deleting new user"
69 -.
/${PROG} del
-r test1.2
70 @echo
"4. Attempting to add an invalid user name - IGNORE ANY ERROR"
71 -.
/${PROG} add
-m test1
%1
72 @echo
"5. Bad usage - IGNORE ANY ERROR"
74 @echo
"6. Set range defaults"
75 -.
/${PROG} add
-D
-r4000.
.6000
77 @echo
"7. Get user information"
79 @echo
"8. Bad user name - IGNORE ANY ERROR"
80 -.
/${PROG} info test1
%1 || echo
"User not found"
81 @echo
"All tests completed"