1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

r8580: try to fix the build on stratus

(This used to be commit 58d7a1e6a311c98c9b4dfc9e280b328406165997)
This commit is contained in:
Andrew Tridgell 2005-07-19 05:35:19 +00:00 committed by Gerald (Jerry) Carter
parent 9a4bc49fee
commit b484221730

View File

@ -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 */