]> git.samba.org - jra/samba/.git/commitdiff
fixed a number of real bugs found by warnings on the 64 bit irix compiler
authorAndrew Tridgell <tridge@samba.org>
Mon, 15 Jul 2002 10:54:35 +0000 (10:54 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 15 Jul 2002 10:54:35 +0000 (10:54 +0000)
(This used to be commit 04de6bbc8055e5547af41b10e284b722f40e726d)

source3/libsmb/cli_wkssvc.c
source3/nsswitch/winbind_nss.c
source3/rpc_parse/parse_sec.c
source3/rpc_server/srv_srvsvc_nt.c
source3/wrepld/parser.c

index 756ff61e5b01975aa49047807b44148218585bc2..97b948bf6289345e49cee2e6910a3a47c376fb79 100644 (file)
@@ -40,7 +40,6 @@ NTSTATUS cli_wks_query_info(struct cli_state *cli, TALLOC_CTX *mem_ctx,
        prs_struct rbuf;
        WKS_Q_QUERY_INFO q_o;
        WKS_R_QUERY_INFO r_o;
-       NTSTATUS nt_status;
 
        if (cli == NULL || wks100 == NULL)
                return NT_STATUS_UNSUCCESSFUL;
@@ -89,6 +88,6 @@ NTSTATUS cli_wks_query_info(struct cli_state *cli, TALLOC_CTX *mem_ctx,
        /* do clean up */
        prs_mem_free(&rbuf);
        
-       return nt_status;
+       return NT_STATUS_OK;
 }
 
index 5dc3d32279a5f0ccae940ff0720e2ff053e1c757..594b5fbadb29fad20028def2850c033b6a7399ca 100644 (file)
@@ -593,7 +593,7 @@ BOOL next_token(char **ptr,char *buff,char *sep, size_t bufsize)
 
 static NSS_STATUS fill_pwent(struct passwd *result,
                                  struct winbindd_pw *pw,
-                                 char **buffer, int *buflen)
+                                 char **buffer, size_t *buflen)
 {
        /* User name */
 
@@ -678,8 +678,8 @@ static NSS_STATUS fill_pwent(struct passwd *result,
    the static data passed to us by libc to put strings and stuff in.
    Return NSS_STATUS_TRYAGAIN if we run out of memory. */
 
-static int fill_grent(struct group *result, struct winbindd_gr *gr,
-                     char *gr_mem, char **buffer, int *buflen)
+static NSS_STATUS fill_grent(struct group *result, struct winbindd_gr *gr,
+                     char *gr_mem, char **buffer, size_t *buflen)
 {
        fstring name;
        int i;
@@ -722,7 +722,7 @@ static int fill_grent(struct group *result, struct winbindd_gr *gr,
        /* this next value is a pointer to a pointer so let's align it */
 
        /* Calculate number of extra bytes needed to align on pointer size boundry */
-       if ((i = (int)*buffer % sizeof(char*)) != 0)
+       if ((i = (unsigned long)(*buffer) % sizeof(char*)) != 0)
                i = sizeof(char*) - i;
        
        if ((tst = get_static(buffer, buflen, ((gr->num_gr_mem + 1) * 
index 56eaf4c5b5c98e77a3a4e78b895df331289d938e..cec37348b807229e37a9626679627a655ec4ca4d 100644 (file)
@@ -157,7 +157,7 @@ BOOL sec_io_ace(char *desc, SEC_ACE *psa, prs_struct *ps, int depth)
  adds new SID with its permissions to ACE list
 ********************************************************************/
 
-NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, SEC_ACE **new, SEC_ACE *old, size_t *num, DOM_SID *sid, uint32 mask)
+NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, SEC_ACE **new, SEC_ACE *old, unsigned *num, DOM_SID *sid, uint32 mask)
 {
        int i = 0;
        
@@ -165,7 +165,7 @@ NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, SEC_ACE **new, SEC_ACE *old, size_t *n
 
        *num += 1;
        
-       if((new[0] = (SEC_ACE *) talloc_zero(ctx, *num * sizeof(SEC_ACE))) == 0)
+       if((new[0] = (SEC_ACE *) talloc_zero(ctx, (*num) * sizeof(SEC_ACE))) == 0)
                return NT_STATUS_NO_MEMORY;
 
        for (i = 0; i < *num - 1; i ++)
index b5f6bd2f0776bfe1b51590d643e38886f1bfc3cf..202e869d35cfc189d0ceb819f466b9896414c9ff 100644 (file)
@@ -964,8 +964,6 @@ static WERROR init_srv_file_info_ctr(pipes_struct *p, SRV_FILE_INFO_CTR *ctr,
 
        ctr->switch_value = switch_value;
        ctr->num_entries = *total_entries - *resume_hnd;
-       if (ctr->num_entries < 0)
-               ctr->num_entries = 0;
        ctr->num_entries2 = ctr->num_entries;
 
        switch (switch_value) {
index f5b9be672779ae5748c87276ed1dbffd8ab948de..b619cb0cef57a1627c1706ab42cf617ebd1f8d14 100644 (file)
@@ -96,7 +96,7 @@ static void decode_wins_name(struct BUFFER *outbuf, WINS_NAME *wins_name)
        wins_name->name_len=RIVAL(outbuf->buffer, outbuf->offset);
        outbuf->offset+=4;
        memcpy(wins_name->name,outbuf->buffer+outbuf->offset, 15);
-       wins_name->name[16]='\0';
+       wins_name->name[15]='\0';
        if((p = strchr(wins_name->name,' ')) != NULL)
                *p = 0;