]> granicus.if.org Git - shadow/commitdiff
* lib/commonio.c, lib/commonio.h, lib/groupio.c, lib/groupio.h,
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 23 Apr 2009 21:19:02 +0000 (21:19 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 23 Apr 2009 21:19:02 +0000 (21:19 +0000)
lib/pwio.c, lib/pwio.h, lib/shadowio.c, lib/shadowio.h: Added
splint annotations. The *_locate() and *_next() functions
currently return an observer. As the structure are often modified
by the caller, it could maybe be changed to exposed later. (and
non-const).

ChangeLog
lib/commonio.c
lib/commonio.h
lib/groupio.c
lib/groupio.h
lib/pwio.c
lib/pwio.h
lib/shadowio.c
lib/shadowio.h

index 369c68fbc81604f4cdc66ccdba13a02a28bcf037..07d1ca6eefb9e7745904f8ac3b20ddd029b15c03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-04-22  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * lib/commonio.c, lib/commonio.h, lib/groupio.c, lib/groupio.h,
+       lib/pwio.c, lib/pwio.h, lib/shadowio.c, lib/shadowio.h: Added
+       splint annotations. The *_locate() and *_next() functions
+       currently return an observer. As the structure are often modified
+       by the caller, it could maybe be changed to exposed later. (and
+       non-const)
+
 2009-04-22  Nicolas François  <nicolas.francois@centraliens.net>
 
        * lib/pwauth.c: Use a boolean for wipe_clear_pass and use_skey.
index 77e46a95f0b5e808c505052746bdee170f773f70..5cfd9babb2aad626f6cb224962210e1b2952db58 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1990 - 1994, Julianne Frances Haugh
  * Copyright (c) 1996 - 2001, Marek Michałkiewicz
  * Copyright (c) 2001 - 2006, 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
@@ -1025,7 +1025,7 @@ int commonio_remove (struct commonio_db *db, const char *name)
  *
  *     Otherwise, it returns NULL.
  */
-/*@null@*/const void *commonio_locate (struct commonio_db *db, const char *name)
+/*@observer@*/ /*@null@*/const void *commonio_locate (struct commonio_db *db, const char *name)
 {
        struct commonio_entry *p;
 
@@ -1062,7 +1062,7 @@ int commonio_rewind (struct commonio_db *db)
  *
  * It returns the next entry, or NULL if no other entries could be found.
  */
-/*@null@*/const void *commonio_next (struct commonio_db *db)
+/*@observer@*/ /*@null@*/const void *commonio_next (struct commonio_db *db)
 {
        void *eptr;
 
index 668318abbca3d55c00e18f98288f6808c735be23..f9ece77e722f817465fdd4f8104de80c015d987e 100644 (file)
@@ -141,11 +141,11 @@ extern bool commonio_present (const struct commonio_db *db);
 extern int commonio_lock (struct commonio_db *);
 extern int commonio_lock_nowait (struct commonio_db *);
 extern int commonio_open (struct commonio_db *, int);
-extern /*@null@*/const void *commonio_locate (struct commonio_db *, const char *);
+extern /*@observer@*/ /*@null@*/const void *commonio_locate (struct commonio_db *, const char *);
 extern int commonio_update (struct commonio_db *, const void *);
 extern int commonio_remove (struct commonio_db *, const char *);
 extern int commonio_rewind (struct commonio_db *);
-extern /*@null@*/const void *commonio_next (struct commonio_db *);
+extern /*@observer@*/ /*@null@*/const void *commonio_next (struct commonio_db *);
 extern int commonio_close (struct commonio_db *);
 extern int commonio_unlock (struct commonio_db *);
 extern void commonio_del_entry (struct commonio_db *,
index 72b5c9499fe4b957353311d726374e72b8eb8ce1..fe57d27e105395e74b22839d4804e5935000e7ff 100644 (file)
@@ -141,12 +141,12 @@ int gr_open (int mode)
        return commonio_open (&group_db, mode);
 }
 
-/*@null@*/const struct group *gr_locate (const char *name)
+/*@observer@*/ /*@null@*/const struct group *gr_locate (const char *name)
 {
        return commonio_locate (&group_db, name);
 }
 
-/*@null@*/const struct group *gr_locate_gid (gid_t gid)
+/*@observer@*/ /*@null@*/const struct group *gr_locate_gid (gid_t gid)
 {
        const struct group *grp;
 
@@ -173,7 +173,7 @@ int gr_rewind (void)
        return commonio_rewind (&group_db);
 }
 
-/*@null@*/const struct group *gr_next (void)
+/*@observer@*/ /*@null@*/const struct group *gr_next (void)
 {
        return commonio_next (&group_db);
 }
index 4edb6a89569618a46506ba990e127f189dcec47d..e1f1b029430a34af1a5fd1beaa8cbd40e955d5dc 100644 (file)
 #include <grp.h>
 
 extern int gr_close (void);
-extern /*@null@*/const struct group *gr_locate (const char *name);
-extern /*@null@*/const struct group *gr_locate_gid (gid_t gid);
+extern /*@observer@*/ /*@null@*/const struct group *gr_locate (const char *name);
+extern /*@observer@*/ /*@null@*/const struct group *gr_locate_gid (gid_t gid);
 extern int gr_lock (void);
 extern int gr_setdbname (const char *filename);
 extern /*@observer@*/const char *gr_dbname (void);
-extern /*@null@*/const struct group *gr_next (void);
+extern /*@observer@*/ /*@null@*/const struct group *gr_next (void);
 extern int gr_open (int mode);
 extern int gr_remove (const char *name);
 extern int gr_rewind (void);
index 0489548a2417695cd3e5e85b5212d613ba2cdaf8..fc6d8af44a946753ca7ce92081a5992c28080e60 100644 (file)
@@ -123,12 +123,12 @@ int pw_open (int mode)
        return commonio_open (&passwd_db, mode);
 }
 
-const struct passwd *pw_locate (const char *name)
+/*@observer@*/ /*@null@*/const struct passwd *pw_locate (const char *name)
 {
        return commonio_locate (&passwd_db, name);
 }
 
-const struct passwd *pw_locate_uid (uid_t uid)
+/*@observer@*/ /*@null@*/const struct passwd *pw_locate_uid (uid_t uid)
 {
        const struct passwd *pwd;
 
@@ -155,7 +155,7 @@ int pw_rewind (void)
        return commonio_rewind (&passwd_db);
 }
 
-const struct passwd *pw_next (void)
+/*@observer@*/ /*@null@*/const struct passwd *pw_next (void)
 {
        return commonio_next (&passwd_db);
 }
index 4b241f2673d08c5a00b407e95fb2f5e966b8249c..2db85e016b685f6a15781ce7826325dbd422856c 100644 (file)
 #include <pwd.h>
 
 extern int pw_close (void);
-extern /*@null@*/const struct passwd *pw_locate (const char *name);
-extern /*@null@*/const struct passwd *pw_locate_uid (uid_t uid);
+extern /*@observer@*/ /*@null@*/const struct passwd *pw_locate (const char *name);
+extern /*@observer@*/ /*@null@*/const struct passwd *pw_locate_uid (uid_t uid);
 extern int pw_lock (void);
 extern int pw_setdbname (const char *filename);
 extern /*@observer@*/const char *pw_dbname (void);
-extern /*@null@*/const struct passwd *pw_next (void);
+extern /*@observer@*/ /*@null@*/const struct passwd *pw_next (void);
 extern int pw_open (int mode);
 extern int pw_remove (const char *name);
 extern int pw_rewind (void);
index 7921c9963026c4dd9fc7962b554d24bc12bb2500..9ea6a55b0356b7f3cb1ff83fe73d8331466f12a6 100644 (file)
@@ -128,7 +128,7 @@ int spw_open (int mode)
        return commonio_open (&shadow_db, mode);
 }
 
-/*@null@*/const struct spwd *spw_locate (const char *name)
+/*@observer@*/ /*@null@*/const struct spwd *spw_locate (const char *name)
 {
        return commonio_locate (&shadow_db, name);
 }
@@ -148,7 +148,7 @@ int spw_rewind (void)
        return commonio_rewind (&shadow_db);
 }
 
-/*@null@*/const struct spwd *spw_next (void)
+/*@observer@*/ /*@null@*/const struct spwd *spw_next (void)
 {
        return commonio_next (&shadow_db);
 }
index a8b9cae558af2698e5dc56cc6ea0b301a4d5cc78..229dfdb472831843f2a9a6369a0def2b6b9be78d 100644 (file)
 
 extern int spw_close (void);
 extern bool spw_file_present (void);
-extern /*@null@*/const struct spwd *spw_locate (const char *name);
+extern /*@observer@*/ /*@null@*/const struct spwd *spw_locate (const char *name);
 extern int spw_lock (void);
 extern int spw_setdbname (const char *filename);
 extern /*@observer@*/const char *spw_dbname (void);
-extern /*@null@*/const struct spwd *spw_next (void);
+extern /*@observer@*/ /*@null@*/const struct spwd *spw_next (void);
 extern int spw_open (int mode);
 extern int spw_remove (const char *name);
 extern int spw_rewind (void);