* 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).
This commit is contained in:
nekral-guest 2009-04-23 21:19:02 +00:00
parent d0d01ffb00
commit 6e357e14fc
9 changed files with 30 additions and 21 deletions

View File

@ -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.

View 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;

View 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 *,

View 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);
}

View File

@ -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);

View 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);
}

View File

@ -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);

View 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);
}

View File

@ -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);