[SAMBA3] [PATCH] AIX initgroups() error

aatzel at gamax.hu aatzel at gamax.hu
Thu Sep 7 14:55:36 GMT 2006


Hi Developers,

the following patch is correcting a special error detected only in AIX
environment with users belonging to DCE cells.

As it was detected during debug sessions and using special traces, in this
case the initgroups() function coming from the own libraries of AIX is
writing to some memory areas, where it shouldn't (in our case it destroyed
the magic number of a talloc struct, triggering a coredump). Replacing
this function with the substitute, delivered with the samba code, the smbd
runs error-free.

The following little patch does nothing, but forces the usage of samba's
own initgroups() function, in case the system is AIX.

I would like to ask for a review, if any of you have some time for it.

Thanks in advance!
Andras

------
Andras Atzel

Gamax Kft.
Bartok Bela ut 15/D
H-1114, Budapest, Hungary
Phone: +36 20 586-5971

#####################################################################
Index: lib/replace.c
===================================================================
--- lib/replace.c (3.0.23b)
+++ lib/replace.c (new)
@@ -187,7 +187,7 @@



-#ifndef HAVE_INITGROUPS
+#if !defined(HAVE_INITGROUPS) || defined(AIX)
 /****************************************************************************
  some systems don't have an initgroups call
 ****************************************************************************/
@@ -209,6 +209,7 @@
        struct group *g;
        char   *gr;

+       DEBUG(6,("using replacement initgroups()\n"));
        if((grouplst = SMB_MALLOC_ARRAY(gid_t, max_gr)) == NULL) {
                DEBUG(0,("initgroups: malloc fail !\n"));
                return -1;
@@ -237,7 +238,7 @@
        return ret;
 #endif /* HAVE_SETGROUPS */
 }
-#endif /* HAVE_INITGROUPS */
+#endif /* ! defined(HAVE_INITGROUPS) || defined(AIX) */


 #if (defined(SecureWare) && defined(SCO))

###############################################################



More information about the samba-technical mailing list