~mdw
/
become
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0c6c5a9
)
Use `uid_t' instead of `int' for uids and gids. Not quite sure why I
author
mdw
<mdw>
Wed, 17 Sep 1997 10:24:08 +0000
(10:24 +0000)
committer
mdw
<mdw>
Wed, 17 Sep 1997 10:24:08 +0000
(10:24 +0000)
didn't do this before.
src/userdb.c
patch
|
blob
|
blame
|
history
diff --git
a/src/userdb.c
b/src/userdb.c
index
db5e44b
..
eb963d0
100644
(file)
--- a/
src/userdb.c
+++ b/
src/userdb.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: userdb.c,v 1.
4 1997/08/20 16:24:5
8 mdw Exp $
+ * $Id: userdb.c,v 1.
5 1997/09/17 10:24:0
8 mdw Exp $
*
* User database management
*
*
* User database management
*
@@
-29,7
+29,11
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: userdb.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: userdb.c,v $
- * Revision 1.4 1997/08/20 16:24:58 mdw
+ * Revision 1.5 1997/09/17 10:24:08 mdw
+ * Use `uid_t' instead of `int' for uids and gids. Not quite sure why I
+ * didn't do this before.
+ *
+ * Revision 1.4 1997/08/20 16:24:58 mdw
* Patch memory leak. Rename `userdb_reinit' to `userdb_end' for more
* sensible restart.
*
* Patch memory leak. Rename `userdb_reinit' to `userdb_end' for more
* sensible restart.
*
@@
-131,7
+135,7
@@
static void userdb__createMap(userdb__map *m)
*
* Arguments: @userdb__map *m@ = pointer to the map block
* @const char *name@ = pointer to the item's name
*
* Arguments: @userdb__map *m@ = pointer to the map block
* @const char *name@ = pointer to the item's name
- * @
in
t id@ = the item's id number
+ * @
uid_
t id@ = the item's id number
* @void *rec@ = pointer to the actual record
*
* Returns: ---
* @void *rec@ = pointer to the actual record
*
* Returns: ---
@@
-141,7
+145,7
@@
static void userdb__createMap(userdb__map *m)
static void userdb__addToMap(userdb__map *m,
const char *name,
static void userdb__addToMap(userdb__map *m,
const char *name,
-
in
t id, void *rec)
+
uid_
t id, void *rec)
{
unsigned f;
userdb__sym *s;
{
unsigned f;
userdb__sym *s;
@@
-180,14
+184,14
@@
static void *userdb__byName(userdb__map *m, const char *name)
/* --- @userdb__byId@ --- *
*
* Arguments: @userdb__map *m@ = pointer to a map block
/* --- @userdb__byId@ --- *
*
* Arguments: @userdb__map *m@ = pointer to a map block
- * @
in
t id@ = id number to find
+ * @
uid_
t id@ = id number to find
*
* Returns: A pointer to the appropriate block, or zero if not found.
*
* Use: Looks up an ID in a mapping, and returns the result.
*/
*
* Returns: A pointer to the appropriate block, or zero if not found.
*
* Use: Looks up an ID in a mapping, and returns the result.
*/
-static void *userdb__byId(userdb__map *m,
in
t id)
+static void *userdb__byId(userdb__map *m,
uid_
t id)
{
userdb__sym *s = sym_find(&m->idmap, (char *)&id, sizeof(id), 0, 0);
return (s ? s->rec : 0);
{
userdb__sym *s = sym_find(&m->idmap, (char *)&id, sizeof(id), 0, 0);
return (s ? s->rec : 0);
@@
-291,8
+295,8
@@
static struct passwd *userdb__buildUser(char *s)
s = strtok(s, ":"); if (!s) goto tidy_0; pw->pw_name = xstrdup(s);
s = strtok(0, ":"); if (!s) goto tidy_1; pw->pw_passwd = xstrdup(s);
s = strtok(s, ":"); if (!s) goto tidy_0; pw->pw_name = xstrdup(s);
s = strtok(0, ":"); if (!s) goto tidy_1; pw->pw_passwd = xstrdup(s);
- s = strtok(0, ":"); if (!s) goto tidy_2; pw->pw_uid =
atoi
(s);
- s = strtok(0, ":"); if (!s) goto tidy_2; pw->pw_gid =
atoi
(s);
+ s = strtok(0, ":"); if (!s) goto tidy_2; pw->pw_uid =
(uid_t)atol
(s);
+ s = strtok(0, ":"); if (!s) goto tidy_2; pw->pw_gid =
(gid_t)atol
(s);
s = strtok(0, ":"); if (!s) goto tidy_2; pw->pw_gecos = xstrdup(s);
s = strtok(0, ":"); if (!s) goto tidy_3; pw->pw_dir = xstrdup(s);
s = strtok(0, ":"); if (!s) goto tidy_4; pw->pw_shell = xstrdup(s);
s = strtok(0, ":"); if (!s) goto tidy_2; pw->pw_gecos = xstrdup(s);
s = strtok(0, ":"); if (!s) goto tidy_3; pw->pw_dir = xstrdup(s);
s = strtok(0, ":"); if (!s) goto tidy_4; pw->pw_shell = xstrdup(s);
@@
-419,7
+423,7
@@
static struct group *userdb__buildGroup(char *s)
s = strtok(s, ":"); if (!s) goto tidy_0; gr->gr_name = xstrdup(s);
s = strtok(0, ":"); if (!s) goto tidy_1; gr->gr_passwd = xstrdup(s);
s = strtok(s, ":"); if (!s) goto tidy_0; gr->gr_name = xstrdup(s);
s = strtok(0, ":"); if (!s) goto tidy_1; gr->gr_passwd = xstrdup(s);
- s = strtok(0, ":"); if (!s) goto tidy_2; gr->gr_gid =
atoi
(s);
+ s = strtok(0, ":"); if (!s) goto tidy_2; gr->gr_gid =
(gid_t)atol
(s);
/* --- Find the start of the member list --- */
/* --- Find the start of the member list --- */