2008-04-27 06:10:09 +05:30
|
|
|
/*
|
|
|
|
* Copyright (c) 1990 - 1994, Julianne Frances Haugh
|
|
|
|
* 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
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. The name of the copyright holders or contributors may not be used to
|
|
|
|
* endorse or promote products derived from this software without
|
|
|
|
* specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
|
|
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef SHADOWGRP
|
|
|
|
|
2007-11-11 05:16:11 +05:30
|
|
|
#ident "$Id$"
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:14:02 +05:30
|
|
|
#include "prototypes.h"
|
|
|
|
#include "defines.h"
|
|
|
|
#include "commonio.h"
|
|
|
|
#include "sgroupio.h"
|
|
|
|
|
* libmisc/xgetXXbyYY.c, libmisc/myname.c, libmisc/getgr_nam_gid.c,
libmisc/salt.c, libmisc/list.c, libmisc/cleanup.c, src/login.c,
lib/getdef.h, lib/groupio.c, lib/getlong.c, lib/gshadow_.h,
lib/sgroupio.c, lib/shadowio.c, lib/pwio.c, lib/commonio.h,
lib/fputsx.c, lib/prototypes.h: Added splint annotations.
* lib/groupio.c: Avoid implicit conversion of pointers to
booleans.
* lib/groupio.c: Free allocated buffers in case of failure.
2009-04-23 15:27:03 +05:30
|
|
|
/*@null@*/ /*@only@*/struct sgrp *__sgr_dup (const struct sgrp *sgent)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
struct sgrp *sg;
|
|
|
|
int i;
|
|
|
|
|
2008-05-26 14:16:41 +05:30
|
|
|
sg = (struct sgrp *) malloc (sizeof *sg);
|
|
|
|
if (NULL == sg) {
|
2007-10-07 17:14:02 +05:30
|
|
|
return NULL;
|
2008-05-26 14:16:41 +05:30
|
|
|
}
|
|
|
|
sg->sg_name = strdup (sgent->sg_name);
|
|
|
|
if (NULL == sg->sg_name) {
|
2009-04-25 05:02:52 +05:30
|
|
|
free (sg);
|
2007-10-07 17:14:02 +05:30
|
|
|
return NULL;
|
2008-05-26 14:16:41 +05:30
|
|
|
}
|
|
|
|
sg->sg_passwd = strdup (sgent->sg_passwd);
|
|
|
|
if (NULL == sg->sg_passwd) {
|
2009-04-25 05:02:52 +05:30
|
|
|
free (sg->sg_name);
|
|
|
|
free (sg);
|
2007-10-07 17:14:02 +05:30
|
|
|
return NULL;
|
2008-05-26 14:16:41 +05:30
|
|
|
}
|
2007-10-07 17:14:02 +05:30
|
|
|
|
2008-05-26 14:16:41 +05:30
|
|
|
for (i = 0; NULL != sgent->sg_adm[i]; i++);
|
2007-10-07 17:16:07 +05:30
|
|
|
sg->sg_adm = (char **) malloc ((i + 1) * sizeof (char *));
|
2008-05-26 14:16:41 +05:30
|
|
|
if (NULL == sg->sg_adm) {
|
2009-04-25 05:02:52 +05:30
|
|
|
free (sg->sg_passwd);
|
|
|
|
free (sg->sg_name);
|
|
|
|
free (sg);
|
2007-10-07 17:14:02 +05:30
|
|
|
return NULL;
|
2008-05-26 14:16:41 +05:30
|
|
|
}
|
|
|
|
for (i = 0; NULL != sgent->sg_adm[i]; i++) {
|
2007-10-07 17:16:07 +05:30
|
|
|
sg->sg_adm[i] = strdup (sgent->sg_adm[i]);
|
2008-05-26 14:16:41 +05:30
|
|
|
if (NULL == sg->sg_adm[i]) {
|
2009-04-25 05:02:52 +05:30
|
|
|
for (i = 0; NULL != sg->sg_adm[i]; i++) {
|
|
|
|
free (sg->sg_adm[i]);
|
|
|
|
}
|
|
|
|
free (sg->sg_adm);
|
|
|
|
free (sg->sg_passwd);
|
|
|
|
free (sg->sg_name);
|
|
|
|
free (sg);
|
2007-10-07 17:14:02 +05:30
|
|
|
return NULL;
|
2008-05-26 14:16:41 +05:30
|
|
|
}
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
sg->sg_adm[i] = NULL;
|
|
|
|
|
2008-05-26 14:16:41 +05:30
|
|
|
for (i = 0; NULL != sgent->sg_mem[i]; i++);
|
2007-10-07 17:16:07 +05:30
|
|
|
sg->sg_mem = (char **) malloc ((i + 1) * sizeof (char *));
|
2008-05-26 14:16:41 +05:30
|
|
|
if (NULL == sg->sg_mem) {
|
2009-04-25 05:02:52 +05:30
|
|
|
for (i = 0; NULL != sg->sg_adm[i]; i++) {
|
|
|
|
free (sg->sg_adm[i]);
|
|
|
|
}
|
|
|
|
free (sg->sg_adm);
|
|
|
|
free (sg->sg_passwd);
|
|
|
|
free (sg->sg_name);
|
|
|
|
free (sg);
|
2007-10-07 17:14:02 +05:30
|
|
|
return NULL;
|
2008-05-26 14:16:41 +05:30
|
|
|
}
|
|
|
|
for (i = 0; NULL != sgent->sg_mem[i]; i++) {
|
2007-10-07 17:16:07 +05:30
|
|
|
sg->sg_mem[i] = strdup (sgent->sg_mem[i]);
|
2008-05-26 14:16:41 +05:30
|
|
|
if (NULL == sg->sg_mem[i]) {
|
2009-04-25 05:02:52 +05:30
|
|
|
for (i = 0; NULL != sg->sg_mem[i]; i++) {
|
|
|
|
free (sg->sg_mem[i]);
|
|
|
|
}
|
|
|
|
free (sg->sg_mem);
|
|
|
|
for (i = 0; NULL != sg->sg_adm[i]; i++) {
|
|
|
|
free (sg->sg_adm[i]);
|
|
|
|
}
|
|
|
|
free (sg->sg_adm);
|
|
|
|
free (sg->sg_passwd);
|
|
|
|
free (sg->sg_name);
|
|
|
|
free (sg);
|
2007-10-07 17:14:02 +05:30
|
|
|
return NULL;
|
2008-05-26 14:16:41 +05:30
|
|
|
}
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
sg->sg_mem[i] = NULL;
|
|
|
|
|
|
|
|
return sg;
|
|
|
|
}
|
|
|
|
|
* libmisc/xgetXXbyYY.c, libmisc/myname.c, libmisc/getgr_nam_gid.c,
libmisc/salt.c, libmisc/list.c, libmisc/cleanup.c, src/login.c,
lib/getdef.h, lib/groupio.c, lib/getlong.c, lib/gshadow_.h,
lib/sgroupio.c, lib/shadowio.c, lib/pwio.c, lib/commonio.h,
lib/fputsx.c, lib/prototypes.h: Added splint annotations.
* lib/groupio.c: Avoid implicit conversion of pointers to
booleans.
* lib/groupio.c: Free allocated buffers in case of failure.
2009-04-23 15:27:03 +05:30
|
|
|
static /*@null@*/ /*@only@*/void *gshadow_dup (const void *ent)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
const struct sgrp *sg = ent;
|
2007-10-07 17:16:07 +05:30
|
|
|
|
|
|
|
return __sgr_dup (sg);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
* libmisc/utmp.c, libmisc/age.c, libmisc/shell.c, lib/groupio.c,
lib/groupio.h, lib/sgroupio.c, lib/sgroupio.h, lib/shadowio.c,
lib/pwio.c, lib/commonio.c, lib/shadowio.h, lib/pwio.h,
lib/commonio.h, lib/prototypes.h: Added splint annotations.
2009-04-23 02:51:14 +05:30
|
|
|
static void gshadow_free (/*@out@*/ /*@only@*/void *ent)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
struct sgrp *sg = ent;
|
|
|
|
|
2009-04-22 03:44:10 +05:30
|
|
|
sgr_free (sg);
|
|
|
|
}
|
|
|
|
|
* libmisc/utmp.c, libmisc/age.c, libmisc/shell.c, lib/groupio.c,
lib/groupio.h, lib/sgroupio.c, lib/sgroupio.h, lib/shadowio.c,
lib/pwio.c, lib/commonio.c, lib/shadowio.h, lib/pwio.h,
lib/commonio.h, lib/prototypes.h: Added splint annotations.
2009-04-23 02:51:14 +05:30
|
|
|
void sgr_free (/*@out@*/ /*@only@*/struct sgrp *sgent)
|
2009-04-22 03:44:10 +05:30
|
|
|
{
|
2009-09-08 00:38:10 +05:30
|
|
|
size_t i;
|
2009-04-22 03:44:10 +05:30
|
|
|
free (sgent->sg_name);
|
2009-09-08 00:38:10 +05:30
|
|
|
if (NULL != sgent->sg_passwd) {
|
|
|
|
memzero (sgent->sg_passwd, strlen (sgent->sg_passwd));
|
|
|
|
free (sgent->sg_passwd);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
2009-09-08 00:38:10 +05:30
|
|
|
for (i = 0; NULL != sgent->sg_adm[i]; i++) {
|
|
|
|
free (sgent->sg_adm[i]);
|
|
|
|
}
|
|
|
|
free (sgent->sg_adm);
|
|
|
|
for (i = 0; NULL != sgent->sg_mem[i]; i++) {
|
|
|
|
free (sgent->sg_mem[i]);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
2009-09-08 00:38:10 +05:30
|
|
|
free (sgent->sg_mem);
|
2009-04-22 03:44:10 +05:30
|
|
|
free (sgent);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
static const char *gshadow_getname (const void *ent)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
const struct sgrp *gr = ent;
|
2007-10-07 17:16:07 +05:30
|
|
|
|
2007-10-07 17:14:02 +05:30
|
|
|
return gr->sg_name;
|
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
static void *gshadow_parse (const char *line)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return (void *) sgetsgent (line);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
static int gshadow_put (const void *ent, FILE * file)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
const struct sgrp *sg = ent;
|
2007-10-07 17:16:07 +05:30
|
|
|
|
2011-02-17 02:02:16 +05:30
|
|
|
if ( (NULL == sg)
|
|
|
|
|| (valid_field (sg->sg_name, ":\n") == -1)
|
|
|
|
|| (valid_field (sg->sg_passwd, ":\n") == -1)) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: fail also if sg->sg_adm == NULL ?*/
|
|
|
|
if (NULL != sg->sg_adm) {
|
|
|
|
size_t i;
|
|
|
|
for (i = 0; NULL != sg->sg_adm[i]; i++) {
|
|
|
|
if (valid_field (sg->sg_adm[i], ",:\n") == -1) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: fail also if sg->sg_mem == NULL ?*/
|
|
|
|
if (NULL != sg->sg_mem) {
|
|
|
|
size_t i;
|
|
|
|
for (i = 0; NULL != sg->sg_mem[i]; i++) {
|
|
|
|
if (valid_field (sg->sg_mem[i], ",:\n") == -1) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
return (putsgent (sg, file) == -1) ? -1 : 0;
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
static struct commonio_ops gshadow_ops = {
|
|
|
|
gshadow_dup,
|
|
|
|
gshadow_free,
|
|
|
|
gshadow_getname,
|
|
|
|
gshadow_parse,
|
|
|
|
gshadow_put,
|
|
|
|
fgetsx,
|
2007-11-23 05:37:59 +05:30
|
|
|
fputsx,
|
|
|
|
NULL, /* open_hook */
|
|
|
|
NULL /* close_hook */
|
2007-10-07 17:14:02 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
static struct commonio_db gshadow_db = {
|
2007-10-07 17:16:07 +05:30
|
|
|
SGROUP_FILE, /* filename */
|
|
|
|
&gshadow_ops, /* ops */
|
|
|
|
NULL, /* fp */
|
2007-11-20 01:55:36 +05:30
|
|
|
#ifdef WITH_SELINUX
|
|
|
|
NULL, /* scontext */
|
|
|
|
#endif
|
2007-10-07 17:16:07 +05:30
|
|
|
NULL, /* head */
|
|
|
|
NULL, /* tail */
|
|
|
|
NULL, /* cursor */
|
2008-05-26 14:16:41 +05:30
|
|
|
false, /* changed */
|
|
|
|
false, /* isopen */
|
|
|
|
false, /* locked */
|
|
|
|
false /* readonly */
|
2007-10-07 17:14:02 +05:30
|
|
|
};
|
|
|
|
|
* lib/groupio.c, lib/groupio.h, lib/pwio.c, lib/pwio.h,
lib/sgroupio.c, lib/sgroupio.h, lib/shadowio.c, lib/shadowio.h:
Added *_dbname() functions to retrieve the name of the databases.
* lib/groupio.c, lib/groupio.h, lib/pwio.c, lib/pwio.h,
lib/sgroupio.c, lib/sgroupio.h, lib/shadowio.c, lib/shadowio.h:
*_name() functions renamed *setname().
* src/grpck.c, src/pwck.c: Likewise.
* lib/groupio.h, lib/pwio.h, lib/sgroupio.h, lib/shadowio.h: Added
the name of the arguments to the prototypes.
* src/chage, src/chfn.c, src/chgpasswd.c, src/chpasswd.c,
src/chsh.c, src/gpasswd.c, src/groupadd.c, src/groupdel.c,
src/groupmod.c, src/grpck.c, src/grpconv.c, src/grpunconv.c,
src/newusers.c, src/passwd.c, src/pwck.c, src/pwconv.c,
src/pwunconv.c, src/useradd.c, src/userdel.c, src/usermod.c:
Harmonize the erro & syslog messages in case of failure of the
*_lock(), *_open(), *_close(), *_unlock(), *_remove() functions.
* src/chgpasswd.c, src/chpasswd.c, src/usermod.c: Avoid
capitalized messages.
* src/chpasswd.c, src/useradd.c, src/usermod.c: Harmonize messages
in case of inexistent entries.
* src/usermod.c: Harmonize messages in case of already existing
entries.
* src/newusers.c, src/useradd.c: Simplify PAM error handling.
* src/useradd.c: Report failures to unlock files (stderr, syslog,
and audit). But do not fail (continue).
* src/useradd.c (open_files): Do not report to syslog & audit
failures to lock or open the databases. This might be harmless,
and the logs were not already informed that a change was
requested.
* src/usermod.c: It's not the account which is unlocked, but its
password.
2008-08-06 21:27:31 +05:30
|
|
|
int sgr_setdbname (const char *filename)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_setname (&gshadow_db, filename);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
* libmisc/utmp.c, libmisc/age.c, libmisc/shell.c, lib/groupio.c,
lib/groupio.h, lib/sgroupio.c, lib/sgroupio.h, lib/shadowio.c,
lib/pwio.c, lib/commonio.c, lib/shadowio.h, lib/pwio.h,
lib/commonio.h, lib/prototypes.h: Added splint annotations.
2009-04-23 02:51:14 +05:30
|
|
|
/*@observer@*/const char *sgr_dbname (void)
|
* lib/groupio.c, lib/groupio.h, lib/pwio.c, lib/pwio.h,
lib/sgroupio.c, lib/sgroupio.h, lib/shadowio.c, lib/shadowio.h:
Added *_dbname() functions to retrieve the name of the databases.
* lib/groupio.c, lib/groupio.h, lib/pwio.c, lib/pwio.h,
lib/sgroupio.c, lib/sgroupio.h, lib/shadowio.c, lib/shadowio.h:
*_name() functions renamed *setname().
* src/grpck.c, src/pwck.c: Likewise.
* lib/groupio.h, lib/pwio.h, lib/sgroupio.h, lib/shadowio.h: Added
the name of the arguments to the prototypes.
* src/chage, src/chfn.c, src/chgpasswd.c, src/chpasswd.c,
src/chsh.c, src/gpasswd.c, src/groupadd.c, src/groupdel.c,
src/groupmod.c, src/grpck.c, src/grpconv.c, src/grpunconv.c,
src/newusers.c, src/passwd.c, src/pwck.c, src/pwconv.c,
src/pwunconv.c, src/useradd.c, src/userdel.c, src/usermod.c:
Harmonize the erro & syslog messages in case of failure of the
*_lock(), *_open(), *_close(), *_unlock(), *_remove() functions.
* src/chgpasswd.c, src/chpasswd.c, src/usermod.c: Avoid
capitalized messages.
* src/chpasswd.c, src/useradd.c, src/usermod.c: Harmonize messages
in case of inexistent entries.
* src/usermod.c: Harmonize messages in case of already existing
entries.
* src/newusers.c, src/useradd.c: Simplify PAM error handling.
* src/useradd.c: Report failures to unlock files (stderr, syslog,
and audit). But do not fail (continue).
* src/useradd.c (open_files): Do not report to syslog & audit
failures to lock or open the databases. This might be harmless,
and the logs were not already informed that a change was
requested.
* src/usermod.c: It's not the account which is unlocked, but its
password.
2008-08-06 21:27:31 +05:30
|
|
|
{
|
|
|
|
return gshadow_db.filename;
|
|
|
|
}
|
|
|
|
|
2008-05-26 14:16:41 +05:30
|
|
|
bool sgr_file_present (void)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_present (&gshadow_db);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
int sgr_lock (void)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_lock (&gshadow_db);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
int sgr_open (int mode)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_open (&gshadow_db, mode);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2009-04-25 05:02:52 +05:30
|
|
|
/*@observer@*/ /*@null@*/const struct sgrp *sgr_locate (const char *name)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_locate (&gshadow_db, name);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
int sgr_update (const struct sgrp *sg)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_update (&gshadow_db, (const void *) sg);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
int sgr_remove (const char *name)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_remove (&gshadow_db, name);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
int sgr_rewind (void)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_rewind (&gshadow_db);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
* libmisc/utmp.c, libmisc/age.c, libmisc/shell.c, lib/groupio.c,
lib/groupio.h, lib/sgroupio.c, lib/sgroupio.h, lib/shadowio.c,
lib/pwio.c, lib/commonio.c, lib/shadowio.h, lib/pwio.h,
lib/commonio.h, lib/prototypes.h: Added splint annotations.
2009-04-23 02:51:14 +05:30
|
|
|
/*@null@*/const struct sgrp *sgr_next (void)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_next (&gshadow_db);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
int sgr_close (void)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_close (&gshadow_db);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
int sgr_unlock (void)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_unlock (&gshadow_db);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
void __sgr_set_changed (void)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2008-05-26 14:16:41 +05:30
|
|
|
gshadow_db.changed = true;
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
|
|
|
|
2009-04-25 05:02:52 +05:30
|
|
|
/*@dependent@*/ /*@null@*/struct commonio_entry *__sgr_get_head (void)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
|
|
|
return gshadow_db.head;
|
|
|
|
}
|
|
|
|
|
2007-10-07 17:16:07 +05:30
|
|
|
void __sgr_del_entry (const struct commonio_entry *ent)
|
2007-10-07 17:14:02 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
commonio_del_entry (&gshadow_db, ent);
|
2007-10-07 17:14:02 +05:30
|
|
|
}
|
2007-10-07 17:14:51 +05:30
|
|
|
|
|
|
|
/* Sort with respect to group ordering. */
|
2007-10-07 17:16:07 +05:30
|
|
|
int sgr_sort ()
|
2007-10-07 17:14:51 +05:30
|
|
|
{
|
2007-10-07 17:16:07 +05:30
|
|
|
return commonio_sort_wrt (&gshadow_db, __gr_get_db ());
|
2007-10-07 17:14:51 +05:30
|
|
|
}
|
2007-10-07 17:14:02 +05:30
|
|
|
#else
|
2007-10-07 17:16:07 +05:30
|
|
|
extern int errno; /* warning: ANSI C forbids an empty source file */
|
2007-10-07 17:14:02 +05:30
|
|
|
#endif
|