28 lines
515 B
C
28 lines
515 B
C
|
|
||
|
#include <config.h>
|
||
|
|
||
|
#ident "$Id: shadowio.c 1342 2007-11-10 23:46:11Z nekral-guest $"
|
||
|
|
||
|
#include "prototypes.h"
|
||
|
#include "defines.h"
|
||
|
#ifdef HAVE_SHADOW_H
|
||
|
# include <shadow.h>
|
||
|
#endif
|
||
|
#include <stdio.h>
|
||
|
#include "shadowio.h"
|
||
|
|
||
|
struct spwd *__spw_dup (const struct spwd *spent)
|
||
|
{
|
||
|
struct spwd *sp;
|
||
|
|
||
|
if (!(sp = (struct spwd *) malloc (sizeof *sp)))
|
||
|
return NULL;
|
||
|
*sp = *spent;
|
||
|
if (!(sp->sp_namp = strdup (spent->sp_namp)))
|
||
|
return NULL;
|
||
|
if (!(sp->sp_pwdp = strdup (spent->sp_pwdp)))
|
||
|
return NULL;
|
||
|
return sp;
|
||
|
}
|
||
|
|