Use sys_getgrnam not getgrnam. Pointed out by Herb.
authorJeremy Allison <jra@samba.org>
Thu, 24 Jul 2008 18:56:20 +0000 (11:56 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 24 Jul 2008 18:56:20 +0000 (11:56 -0700)
Jeremy.

examples/libsmbclient/Makefile
source/passdb/util_unixsids.c

index a50e80a9189e87d1f454ba8f639fa89715900e85..50a690c68ebc833afd2a52fe97bc68c52020b998 100644 (file)
@@ -5,7 +5,7 @@ SAMBA_INCL  = -I/usr/local/samba/include
 EXTLIB_INCL = -I/usr/include/gtk-1.2 \
              -I/usr/include/glib-1.2 \
              -I/usr/lib/glib/include
-EXTLIB_INCL = `gtk-config --cflags`
+#EXTLIB_INCL = `gtk-config --cflags`
 
 DEFS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 CFLAGS = -O0 -g $(SAMBA_INCL) $(EXTLIB_INCL) $(DEFS)
@@ -28,7 +28,8 @@ TESTS=        testsmbc \
        testchmod \
        testutime \
        testread \
-       testwrite
+       testwrite \
+       libsmbclient.c
 
 #      tree \
 
@@ -94,6 +95,10 @@ testwrite: testwrite.o
        @echo Linking testwrite
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
 
+libsmbclient: libsmbclient.o
+       @echo Linking libsmbclient
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
+
 smbsh:
        make -C smbwrapper
 
index 8c92f9577801d5e43521d80c0fe272f5458f818d..1b674d02a2d1aa9d35bdae0a889cb9a02e611496 100644 (file)
@@ -38,13 +38,13 @@ bool sid_check_is_in_unix_users(const DOM_SID *sid)
 bool uid_to_unix_users_sid(uid_t uid, DOM_SID *sid)
 {
        sid_copy(sid, &global_sid_Unix_Users);
-       return sid_append_rid(sid, uid);
+       return sid_append_rid(sid, (uint32_t)uid);
 }
 
 bool gid_to_unix_groups_sid(gid_t gid, DOM_SID *sid)
 {
        sid_copy(sid, &global_sid_Unix_Groups);
-       return sid_append_rid(sid, gid);
+       return sid_append_rid(sid, (uint32_t)gid);
 }
 
 const char *unix_users_domain_name(void)
@@ -62,7 +62,7 @@ bool lookup_unix_user_name(const char *name, DOM_SID *sid)
        }
 
        sid_copy(sid, &global_sid_Unix_Users);
-       sid_append_rid(sid, pwd->pw_uid); /* For 64-bit uid's we have enough
+       sid_append_rid(sid, (uint32_t)pwd->pw_uid); /* For 64-bit uid's we have enough
                                          * space ... */
        TALLOC_FREE(pwd);
        return True;
@@ -93,13 +93,13 @@ bool lookup_unix_group_name(const char *name, DOM_SID *sid)
 {
        struct group *grp;
 
-       grp = getgrnam(name);
+       grp = sys_getgrnam(name);
        if (grp == NULL) {
                return False;
        }
 
        sid_copy(sid, &global_sid_Unix_Groups);
-       sid_append_rid(sid, grp->gr_gid); /* For 64-bit uid's we have enough
+       sid_append_rid(sid, (uint32_t)grp->gr_gid); /* For 64-bit uid's we have enough
                                           * space ... */
        return True;
 }