summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/idvec-verify.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1998-10-20 08:38:41 +0000
committerRoland McGrath <roland@gnu.org>1998-10-20 08:38:41 +0000
commitfc40a731d23f893be2cb7699d7e078568d4c210c (patch)
tree9f1c90570e03a7c4082bee3fca2ced1755ac98a0 /libshouldbeinlibc/idvec-verify.c
parent6b0d5d23a26adea266903f285f7424a2f93863cb (diff)
Add braces to silence gcc warnings.
Diffstat (limited to 'libshouldbeinlibc/idvec-verify.c')
-rw-r--r--libshouldbeinlibc/idvec-verify.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/libshouldbeinlibc/idvec-verify.c b/libshouldbeinlibc/idvec-verify.c
index 7cd8b9a5..11ab2c22 100644
--- a/libshouldbeinlibc/idvec-verify.c
+++ b/libshouldbeinlibc/idvec-verify.c
@@ -1,6 +1,6 @@
/* Verify user passwords
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -260,19 +260,21 @@ verify_id (uid_t id, int is_group, int multiple,
}
}
if (! name)
- /* [ug]id lookup failed! */
- if (id != 0 || is_group)
- /* If ID != 0, then it's probably just an unknown id, so ask for
- the root password instead -- root should be able to do
- anything. */
- {
- id = 0; /* Root */
- is_group = 0; /* uid */
- multiple = 1; /* Explicitly ask for root's password. */
- }
- else
- /* No password entry for root. */
- name = "root";
+ {
+ /* [ug]id lookup failed! */
+ if (id != 0 || is_group)
+ /* If ID != 0, then it's probably just an unknown id, so ask for
+ the root password instead -- root should be able to do
+ anything. */
+ {
+ id = 0; /* Root */
+ is_group = 0; /* uid */
+ multiple = 1; /* Explicitly ask for root's password. */
+ }
+ else
+ /* No password entry for root. */
+ name = "root";
+ }
}
while (! name);
@@ -284,12 +286,14 @@ verify_id (uid_t id, int is_group, int multiple,
assert (verify_fn);
if (multiple)
- if (name)
- asprintf (&prompt, "Password for %s%s:",
- is_group ? "group " : "", name);
- else
- asprintf (&prompt, "Password for %s %d:",
- is_group ? "group" : "user", id);
+ {
+ if (name)
+ asprintf (&prompt, "Password for %s%s:",
+ is_group ? "group " : "", name);
+ else
+ asprintf (&prompt, "Password for %s %d:",
+ is_group ? "group" : "user", id);
+ }
/* Prompt the user for the password. */
if (prompt)
@@ -298,7 +302,7 @@ verify_id (uid_t id, int is_group, int multiple,
(*getpass_fn) (prompt, id, is_group, pwd_or_grp, getpass_hook);
free (prompt);
}
- else
+ else
password =
(*getpass_fn) ("Password:", id, is_group, pwd_or_grp, getpass_hook);