* lib/shadowmem.c: Added spw_free().
* lib/shadowio.c: Use spw_free() for shadow_free(). * lib/groupmem.c: Added gr_free(). * lib/groupio.c: Use gr_free() for group_free(). * lib/pwmem.c: Include define.h before prototypes.h * lib/pwmem.c: Added pw_free(). * lib/pwio.c: Use pw_free() for passwd_free(). * lib/sgroupio.c: Added sgr_free(). * lib/sgroupio.c: Use sgr_free() for gshadow_free(). * lib/prototypes.h: Added gr_free(), pw_free(), sgr_free(), spw_free().
This commit is contained in:
parent
408a30f0ba
commit
5bdf239a66
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
|||||||
|
2009-04-21 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* lib/shadowmem.c: Added spw_free().
|
||||||
|
* lib/shadowio.c: Use spw_free() for shadow_free().
|
||||||
|
* lib/groupmem.c: Added gr_free().
|
||||||
|
* lib/groupio.c: Use gr_free() for group_free().
|
||||||
|
* lib/pwmem.c: Include define.h before prototypes.h
|
||||||
|
* lib/pwmem.c: Added pw_free().
|
||||||
|
* lib/pwio.c: Use pw_free() for passwd_free().
|
||||||
|
* lib/sgroupio.c: Added sgr_free().
|
||||||
|
* lib/sgroupio.c: Use sgr_free() for gshadow_free().
|
||||||
|
* lib/prototypes.h: Added gr_free(), pw_free(), sgr_free(),
|
||||||
|
spw_free().
|
||||||
|
|
||||||
2009-04-21 Nicolas François <nicolas.francois@centraliens.net>
|
2009-04-21 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* libmisc/shell.c: Add brackets and parenthesis.
|
* libmisc/shell.c: Add brackets and parenthesis.
|
||||||
|
@ -59,14 +59,7 @@ static void group_free (void *ent)
|
|||||||
{
|
{
|
||||||
struct group *gr = ent;
|
struct group *gr = ent;
|
||||||
|
|
||||||
free (gr->gr_name);
|
gr_free (gr);
|
||||||
memzero (gr->gr_passwd, strlen (gr->gr_passwd));
|
|
||||||
free (gr->gr_passwd);
|
|
||||||
while (*(gr->gr_mem)) {
|
|
||||||
free (*(gr->gr_mem));
|
|
||||||
gr->gr_mem++;
|
|
||||||
}
|
|
||||||
free (gr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *group_getname (const void *ent)
|
static const char *group_getname (const void *ent)
|
||||||
|
@ -75,3 +75,15 @@ struct group *__gr_dup (const struct group *grent)
|
|||||||
return gr;
|
return gr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gr_free (struct group *grent)
|
||||||
|
{
|
||||||
|
free (grent->gr_name);
|
||||||
|
memzero (grent->gr_passwd, strlen (grent->gr_passwd));
|
||||||
|
free (grent->gr_passwd);
|
||||||
|
while (*(grent->gr_mem)) {
|
||||||
|
free (*(grent->gr_mem));
|
||||||
|
grent->gr_mem++;
|
||||||
|
}
|
||||||
|
free (grent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -173,6 +173,7 @@ extern void __gr_set_changed (void);
|
|||||||
|
|
||||||
/* groupmem.c */
|
/* groupmem.c */
|
||||||
extern struct group *__gr_dup (const struct group *grent);
|
extern struct group *__gr_dup (const struct group *grent);
|
||||||
|
extern void gr_free (struct group *grent);
|
||||||
|
|
||||||
/* hushed.c */
|
/* hushed.c */
|
||||||
extern bool hushed (const char *username);
|
extern bool hushed (const char *username);
|
||||||
@ -258,6 +259,7 @@ extern struct commonio_entry *__pw_get_head (void);
|
|||||||
|
|
||||||
/* pwmem.c */
|
/* pwmem.c */
|
||||||
extern struct passwd *__pw_dup (const struct passwd *pwent);
|
extern struct passwd *__pw_dup (const struct passwd *pwent);
|
||||||
|
extern void pw_free (struct passwd *pwent);
|
||||||
|
|
||||||
/* rlogin.c */
|
/* rlogin.c */
|
||||||
extern int do_rlogin (const char *remote_host, char *name, size_t namelen,
|
extern int do_rlogin (const char *remote_host, char *name, size_t namelen,
|
||||||
@ -295,6 +297,7 @@ extern struct spwd *sgetspent (const char *string)
|
|||||||
/* sgroupio.c */
|
/* sgroupio.c */
|
||||||
extern void __sgr_del_entry (const struct commonio_entry *ent);
|
extern void __sgr_del_entry (const struct commonio_entry *ent);
|
||||||
extern struct sgrp *__sgr_dup (const struct sgrp *sgent);
|
extern struct sgrp *__sgr_dup (const struct sgrp *sgent);
|
||||||
|
extern void sgr_free (struct sgrp *sgent);
|
||||||
extern struct commonio_entry *__sgr_get_head (void);
|
extern struct commonio_entry *__sgr_get_head (void);
|
||||||
extern void __sgr_set_changed (void);
|
extern void __sgr_set_changed (void);
|
||||||
|
|
||||||
@ -304,6 +307,7 @@ extern void __spw_del_entry (const struct commonio_entry *ent);
|
|||||||
|
|
||||||
/* shadowmem.c */
|
/* shadowmem.c */
|
||||||
extern struct spwd *__spw_dup (const struct spwd *spent);
|
extern struct spwd *__spw_dup (const struct spwd *spent);
|
||||||
|
extern void spw_free (struct spwd *spent);
|
||||||
|
|
||||||
/* shell.c */
|
/* shell.c */
|
||||||
extern int shell (const char *, const char *, char *const *);
|
extern int shell (const char *, const char *, char *const *);
|
||||||
|
@ -53,13 +53,7 @@ static void passwd_free (void *ent)
|
|||||||
{
|
{
|
||||||
struct passwd *pw = ent;
|
struct passwd *pw = ent;
|
||||||
|
|
||||||
free (pw->pw_name);
|
pw_free (pw);
|
||||||
memzero (pw->pw_passwd, strlen (pw->pw_passwd));
|
|
||||||
free (pw->pw_passwd);
|
|
||||||
free (pw->pw_gecos);
|
|
||||||
free (pw->pw_dir);
|
|
||||||
free (pw->pw_shell);
|
|
||||||
free (pw);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *passwd_getname (const void *ent)
|
static const char *passwd_getname (const void *ent)
|
||||||
|
13
lib/pwmem.c
13
lib/pwmem.c
@ -36,8 +36,8 @@
|
|||||||
#ident "$Id$"
|
#ident "$Id$"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "prototypes.h"
|
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
|
#include "prototypes.h"
|
||||||
#include "pwio.h"
|
#include "pwio.h"
|
||||||
|
|
||||||
struct passwd *__pw_dup (const struct passwd *pwent)
|
struct passwd *__pw_dup (const struct passwd *pwent)
|
||||||
@ -73,3 +73,14 @@ struct passwd *__pw_dup (const struct passwd *pwent)
|
|||||||
return pw;
|
return pw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pw_free (struct passwd *pwent)
|
||||||
|
{
|
||||||
|
free (pwent->pw_name);
|
||||||
|
memzero (pwent->pw_passwd, strlen (pwent->pw_passwd));
|
||||||
|
free (pwent->pw_passwd);
|
||||||
|
free (pwent->pw_gecos);
|
||||||
|
free (pwent->pw_dir);
|
||||||
|
free (pwent->pw_shell);
|
||||||
|
free (pwent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -101,18 +101,23 @@ static void gshadow_free (void *ent)
|
|||||||
{
|
{
|
||||||
struct sgrp *sg = ent;
|
struct sgrp *sg = ent;
|
||||||
|
|
||||||
free (sg->sg_name);
|
sgr_free (sg);
|
||||||
memzero (sg->sg_passwd, strlen (sg->sg_passwd));
|
}
|
||||||
free (sg->sg_passwd);
|
|
||||||
while (NULL != *(sg->sg_adm)) {
|
void sgr_free (struct sgrp *sgent)
|
||||||
free (*(sg->sg_adm));
|
{
|
||||||
sg->sg_adm++;
|
free (sgent->sg_name);
|
||||||
|
memzero (sgent->sg_passwd, strlen (sgent->sg_passwd));
|
||||||
|
free (sgent->sg_passwd);
|
||||||
|
while (NULL != *(sgent->sg_adm)) {
|
||||||
|
free (*(sgent->sg_adm));
|
||||||
|
sgent->sg_adm++;
|
||||||
}
|
}
|
||||||
while (NULL != *(sg->sg_mem)) {
|
while (NULL != *(sgent->sg_mem)) {
|
||||||
free (*(sg->sg_mem));
|
free (*(sgent->sg_mem));
|
||||||
sg->sg_mem++;
|
sgent->sg_mem++;
|
||||||
}
|
}
|
||||||
free (sg);
|
free (sgent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *gshadow_getname (const void *ent)
|
static const char *gshadow_getname (const void *ent)
|
||||||
|
@ -53,10 +53,7 @@ static void shadow_free (void *ent)
|
|||||||
{
|
{
|
||||||
struct spwd *sp = ent;
|
struct spwd *sp = ent;
|
||||||
|
|
||||||
free (sp->sp_namp);
|
spw_free (sp);
|
||||||
memzero (sp->sp_pwdp, strlen (sp->sp_pwdp));
|
|
||||||
free (sp->sp_pwdp);
|
|
||||||
free (sp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *shadow_getname (const void *ent)
|
static const char *shadow_getname (const void *ent)
|
||||||
|
@ -62,3 +62,11 @@ struct spwd *__spw_dup (const struct spwd *spent)
|
|||||||
return sp;
|
return sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void spw_free (struct spwd *spent)
|
||||||
|
{
|
||||||
|
free (spent->sp_namp);
|
||||||
|
memzero (spent->sp_pwdp, strlen (spent->sp_pwdp));
|
||||||
|
free (spent->sp_pwdp);
|
||||||
|
free (spent);
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user