port latest changes from SAMBA_3_0 tree
[tprouty/samba.git] / source / torture / nsstest.c
index 0a08cb6e8f28ab48320147464f74f8da90ed98ef..a803cd7e719e9585968e55a4af58b2f5817df665 100644 (file)
@@ -29,11 +29,11 @@ static int total_errors;
 
 static void *find_fn(const char *name)
 {
-       char s[1024];
+       pstring s;
        static void *h;
        void *res;
 
-       snprintf(s,sizeof(s), "_nss_%s_%s", nss_name, name);
+       pstr_sprintf(s, "_nss_%s_%s", nss_name, name);
 
        if (!h) {
                h = sys_dlopen(so_path, RTLD_LAZY);
@@ -296,11 +296,11 @@ static int nss_initgroups(char *user, gid_t group, gid_t **groups, long int *sta
 
 static void print_passwd(struct passwd *pwd)
 {
-       printf("%s:%s:%d:%d:%s:%s:%s\n", 
+       printf("%s:%s:%lu:%lu:%s:%s:%s\n", 
               pwd->pw_name,
               pwd->pw_passwd,
-              pwd->pw_uid,
-              pwd->pw_gid,
+              (unsigned long)pwd->pw_uid,
+              (unsigned long)pwd->pw_gid,
               pwd->pw_gecos,
               pwd->pw_dir,
               pwd->pw_shell);
@@ -309,10 +309,10 @@ static void print_passwd(struct passwd *pwd)
 static void print_group(struct group *grp)
 {
        int i;
-       printf("%s:%s:%d: ", 
+       printf("%s:%s:%lu: ", 
               grp->gr_name,
               grp->gr_passwd,
-              grp->gr_gid);
+              (unsigned long)grp->gr_gid);
        
        if (!grp->gr_mem[0]) {
                printf("\n");
@@ -343,9 +343,9 @@ static void nss_test_initgroups(char *name, gid_t gid)
        }
 
        for (i=0; i<start-1; i++) {
-               printf("%d, ", groups[i]);
+               printf("%lu, ", (unsigned long)groups[i]);
        }
-       printf("%d\n", groups[i]);
+       printf("%lu\n", (unsigned long)groups[i]);
 }