[Pkg-shadow-commits] r2783 - in upstream/trunk: . lib

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Thu Apr 23 21:19:02 UTC 2009


Author: nekral-guest
Date: 2009-04-23 21:19:02 +0000 (Thu, 23 Apr 2009)
New Revision: 2783

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/lib/commonio.c
   upstream/trunk/lib/commonio.h
   upstream/trunk/lib/groupio.c
   upstream/trunk/lib/groupio.h
   upstream/trunk/lib/pwio.c
   upstream/trunk/lib/pwio.h
   upstream/trunk/lib/shadowio.c
   upstream/trunk/lib/shadowio.h
Log:
	* 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).


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-23 20:46:01 UTC (rev 2782)
+++ upstream/trunk/ChangeLog	2009-04-23 21:19:02 UTC (rev 2783)
@@ -1,5 +1,14 @@
 2009-04-22  Nicolas François  <nicolas.francois at 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 at centraliens.net>
+
 	* lib/pwauth.c: Use a boolean for wipe_clear_pass and use_skey.
 	* lib/pwauth.c: Added splint annotations.
 	* lib/pwauth.c: Added brackets and parenthesis.

Modified: upstream/trunk/lib/commonio.c
===================================================================
--- upstream/trunk/lib/commonio.c	2009-04-23 20:46:01 UTC (rev 2782)
+++ upstream/trunk/lib/commonio.c	2009-04-23 21:19:02 UTC (rev 2783)
@@ -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 @@
  *
  *	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 @@
  *
  * 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;
 

Modified: upstream/trunk/lib/commonio.h
===================================================================
--- upstream/trunk/lib/commonio.h	2009-04-23 20:46:01 UTC (rev 2782)
+++ upstream/trunk/lib/commonio.h	2009-04-23 21:19:02 UTC (rev 2783)
@@ -141,11 +141,11 @@
 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 *,

Modified: upstream/trunk/lib/groupio.c
===================================================================
--- upstream/trunk/lib/groupio.c	2009-04-23 20:46:01 UTC (rev 2782)
+++ upstream/trunk/lib/groupio.c	2009-04-23 21:19:02 UTC (rev 2783)
@@ -141,12 +141,12 @@
 	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 @@
 	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);
 }

Modified: upstream/trunk/lib/groupio.h
===================================================================
--- upstream/trunk/lib/groupio.h	2009-04-23 20:46:01 UTC (rev 2782)
+++ upstream/trunk/lib/groupio.h	2009-04-23 21:19:02 UTC (rev 2783)
@@ -39,12 +39,12 @@
 #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);

Modified: upstream/trunk/lib/pwio.c
===================================================================
--- upstream/trunk/lib/pwio.c	2009-04-23 20:46:01 UTC (rev 2782)
+++ upstream/trunk/lib/pwio.c	2009-04-23 21:19:02 UTC (rev 2783)
@@ -123,12 +123,12 @@
 	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 @@
 	return commonio_rewind (&passwd_db);
 }
 
-const struct passwd *pw_next (void)
+/*@observer@*/ /*@null@*/const struct passwd *pw_next (void)
 {
 	return commonio_next (&passwd_db);
 }

Modified: upstream/trunk/lib/pwio.h
===================================================================
--- upstream/trunk/lib/pwio.h	2009-04-23 20:46:01 UTC (rev 2782)
+++ upstream/trunk/lib/pwio.h	2009-04-23 21:19:02 UTC (rev 2783)
@@ -39,12 +39,12 @@
 #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);

Modified: upstream/trunk/lib/shadowio.c
===================================================================
--- upstream/trunk/lib/shadowio.c	2009-04-23 20:46:01 UTC (rev 2782)
+++ upstream/trunk/lib/shadowio.c	2009-04-23 21:19:02 UTC (rev 2783)
@@ -128,7 +128,7 @@
 	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 @@
 	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);
 }

Modified: upstream/trunk/lib/shadowio.h
===================================================================
--- upstream/trunk/lib/shadowio.h	2009-04-23 20:46:01 UTC (rev 2782)
+++ upstream/trunk/lib/shadowio.h	2009-04-23 21:19:02 UTC (rev 2783)
@@ -38,11 +38,11 @@
 
 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);




More information about the Pkg-shadow-commits mailing list