summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r--pw/pw_user.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c
index e8a3b07..925c86c 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -587,9 +587,12 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
}
if ((arg = getarg(args, 'h')) != NULL) {
- if (strcmp(arg->val, "-") == 0)
- pwd->pw_passwd = "*"; /* No access */
- else {
+ if (strcmp(arg->val, "-") == 0) {
+ if (!pwd->pw_passwd || *pwd->pw_passwd != '*') {
+ pwd->pw_passwd = "*"; /* No access */
+ edited = 1;
+ }
+ } else {
int fd = atoi(arg->val);
int b;
int istty = isatty(fd);