~ubuntu-branches/ubuntu/quantal/shadow/quantal

« back to all changes in this revision

Viewing changes to lib/sgroupio.c

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2010-11-24 13:42:42 UTC
  • mfrom: (1.1.9 upstream) (18.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20101124134242-832f4tew5s81ntj7
Tags: 1:4.1.4.2+svn3283-2ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Ubuntu specific:
    + debian/login.defs: use SHA512 by default for password crypt routine.
  - debian/{source_shadow.py,rules}: Add apport hook
  - debian/rules: fix FTBFS from newer libtools
  - debian/patches/495_stdout-encrypted-password: chpasswd can report
    password hashes on stdout (Debian bug 505640).
  - Rework 495_stdout-encrypted-password to cope with chpasswd using PAM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
#ifdef SHADOWGRP
37
37
 
38
 
#ident "$Id: sgroupio.c 2797 2009-04-24 23:32:52Z nekral-guest $"
 
38
#ident "$Id: sgroupio.c 3062 2009-09-07 19:08:10Z nekral-guest $"
39
39
 
40
40
#include "prototypes.h"
41
41
#include "defines.h"
51
51
        if (NULL == sg) {
52
52
                return NULL;
53
53
        }
54
 
        *sg = *sgent;
55
54
        sg->sg_name = strdup (sgent->sg_name);
56
55
        if (NULL == sg->sg_name) {
57
56
                free (sg);
137
136
 
138
137
void sgr_free (/*@out@*/ /*@only@*/struct sgrp *sgent)
139
138
{
 
139
        size_t i;
140
140
        free (sgent->sg_name);
141
 
        memzero (sgent->sg_passwd, strlen (sgent->sg_passwd));
142
 
        free (sgent->sg_passwd);
143
 
        while (NULL != *(sgent->sg_adm)) {
144
 
                free (*(sgent->sg_adm));
145
 
                sgent->sg_adm++;
146
 
        }
147
 
        while (NULL != *(sgent->sg_mem)) {
148
 
                free (*(sgent->sg_mem));
149
 
                sgent->sg_mem++;
150
 
        }
 
141
        if (NULL != sgent->sg_passwd) {
 
142
                memzero (sgent->sg_passwd, strlen (sgent->sg_passwd));
 
143
                free (sgent->sg_passwd);
 
144
        }
 
145
        for (i = 0; NULL != sgent->sg_adm[i]; i++) {
 
146
                free (sgent->sg_adm[i]);
 
147
        }
 
148
        free (sgent->sg_adm);
 
149
        for (i = 0; NULL != sgent->sg_mem[i]; i++) {
 
150
                free (sgent->sg_mem[i]);
 
151
        }
 
152
        free (sgent->sg_mem);
151
153
        free (sgent);
152
154
}
153
155