diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-19 05:35:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:29:40 -0500 |
commit | b48422173005c83034b474db47f956476e862bba (patch) | |
tree | 92dc6c2e77dc133c5f685f8ed556e4bd461b0cb1 /source4 | |
parent | 9a4bc49fee7666427c35db287948d5acc47990e2 (diff) | |
download | samba-b48422173005c83034b474db47f956476e862bba.tar.gz samba-b48422173005c83034b474db47f956476e862bba.tar.bz2 samba-b48422173005c83034b474db47f956476e862bba.zip |
r8580: try to fix the build on stratus
(This used to be commit 58d7a1e6a311c98c9b4dfc9e280b328406165997)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/replace/replace.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/source4/lib/replace/replace.c b/source4/lib/replace/replace.c index 89612912b7..79b452d69c 100644 --- a/source4/lib/replace/replace.c +++ b/source4/lib/replace/replace.c @@ -191,16 +191,12 @@ Corrections by richard.kettlewell@kewill.com /**************************************************************************** some systems don't have an initgroups call ****************************************************************************/ - int initgroups(char *name,gid_t id) + int initgroups(char *name, gid_t id) { #ifndef HAVE_SETGROUPS - static int done; - if (!done) { - DEBUG(1,("WARNING: running without setgroups\n")); - done=1; - } /* yikes! no SETGROUPS or INITGROUPS? how can this work? */ - return(0); + errno = ENOSYS; + return -1; #else /* HAVE_SETGROUPS */ gid_t *grouplst = NULL; int max_gr = groups_max(); @@ -209,8 +205,8 @@ Corrections by richard.kettlewell@kewill.com struct group *g; char *gr; - if((grouplst = malloc_array_p(gid_t, max_gr)) == NULL) { - DEBUG(0,("initgroups: malloc fail !\n")); + if((grouplst = malloc(sizeof(gid_t) * max_gr)) == NULL) { + errno = ENOMEM; return -1; } @@ -232,8 +228,8 @@ Corrections by richard.kettlewell@kewill.com } } endgrent(); - ret = sys_setgroups(i,grouplst); - SAFE_FREE(grouplst); + ret = setgroups(i, grouplst); + free(grouplst); return ret; #endif /* HAVE_SETGROUPS */ } @@ -429,7 +425,7 @@ duplicate a string if (!msg) return; syslog(facility_priority, "%s", msg); - SAFE_FREE(msg); + free(msg); } #endif /* HAVE_SYSLOG */ #endif /* HAVE_VSYSLOG */ |