diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-06-07 15:33:08 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-06-07 15:33:08 +0000 |
commit | 8b4eba30cac45e27a97d4e86a8e8506b0e8dc318 (patch) | |
tree | 1517bd7a6d2d2b9ded925850988be3bcdd4bcd3e /pw/pw_user.c | |
parent | 98e6bc31dc6985604ba6aa31a3c58fcb3f077127 (diff) | |
download | pw-darwin-8b4eba30cac45e27a97d4e86a8e8506b0e8dc318.tar.gz pw-darwin-8b4eba30cac45e27a97d4e86a8e8506b0e8dc318.tar.zst pw-darwin-8b4eba30cac45e27a97d4e86a8e8506b0e8dc318.zip |
Handle -7 via gloval pwconf
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r-- | pw/pw_user.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c index bfbde78..0fc7272 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -53,7 +53,7 @@ static char locked_str[] = "*LOCKED*"; static int delete_user(struct userconf *cnf, struct passwd *pwd, struct carg *a_name, int delete, int mode); -static int print_user(struct passwd * pwd, int v7); +static int print_user(struct passwd * pwd); static uid_t pw_uidpolicy(struct userconf * cnf, struct cargs * args); static uid_t pw_gidpolicy(struct cargs * args, char *nam, gid_t prefer); static time_t pw_pwdpolicy(struct userconf * cnf, struct cargs * args); @@ -316,10 +316,9 @@ pw_user(int mode, struct cargs * args) } if (mode == M_PRINT && getarg(args, 'a')) { - int v7 = getarg(args, '7') != NULL; SETPWENT(); while ((pwd = GETPWENT()) != NULL) - print_user(pwd, v7); + print_user(pwd); ENDPWENT(); return EXIT_SUCCESS; } @@ -1161,15 +1160,15 @@ delete_user(struct userconf *cnf, struct passwd *pwd, struct carg *a_name, } static int -print_user(struct passwd * pwd, int v7) +print_user(struct passwd * pwd) { if (!conf.pretty) { char *buf; - if (!v7) + if (!conf.v7) pwd->pw_passwd = (pwd->pw_passwd == NULL) ? "" : "*"; - buf = v7 ? pw_make_v7(pwd) : pw_make(pwd); + buf = conf.v7 ? pw_make_v7(pwd) : pw_make(pwd); printf("%s\n", buf); free(buf); } else { |