]> granicus.if.org Git - shadow/commitdiff
* libmisc/find_new_gid.c, libmisc/find_new_uid.c,
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 23 Apr 2009 17:43:27 +0000 (17:43 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 23 Apr 2009 17:43:27 +0000 (17:43 +0000)
libmisc/isexpired.c, src/groupadd.c, lib/pwauth.h, lib/groupmem.c,
lib/shadowmem.c, lib/pwmem.c, lib/prototypes.h: Added splint
annotations.

ChangeLog
lib/groupmem.c
lib/prototypes.h
lib/pwauth.h
lib/pwmem.c
lib/shadowmem.c
libmisc/find_new_gid.c
libmisc/find_new_uid.c
libmisc/isexpired.c
src/groupadd.c

index 6caf58f7b2a01f00032ef21a5f10a0249a36f29b..7bb0156e75b57b7e2a8485e8ba532675265974fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-22  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * libmisc/find_new_gid.c, libmisc/find_new_uid.c,
+       libmisc/isexpired.c, src/groupadd.c, lib/pwauth.h, lib/groupmem.c,
+       lib/shadowmem.c, lib/pwmem.c, lib/prototypes.h: Added splint
+       annotations.
+
 2009-04-22  Nicolas François  <nicolas.francois@centraliens.net>
 
        * libmisc/loginprompt.c: Use exit(EXIT_FAILURE) instead of
index 56f198e8e643c70d13507cdb2f847caec2664063..cfd4f17941ccbe1237881c003b507405454e7038 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (c) 1996 - 2000, Marek Michałkiewicz
  * Copyright (c) 2001       , Michał Moskal
  * Copyright (c) 2005       , Tomasz Kłoczko
- * Copyright (c) 2007       , Nicolas François
+ * Copyright (c) 2007 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
 #include "defines.h"
 #include "groupio.h"
 
-struct group *__gr_dup (const struct group *grent)
+/*@null@*/ /*@only@*/struct group *__gr_dup (const struct group *grent)
 {
        struct group *gr;
        int i;
@@ -75,7 +75,7 @@ struct group *__gr_dup (const struct group *grent)
        return gr;
 }
 
-void gr_free (struct group *grent)
+void gr_free (/*@out@*/ /*@only@*/struct group *grent)
 {
        free (grent->gr_name);
        memzero (grent->gr_passwd, strlen (grent->gr_passwd));
index cd0044bd096620d786a2309caaeee48267ac8c3d..205aae1fe7a74c502576222d4e447260adf0970a 100644 (file)
@@ -66,8 +66,9 @@ extern int add_groups (const char *);
 
 /* age.c */
 extern void agecheck (/*@null@*/const struct spwd *);
-extern int expire (const struct passwd *, const struct spwd *);
-extern int isexpired (const struct passwd *, const struct spwd *);
+extern int expire (const struct passwd *, /*@null@*/const struct spwd *);
+/* isexpired.c */
+extern int isexpired (const struct passwd *, /*@null@*/const struct spwd *);
 
 /* basename() renamed to Basename() to avoid libc name space confusion */
 /* basename.c */
@@ -129,7 +130,7 @@ extern char *pw_encrypt (const char *, const char *);
 extern void pw_entry (const char *, struct passwd *);
 
 /* env.c */
-extern void addenv (const char *, const char *);
+extern void addenv (const char *, /*@null@*/const char *);
 extern void initenv (void);
 extern void set_env (int, char *const *);
 extern void sanitize_env (void);
@@ -139,10 +140,14 @@ extern void change_field (char *, size_t, const char *);
 extern int valid_field (const char *, const char *);
 
 /* find_new_gid.c */
-extern int find_new_gid (bool sys_group, gid_t *gid, gid_t const *preferred_gid);
+extern int find_new_gid (bool sys_group,
+                         gid_t *gid,
+                         /*@null@*/gid_t const *preferred_gid);
 
 /* find_new_uid.c */
-extern int find_new_uid (bool sys_user, uid_t *uid, uid_t const *preferred_uid);
+extern int find_new_uid (bool sys_user,
+                         uid_t *uid,
+                         /*@null@*/uid_t const *preferred_uid);
 
 /* get_gid.c */
 extern int get_gid (const char *gidstr, gid_t *gid);
index 140eef3751afb5d867a92f43cf4b93788f541f56..d6c71dda1a3f5d774e379907c8aa86a7d561a035 100644 (file)
@@ -2,6 +2,7 @@
  * Copyright (c) 1992 - 1993, Julianne Frances Haugh
  * Copyright (c) 1996 - 1997, Marek Michałkiewicz
  * Copyright (c) 2003 - 2005, Tomasz Kłoczko
+ * Copyright (c) 2009       , Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  */
 
 #ifndef USE_PAM
-int pw_auth (const char *cipher, const char *user, int flag, const char *input);
+int pw_auth (const char *cipher,
+             const char *user,
+             int flag,
+             /*@null@*/const char *input);
 #endif                         /* !USE_PAM */
 
 /*
index d9bed3a23058138bd6b673c483d5cbd5811bc1bd..9889f65715c703f2f8bc69769cc4430704ec8b1d 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (c) 1996 - 2000, Marek Michałkiewicz
  * Copyright (c) 2001       , Michał Moskal
  * Copyright (c) 2003 - 2005, Tomasz Kłoczko
- * Copyright (c) 2007       , Nicolas François
+ * Copyright (c) 2007 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@
 #include "prototypes.h"
 #include "pwio.h"
 
-struct passwd *__pw_dup (const struct passwd *pwent)
+/*@null@*/ /*@only@*/struct passwd *__pw_dup (const struct passwd *pwent)
 {
        struct passwd *pw;
 
@@ -73,7 +73,7 @@ struct passwd *__pw_dup (const struct passwd *pwent)
        return pw;
 }
 
-void pw_free (struct passwd *pwent)
+void pw_free (/*@out@*/ /*@only@*/struct passwd *pwent)
 {
        free (pwent->pw_name);
        memzero (pwent->pw_passwd, strlen (pwent->pw_passwd));
index d4abdf15bedbce748b0625b6e382f42ed7d33083..51e17c85715b21d98b7afbf31a1ddc4c72cdf944 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (c) 1996 - 2000, Marek Michałkiewicz
  * Copyright (c) 2001       , Michał Moskal
  * Copyright (c) 2005       , Tomasz Kłoczko
- * Copyright (c) 2007 - 2008, Nicolas François
+ * Copyright (c) 2007 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
 #include <stdio.h>
 #include "shadowio.h"
 
-struct spwd *__spw_dup (const struct spwd *spent)
+/*@null@*/ /*@only@*/struct spwd *__spw_dup (const struct spwd *spent)
 {
        struct spwd *sp;
 
@@ -62,7 +62,7 @@ struct spwd *__spw_dup (const struct spwd *spent)
        return sp;
 }
 
-void spw_free (struct spwd *spent)
+void spw_free (/*@out@*/ /*@only@*/struct spwd *spent)
 {
        free (spent->sp_namp);
        memzero (spent->sp_pwdp, strlen (spent->sp_pwdp));
index feb735fab0910cd53cc14429cd4c4d0cc46805a4..5c260b720e47a8299de5e87b475365edaa4f0d40 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 1991 - 1994, Julianne Frances Haugh
- * Copyright (c) 2008       , Nicolas François
+ * Copyright (c) 2008 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,9 @@
  * 
  * Return 0 on success, -1 if no unused GIDs are available.
  */
-int find_new_gid (bool sys_group, gid_t *gid, gid_t const *preferred_gid)
+int find_new_gid (bool sys_group,
+                  gid_t *gid,
+                  /*@null@*/gid_t const *preferred_gid)
 {
        const struct group *grp;
        gid_t gid_min, gid_max, group_id;
index edf2d8bd79f8683ae362141a1120f6e5ccfd17b1..74f5709c2b98ac306fc55c42a90063f1831e82ac 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 1991 - 1994, Julianne Frances Haugh
- * Copyright (c) 2008       , Nicolas François
+ * Copyright (c) 2008 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,9 @@
  * 
  * Return 0 on success, -1 if no unused UIDs are available.
  */
-int find_new_uid (bool sys_user, uid_t *uid, uid_t const *preferred_uid)
+int find_new_uid (bool sys_user,
+                  uid_t *uid,
+                  /*@null@*/uid_t const *preferred_uid)
 {
        const struct passwd *pwd;
        uid_t uid_min, uid_max, user_id;
index aad91c5e349ae0bf40d5c81de3edfe8171be7d04..416a21e4047268d95aad39cf5bba466cd3204a3a 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1989 - 1994, Julianne Frances Haugh
  * Copyright (c) 1996 - 1997, Marek Michałkiewicz
  * Copyright (c) 2001 - 2005, Tomasz Kłoczko
- * Copyright (c) 2008       , Nicolas François
+ * Copyright (c) 2008 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -59,7 +59,7 @@
  *        now disabled. (password cannot be changed)
  *     3: The account has expired
  */
-int isexpired (const struct passwd *pw, const struct spwd *sp)
+int isexpired (const struct passwd *pw, /*@null@*/const struct spwd *sp)
 {
        long now;
 
index b00e3cdc33e36a1ef98e8371cf3a21d5f14273d1..55de85e9ece5a36b25866986650f5079ea065426 100644 (file)
  */
 char *Prog;
 
-static char *group_name;
+static /*@null@*/char *group_name;
 static gid_t group_id;
-static char *group_passwd;
-static char *empty_list = NULL;
+static /*@null@*/char *group_passwd;
+static /*@null@*/char *empty_list = NULL;
 
 static bool oflg = false;      /* permit non-unique group ID to be specified with -g */
 static bool gflg = false;      /* ID value for the new group */
@@ -605,6 +605,6 @@ int main (int argc, char **argv)
        nscd_flush_cache ("group");
 
        exit (E_SUCCESS);
-       /* NOT REACHED */
+       /*@notreached@*/
 }