Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
authorJeremy Allison <jra@samba.org>
Mon, 20 Oct 2008 23:38:25 +0000 (16:38 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 20 Oct 2008 23:38:25 +0000 (16:38 -0700)
source3/lib/netapi/tests/netfile.c
source3/lib/netapi/tests/netgroup.c
source3/lib/netapi/tests/netlocalgroup.c
source3/lib/netapi/tests/netshare.c
source3/lib/netapi/tests/netuser.c

index 36ee8288eed71b4012eb82bb0a9050e15ab6364e..bee3c2ed5eb26a5f9031ef70143368cb5f877942 100644 (file)
@@ -37,8 +37,8 @@ static NET_API_STATUS test_netfileenum(const char *hostname,
        uint8_t *buffer = NULL;
        int i;
 
-       struct FILE_INFO_2 *i2;
-       struct FILE_INFO_3 *i3;
+       struct FILE_INFO_2 *i2 = NULL;
+       struct FILE_INFO_3 *i3 = NULL;
 
        printf("testing NetFileEnum level %d\n", level);
 
@@ -98,8 +98,6 @@ NET_API_STATUS netapitest_file(struct libnetapi_ctx *ctx,
                               const char *hostname)
 {
        NET_API_STATUS status = 0;
-       uint8_t *buffer = NULL;
-       uint32_t levels[] = { 2, 3 };
        uint32_t enum_levels[] = { 2, 3 };
        int i;
 
@@ -118,14 +116,18 @@ NET_API_STATUS netapitest_file(struct libnetapi_ctx *ctx,
 
        /* basic queries */
 #if 0
-       for (i=0; i<ARRAY_SIZE(levels); i++) {
+       {
+               uint32_t levels[] = { 2, 3 };
+               for (i=0; i<ARRAY_SIZE(levels); i++) {
+                       uint8_t *buffer = NULL;
 
-               printf("testing NetFileGetInfo level %d\n", levels[i]);
+                       printf("testing NetFileGetInfo level %d\n", levels[i]);
 
-               status = NetFileGetInfo(hostname, fid, levels[i], &buffer);
-               if (status && status != 124) {
-                       NETAPI_STATUS(ctx, status, "NetFileGetInfo");
-                       goto out;
+                       status = NetFileGetInfo(hostname, fid, levels[i], &buffer);
+                       if (status && status != 124) {
+                               NETAPI_STATUS(ctx, status, "NetFileGetInfo");
+                               goto out;
+                       }
                }
        }
 #endif
index a89a772ce445b9cbbb05b4ed20cf07e472e06f74..51a21b3bf58b88059a07b0e2cce1f443cfdd644a 100644 (file)
@@ -36,14 +36,14 @@ static NET_API_STATUS test_netgroupenum(const char *hostname,
        uint32_t total_entries = 0;
        uint32_t resume_handle = 0;
        int found_group = 0;
-       const char *current_name;
+       const char *current_name = NULL;
        uint8_t *buffer = NULL;
        int i;
 
-       struct GROUP_INFO_0 *info0;
-       struct GROUP_INFO_1 *info1;
-       struct GROUP_INFO_2 *info2;
-       struct GROUP_INFO_3 *info3;
+       struct GROUP_INFO_0 *info0 = NULL;
+       struct GROUP_INFO_1 *info1 = NULL;
+       struct GROUP_INFO_2 *info2 = NULL;
+       struct GROUP_INFO_3 *info3 = NULL;
 
        printf("testing NetGroupEnum level %d\n", level);
 
index 0d8205935625e426416af0949fdd22076b750853..76c59c814b136d172cad7a533cd4462077d11f16 100644 (file)
@@ -36,12 +36,12 @@ static NET_API_STATUS test_netlocalgroupenum(const char *hostname,
        uint32_t total_entries = 0;
        uint32_t resume_handle = 0;
        int found_group = 0;
-       const char *current_name;
+       const char *current_name = NULL;
        uint8_t *buffer = NULL;
        int i;
 
-       struct LOCALGROUP_INFO_0 *info0;
-       struct LOCALGROUP_INFO_1 *info1;
+       struct LOCALGROUP_INFO_0 *info0 = NULL;
+       struct LOCALGROUP_INFO_1 *info1 = NULL;
 
        printf("testing NetLocalGroupEnum level %d\n", level);
 
index 9446c307b31117dab8fa7d1115952a1948cbadc1..84af9e082744c77dd905fbefa3192bc7676ad33d 100644 (file)
@@ -36,13 +36,13 @@ static NET_API_STATUS test_netshareenum(const char *hostname,
        uint32_t total_entries = 0;
        uint32_t resume_handle = 0;
        int found_share = 0;
-       const char *current_name;
+       const char *current_name = NULL;
        uint8_t *buffer = NULL;
        int i;
 
-       struct SHARE_INFO_0 *i0;
-       struct SHARE_INFO_1 *i1;
-       struct SHARE_INFO_2 *i2;
+       struct SHARE_INFO_0 *i0 = NULL;
+       struct SHARE_INFO_1 *i1 = NULL;
+       struct SHARE_INFO_2 *i2 = NULL;
 
        printf("testing NetShareEnum level %d\n", level);
 
index f1622e45c4b37e590d6a6b8baf09e1b6b0f16168..7bbc5ca3479d245d5da63e9d2d9831fcebf70b80 100644 (file)
@@ -35,20 +35,20 @@ static NET_API_STATUS test_netuserenum(const char *hostname,
        uint32_t entries_read = 0;
        uint32_t total_entries = 0;
        uint32_t resume_handle = 0;
-       const char *current_name;
+       const char *current_name = NULL;
        int found_user = 0;
        uint8_t *buffer = NULL;
        int i;
 
-       struct USER_INFO_0 *info0;
-       struct USER_INFO_1 *info1;
-       struct USER_INFO_2 *info2;
-       struct USER_INFO_3 *info3;
-       struct USER_INFO_4 *info4;
-       struct USER_INFO_10 *info10;
-       struct USER_INFO_11 *info11;
-       struct USER_INFO_20 *info20;
-       struct USER_INFO_23 *info23;
+       struct USER_INFO_0 *info0 = NULL;
+       struct USER_INFO_1 *info1 = NULL;
+       struct USER_INFO_2 *info2 = NULL;
+       struct USER_INFO_3 *info3 = NULL;
+       struct USER_INFO_4 *info4 = NULL;
+       struct USER_INFO_10 *info10 = NULL;
+       struct USER_INFO_11 *info11 = NULL;
+       struct USER_INFO_20 *info20 = NULL;
+       struct USER_INFO_23 *info23 = NULL;
 
        printf("testing NetUserEnum level %d\n", level);