The branch, master has been updated
       via  ee11bb87.. s3: Remove some direct cli->inbuf references in 
interpret_long_filename
       via  869a19f... s3: Remove a pointless wrapper function
       via  61fb8a4... s3: Explicitly pass flags2 to clistr_pull_talloc
      from  1cbe8b8... s3: Remove some pointless wrapper functions

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ee11bb8748afebf2b42876a59da210f628613a02
Author: Volker Lendecke <[email protected]>
Date:   Thu Aug 5 14:05:58 2010 +0200

    s3: Remove some direct cli->inbuf references in interpret_long_filename

commit 869a19f06c0ef7b106dfbbc3db1ed1091a1a4259
Author: Volker Lendecke <[email protected]>
Date:   Thu Aug 5 14:02:56 2010 +0200

    s3: Remove a pointless wrapper function

commit 61fb8a4fd1a8b30fffdf941a9ff843825bf966e3
Author: Volker Lendecke <[email protected]>
Date:   Thu Aug 5 13:45:59 2010 +0200

    s3: Explicitly pass flags2 to clistr_pull_talloc
    
    Required to eventually make cli_list async

-----------------------------------------------------------------------

Summary of changes:
 source3/include/proto.h       |    4 ++--
 source3/include/safe_string.h |    4 ++--
 source3/libsmb/clidfs.c       |    1 +
 source3/libsmb/clifile.c      |    7 ++++---
 source3/libsmb/clilist.c      |   20 +++++++++++++++-----
 source3/libsmb/clistr.c       |   12 ++++--------
 6 files changed, 28 insertions(+), 20 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index dbc2d40..32340b3 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -2646,13 +2646,13 @@ size_t clistr_pull_fn(const char *function,
 size_t clistr_pull_talloc_fn(const char *function,
                                unsigned int line,
                                TALLOC_CTX *ctx,
-                               const char *inbuf,
+                               const char *base,
+                               uint16_t flags2,
                                char **pp_dest,
                                const void *src,
                                int src_len,
                                int flags);
 size_t clistr_align_out(struct cli_state *cli, const void *p, int flags);
-size_t clistr_align_in(struct cli_state *cli, const void *p, int flags);
 
 /* The following definitions come from libsmb/clitrans.c  */
 
diff --git a/source3/include/safe_string.h b/source3/include/safe_string.h
index 43e4341..4ed7ff2 100644
--- a/source3/include/safe_string.h
+++ b/source3/include/safe_string.h
@@ -146,9 +146,9 @@ size_t __unsafe_string_function_usage_here_char__(void);
        clistr_pull_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \
                        inbuf, dest, src, dest_len, src_len, flags)
 
-#define clistr_pull_talloc(ctx, inbuf, pp_dest, src, src_len, flags) \
+#define clistr_pull_talloc(ctx, base, flags2, pp_dest, src, src_len, flags) \
        clistr_pull_talloc_fn(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \
-                       ctx, inbuf, pp_dest, src, src_len, flags)
+                             ctx, base, flags2, pp_dest, src, src_len, flags)
 
 #define srvstr_push(base_ptr, smb_flags2, dest, src, dest_len, flags) \
        srvstr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 345d0f9..f4b5268 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -717,6 +717,7 @@ bool cli_dfs_get_referral(TALLOC_CTX *ctx,
                                goto out;
                        }
                        clistr_pull_talloc(ctx, cli->inbuf,
+                                          SVAL(cli->inbuf, smb_flg2),
                                           &referrals[i].dfspath,
                                           p+node_offset, -1,
                                           STR_TERMINATE|STR_UNICODE);
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 2067b79..48af0cc 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -5022,8 +5022,9 @@ static void cli_notify_done(struct tevent_req *subreq)
        NTSTATUS status;
        uint8_t *params;
        uint32_t i, ofs, num_params;
+       uint16_t flags2;
 
-       status = cli_trans_recv(subreq, talloc_tos(), NULL, NULL, 0, NULL,
+       status = cli_trans_recv(subreq, talloc_tos(), &flags2, NULL, 0, NULL,
                                &params, 0, &num_params, NULL, 0, NULL);
        TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
@@ -5068,8 +5069,8 @@ static void cli_notify_done(struct tevent_req *subreq)
                }
 
                state->changes[i].action = IVAL(params, ofs+4);
-               ret = clistr_pull_talloc(params, (char *)params, &name,
-                                        params+ofs+12, len,
+               ret = clistr_pull_talloc(params, (char *)params, flags2,
+                                        &name, params+ofs+12, len,
                                         STR_TERMINATE|STR_UNICODE);
                if (ret == -1) {
                        TALLOC_FREE(params);
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 56de119..1a8b79b 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -46,6 +46,8 @@ static size_t calc_next_entry_offset(const char *base, const 
char *pdata_end)
 static size_t interpret_long_filename(TALLOC_CTX *ctx,
                                        struct cli_state *cli,
                                        int level,
+                                       const char *base_ptr,
+                                       uint16_t recv_flags2,
                                        const char *p,
                                        const char *pdata_end,
                                        struct file_info *finfo,
@@ -80,7 +82,7 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
                        finfo->mode = CVAL(p,24);
                        len = CVAL(p, 26);
                        p += 27;
-                       p += clistr_align_in(cli, p, 0);
+                       p += align_string(base_ptr, p, 0);
 
                        /* We can safely use len here (which is required by 
OS/2)
                         * and the NAS-BASIC server instead of +2 or +1 as the
@@ -101,7 +103,8 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
                           between win2000 and win9x for this call
                           (tridge) */
                        ret = clistr_pull_talloc(ctx,
-                                               cli->inbuf,
+                                               base_ptr,
+                                               recv_flags2,
                                                &finfo->name,
                                                p,
                                                len+2,
@@ -133,7 +136,8 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
                                return pdata_end - base;
                        }
                        ret = clistr_pull_talloc(ctx,
-                                               cli->inbuf,
+                                               base_ptr,
+                                               recv_flags2,
                                                &finfo->name,
                                                p,
                                                len,
@@ -185,7 +189,7 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
                                /* stupid NT bugs. grr */
                                int flags = 0;
                                if (p[1] == 0 && namelen > 1) flags |= 
STR_UNICODE;
-                               clistr_pull(cli->inbuf, finfo->short_name, p,
+                               clistr_pull(base_ptr, finfo->short_name, p,
                                            sizeof(finfo->short_name),
                                            slen, flags);
                        }
@@ -194,7 +198,8 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
                                return pdata_end - base;
                        }
                        ret = clistr_pull_talloc(ctx,
-                                               cli->inbuf,
+                                               base_ptr,
+                                               recv_flags2,
                                                &finfo->name,
                                                p,
                                                namelen,
@@ -408,6 +413,8 @@ int cli_list_new(struct cli_state *cli,const char 
*Mask,uint16 attribute,
                        p2 += interpret_long_filename(frame,
                                                        cli,
                                                        info_level,
+                                                       cli->inbuf,
+                                                       SVAL(cli->inbuf, 
smb_flg2),
                                                        p2,
                                                        rdata_end,
                                                        &finfo,
@@ -478,6 +485,8 @@ int cli_list_new(struct cli_state *cli,const char 
*Mask,uint16 attribute,
                         p += interpret_long_filename(frame,
                                                        cli,
                                                        info_level,
+                                                       cli->inbuf,
+                                                       SVAL(cli->inbuf, 
smb_flg2),
                                                        p,
                                                        rdata_end,
                                                        &finfo,
@@ -523,6 +532,7 @@ static bool interpret_short_filename(TALLOC_CTX *ctx,
        finfo->size = IVAL(p,26);
        ret = clistr_pull_talloc(ctx,
                        cli->inbuf,
+                       SVAL(cli->inbuf, smb_flg2),
                        &finfo->name,
                        p+30,
                        12,
diff --git a/source3/libsmb/clistr.c b/source3/libsmb/clistr.c
index 4e49091..aeb0bc6 100644
--- a/source3/libsmb/clistr.c
+++ b/source3/libsmb/clistr.c
@@ -68,7 +68,8 @@ size_t clistr_pull_fn(const char *function,
 size_t clistr_pull_talloc_fn(const char *function,
                                unsigned int line,
                                TALLOC_CTX *ctx,
-                               const char *inbuf,
+                               const char *base,
+                               uint16_t flags2,
                                char **pp_dest,
                                const void *src,
                                int src_len,
@@ -77,8 +78,8 @@ size_t clistr_pull_talloc_fn(const char *function,
        return pull_string_talloc_fn(function,
                                        line,
                                        ctx,
-                                       inbuf,
-                                       SVAL(inbuf, smb_flg2),
+                                       base,
+                                       flags2,
                                        pp_dest,
                                        src,
                                        src_len,
@@ -89,8 +90,3 @@ size_t clistr_align_out(struct cli_state *cli, const void *p, 
int flags)
 {
        return align_string(cli->outbuf, (const char *)p, flags);
 }
-
-size_t clistr_align_in(struct cli_state *cli, const void *p, int flags)
-{
-       return align_string(cli->inbuf, (const char *)p, flags);
-}


-- 
Samba Shared Repository

Reply via email to