summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-07-22 04:31:20 +0000
committerTim Potter <tpot@samba.org>2003-07-22 04:31:20 +0000
commit80c1f1d865b13a63c7a60876b63458119566e044 (patch)
tree86d46f6bb2f871dcbe02a29f016e2fb89272de06 /source3/torture
parent06345b81164d575bc1faf537e3c48a5dfe8e2442 (diff)
downloadsamba-80c1f1d865b13a63c7a60876b63458119566e044.tar.gz
samba-80c1f1d865b13a63c7a60876b63458119566e044.tar.bz2
samba-80c1f1d865b13a63c7a60876b63458119566e044.zip
Fixup a bunch of printf-style functions and debugs to use unsigned long when
displaying pid_t, uid_t and gid_t values. This removes a whole lot of warnings on some of the 64-bit build farm machines as well as help us out when 64-bit uid/gid/pid values come along. (This used to be commit f93528ba007c8800a850678f35f499fb7360fb9a)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/cmd_vfs.c9
-rw-r--r--source3/torture/locktest.c2
-rw-r--r--source3/torture/locktest2.c2
-rw-r--r--source3/torture/nsstest.c14
4 files changed, 15 insertions, 12 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index f74fcedcf4..d91dbf50e0 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -528,7 +528,8 @@ static NTSTATUS cmd_stat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
printf(" Inode: %10u", (unsigned int)st.st_ino);
printf(" Links: %10u\n", (unsigned int)st.st_nlink);
printf(" Access: %05o", (st.st_mode) & 007777);
- printf(" Uid: %5d/%.16s Gid: %5d/%.16s\n", st.st_uid, user, st.st_gid, group);
+ printf(" Uid: %5lu/%.16s Gid: %5lu/%.16s\n", (unsigned long)st.st_uid, user,
+ (unsigned long)st.st_gid, group);
printf(" Access: %s", ctime(&(st.st_atime)));
printf(" Modify: %s", ctime(&(st.st_mtime)));
printf(" Change: %s", ctime(&(st.st_ctime)));
@@ -590,7 +591,8 @@ static NTSTATUS cmd_fstat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
printf(" Inode: %10u", (unsigned int)st.st_ino);
printf(" Links: %10u\n", (unsigned int)st.st_nlink);
printf(" Access: %05o", (st.st_mode) & 007777);
- printf(" Uid: %5d/%.16s Gid: %5d/%.16s\n", st.st_uid, user, st.st_gid, group);
+ printf(" Uid: %5lu/%.16s Gid: %5lu/%.16s\n", (unsigned long)st.st_uid, user,
+ (unsigned long)st.st_gid, group);
printf(" Access: %s", ctime(&(st.st_atime)));
printf(" Modify: %s", ctime(&(st.st_mtime)));
printf(" Change: %s", ctime(&(st.st_ctime)));
@@ -640,7 +642,8 @@ static NTSTATUS cmd_lstat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
printf(" Inode: %10u", (unsigned int)st.st_ino);
printf(" Links: %10u\n", (unsigned int)st.st_nlink);
printf(" Access: %05o", (st.st_mode) & 007777);
- printf(" Uid: %5d/%.16s Gid: %5d/%.16s\n", st.st_uid, user, st.st_gid, group);
+ printf(" Uid: %5lu/%.16s Gid: %5lu/%.16s\n", (unsigned long)st.st_uid, user,
+ (unsigned long)st.st_gid, group);
printf(" Access: %s", ctime(&(st.st_atime)));
printf(" Modify: %s", ctime(&(st.st_mtime)));
printf(" Change: %s", ctime(&(st.st_ctime)));
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c
index 63b9590dd6..86379bf3b6 100644
--- a/source3/torture/locktest.c
+++ b/source3/torture/locktest.c
@@ -157,7 +157,7 @@ static struct cli_state *connect_one(char *share, int snum)
zero_ip(&ip);
- slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++);
+ slprintf(myname,sizeof(myname), "lock-%lu-%u", (unsigned long)getpid(), count++);
make_nmb_name(&calling, myname, 0x0);
make_nmb_name(&called , server, 0x20);
diff --git a/source3/torture/locktest2.c b/source3/torture/locktest2.c
index 97844b5609..29b3c7c4b2 100644
--- a/source3/torture/locktest2.c
+++ b/source3/torture/locktest2.c
@@ -173,7 +173,7 @@ static struct cli_state *connect_one(char *share)
}
}
- slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++);
+ slprintf(myname,sizeof(myname), "lock-%lu-%u", (unsigned long)getpid(), count++);
nt_status = cli_full_connection(&c, myname, server_n, NULL, 0, share, "?????",
username, lp_workgroup(), password, 0,
diff --git a/source3/torture/nsstest.c b/source3/torture/nsstest.c
index 0a08cb6e8f..b5cd59d50b 100644
--- a/source3/torture/nsstest.c
+++ b/source3/torture/nsstest.c
@@ -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]);
}