svn commit: samba r8580 - in branches/SAMBA_4_0/source/lib/replace: .

tridge at samba.org tridge at samba.org
Tue Jul 19 05:35:20 GMT 2005


Author: tridge
Date: 2005-07-19 05:35:19 +0000 (Tue, 19 Jul 2005)
New Revision: 8580

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8580

Log:
try to fix the build on stratus 

Modified:
   branches/SAMBA_4_0/source/lib/replace/replace.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/replace.c	2005-07-19 05:09:36 UTC (rev 8579)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c	2005-07-19 05:35:19 UTC (rev 8580)
@@ -191,16 +191,12 @@
 /****************************************************************************
  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 @@
 	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 @@
 		}
 	}
 	endgrent();
-	ret = sys_setgroups(i,grouplst);
-	SAFE_FREE(grouplst);
+	ret = setgroups(i, grouplst);
+	free(grouplst);
 	return ret;
 #endif /* HAVE_SETGROUPS */
 }
@@ -429,7 +425,7 @@
 	if (!msg)
 		return;
 	syslog(facility_priority, "%s", msg);
-	SAFE_FREE(msg);
+	free(msg);
 }
 #endif /* HAVE_SYSLOG */
 #endif /* HAVE_VSYSLOG */



More information about the samba-cvs mailing list