Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

Location:
vendor/current/source4/client
Files:
1 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/client/cifsdd.c

    r414 r740  
    6161/* ------------------------------------------------------------------------- */
    6262
     63static const struct {
     64        enum argtype arg_type;
     65        const char * arg_name;
     66} names [] = {
     67        { ARG_NUMERIC, "COUNT" },
     68        { ARG_SIZE, "SIZE" },
     69        { ARG_PATHNAME, "FILE" },
     70        { ARG_BOOL, "BOOLEAN" },
     71};
     72
    6373static const char * argtype_str(enum argtype arg_type)
    6474{
    65         static const struct {
    66                 enum argtype arg_type;
    67                 const char * arg_name;
    68         } names [] =
    69         {
    70                 { ARG_NUMERIC, "COUNT" },
    71                 { ARG_SIZE, "SIZE" },
    72                 { ARG_PATHNAME, "FILE" },
    73                 { ARG_BOOL, "BOOLEAN" },
    74         };
    75 
    7675        int i;
    7776
     
    361360                                      const char *socket_options,
    362361                                      struct smbcli_session_options *smb_session_options,
    363                                       struct smb_iconv_convenience *iconv_convenience,
    364362                                      struct gensec_settings *gensec_settings)
    365363{
     
    386384                                      socket_options,
    387385                                      smb_options, smb_session_options,
    388                                       iconv_convenience,
    389386                                      gensec_settings);
    390387        } else if (strcmp(which, "of") == 0) {
     
    395392                                      socket_options,
    396393                                      smb_options, smb_session_options,
    397                                       iconv_convenience,
    398394                                      gensec_settings);
    399395        } else {
     
    429425        count = check_arg_numeric("count");
    430426
    431         lp_smbcli_options(lp_ctx, &options);
    432         lp_smbcli_session_options(lp_ctx, &session_options);
     427        lpcfg_smbcli_options(lp_ctx, &options);
     428        lpcfg_smbcli_session_options(lp_ctx, &session_options);
    433429
    434430        /* Allocate IO buffer. We need more than the max IO size because we
     
    448444                        (unsigned long long)iomax, options.max_xmit));
    449445
    450         if (!(ifile = open_file(lp_resolve_context(lp_ctx), ev, "if",
    451                                 lp_smb_ports(lp_ctx), &options,
    452                                 lp_socket_options(lp_ctx),
    453                                 &session_options, lp_iconv_convenience(lp_ctx),
    454                                 lp_gensec_settings(lp_ctx, lp_ctx)))) {
     446        if (!(ifile = open_file(lpcfg_resolve_context(lp_ctx), ev, "if",
     447                                lpcfg_smb_ports(lp_ctx), &options,
     448                                lpcfg_socket_options(lp_ctx),
     449                                &session_options,
     450                                lpcfg_gensec_settings(lp_ctx, lp_ctx)))) {
    455451                return(FILESYS_EXIT_CODE);
    456452        }
    457453
    458         if (!(ofile = open_file(lp_resolve_context(lp_ctx), ev, "of",
    459                                 lp_smb_ports(lp_ctx), &options,
    460                                 lp_socket_options(lp_ctx),
     454        if (!(ofile = open_file(lpcfg_resolve_context(lp_ctx), ev, "of",
     455                                lpcfg_smb_ports(lp_ctx), &options,
     456                                lpcfg_socket_options(lp_ctx),
    461457                                &session_options,
    462                                 lp_iconv_convenience(lp_ctx),
    463                                 lp_gensec_settings(lp_ctx, lp_ctx)))) {
     458                                lpcfg_gensec_settings(lp_ctx, lp_ctx)))) {
    464459                return(FILESYS_EXIT_CODE);
    465460        }
  • vendor/current/source4/client/cifsdd.h

    r414 r740  
    101101                                struct smbcli_options *smb_options,
    102102                                struct smbcli_session_options *smb_session_options,
    103                                 struct smb_iconv_convenience *iconv_convenience,
    104103                                struct gensec_settings *gensec_settings);
    105104bool dd_fill_block(struct dd_iohandle * h, uint8_t * buf,
  • vendor/current/source4/client/cifsddio.c

    r414 r740  
    2121#include "includes.h"
    2222#include "system/filesys.h"
    23 #include "libcli/raw/libcliraw.h"
    2423#include "libcli/libcli.h"
    2524#include "lib/cmdline/popt_common.h"
     
    229228                                              struct smbcli_options *options,
    230229                                              struct smbcli_session_options *session_options,
    231                                               struct smb_iconv_convenience *iconv_convenience,
    232230                                              struct gensec_settings *gensec_settings)
    233231{
     
    244242                                     ev, options,
    245243                                     session_options,
    246                                      iconv_convenience,
    247244                                     gensec_settings);
    248245
     
    314311                                        struct smbcli_options *smb_options,
    315312                                        struct smbcli_session_options *smb_session_options,
    316                                         struct smb_iconv_convenience *iconv_convenience,
    317313                                        struct gensec_settings *gensec_settings)
    318314{
     
    338334                                          socket_options,
    339335                                          smb_options, smb_session_options,
    340                                           iconv_convenience,
    341336                                          gensec_settings)) == NULL) {
    342337                return(NULL);
     
    363358                                struct smbcli_options *smb_options,
    364359                                struct smbcli_session_options *smb_session_options,
    365                                 struct smb_iconv_convenience *iconv_convenience,
    366360                                struct gensec_settings *gensec_settings)
    367361{
     
    384378                                                socket_options, smb_options,
    385379                                                smb_session_options,
    386                                                 iconv_convenience,
    387380                                                gensec_settings));
    388381                }
  • vendor/current/source4/client/client.c

    r414 r740  
    3636#include "lib/cmdline/popt_common.h"
    3737#include "librpc/gen_ndr/ndr_srvsvc_c.h"
    38 #include "librpc/gen_ndr/ndr_lsa.h"
    39 #include "librpc/gen_ndr/ndr_security.h"
    40 #include "libcli/raw/libcliraw.h"
    4138#include "libcli/util/clilsa.h"
    4239#include "system/dir.h"
     
    4946#include "libcli/resolve/resolve.h"
    5047#include "libcli/security/security.h"
    51 #include "lib/smbreadline/smbreadline.h"
     48#include "../libcli/smbreadline/smbreadline.h"
    5249#include "librpc/gen_ndr/ndr_nbt.h"
    5350#include "param/param.h"
    54 #include "librpc/rpc/dcerpc.h"
    5551#include "libcli/raw/raw_proto.h"
    5652
     
    7773/* timing globals */
    7874static uint64_t get_total_size = 0;
    79 static uint_t get_total_time_ms = 0;
     75static unsigned int get_total_time_ms = 0;
    8076static uint64_t put_total_size = 0;
    81 static uint_t put_total_time_ms = 0;
     77static unsigned int put_total_time_ms = 0;
    8278
    8379/* Unfortunately, there is no way to pass the a context to the completion function as an argument */
     
    265261           new directory is invalid */
    266262        if (newdir[0] == '\\')
    267                 dname = talloc_strdup(NULL, newdir);
     263                dname = talloc_strdup(ctx, newdir);
    268264        else
    269                 dname = talloc_asprintf(NULL, "%s\\%s", ctx->remote_cur_dir, newdir);
     265                dname = talloc_asprintf(ctx, "%s\\%s", ctx->remote_cur_dir, newdir);
    270266
    271267        dos_format(dname);
     
    686682  get a file from rname to lname
    687683  ****************************************************************************/
    688 static int do_get(struct smbclient_context *ctx, char *rname, const char *lname, bool reget)
     684static int do_get(struct smbclient_context *ctx, char *rname, const char *p_lname, bool reget)
    689685
    690686        int handle = 0, fnum;
     
    698694        off_t nread = 0;
    699695        int rc = 0;
    700 
     696        char *lname;
     697
     698
     699        lname = talloc_strdup(ctx, p_lname);
    701700        GetTimeOfDay(&tp_start);
    702701
    703702        if (ctx->lowercase) {
    704                 strlower(discard_const_p(char, lname));
     703                strlower(lname);
    705704        }
    706705
     
    859858        char *mget_mask;
    860859        char *saved_curdir;
     860        char *l_fname;
    861861
    862862        if (ISDOT(finfo->name) || ISDOTDOT(finfo->name))
     
    864864
    865865        if (finfo->attrib & FILE_ATTRIBUTE_DIRECTORY)
    866                 asprintf(&quest, "Get directory %s? ",finfo->name);
     866                quest = talloc_asprintf(ctx, "Get directory %s? ",finfo->name);
    867867        else
    868                 asprintf(&quest, "Get file %s? ",finfo->name);
     868                quest = talloc_asprintf(ctx, "Get file %s? ",finfo->name);
    869869
    870870        if (ctx->prompt && !yesno(quest)) return;
    871871
    872         SAFE_FREE(quest);
     872        talloc_free(quest);
    873873
    874874        if (!(finfo->attrib & FILE_ATTRIBUTE_DIRECTORY)) {
    875                 asprintf(&rname, "%s%s",ctx->remote_cur_dir,finfo->name);
     875                rname = talloc_asprintf(ctx, "%s%s",ctx->remote_cur_dir,
     876                                        finfo->name);
    876877                do_get(ctx, rname, finfo->name, false);
    877                 SAFE_FREE(rname);
     878                talloc_free(rname);
    878879                return;
    879880        }
    880881
    881882        /* handle directories */
    882         saved_curdir = talloc_strdup(NULL, ctx->remote_cur_dir);
     883        saved_curdir = talloc_strdup(ctx, ctx->remote_cur_dir);
    883884
    884885        ctx->remote_cur_dir = talloc_asprintf_append_buffer(NULL, "%s\\", finfo->name);
    885886
    886         string_replace(discard_const_p(char, finfo->name), '\\', '/');
     887        l_fname = talloc_strdup(ctx, finfo->name);
     888
     889        string_replace(l_fname, '\\', '/');
    887890        if (ctx->lowercase) {
    888                 strlower(discard_const_p(char, finfo->name));
    889         }
    890        
    891         if (!directory_exist(finfo->name) &&
    892             mkdir(finfo->name,0777) != 0) {
    893                 d_printf("failed to create directory %s\n",finfo->name);
     891                strlower(l_fname);
     892        }
     893       
     894        if (!directory_exist(l_fname) &&
     895            mkdir(l_fname, 0777) != 0) {
     896                d_printf("failed to create directory %s\n", l_fname);
    894897                return;
    895898        }
    896899       
    897         if (chdir(finfo->name) != 0) {
    898                 d_printf("failed to chdir to directory %s\n",finfo->name);
     900        if (chdir(l_fname) != 0) {
     901                d_printf("failed to chdir to directory %s\n", l_fname);
    899902                return;
    900903        }
    901904
    902         mget_mask = talloc_asprintf(NULL, "%s*", ctx->remote_cur_dir);
     905        mget_mask = talloc_asprintf(ctx, "%s*", ctx->remote_cur_dir);
    903906       
    904907        do_list(ctx, mget_mask, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY,do_mget,false, true);
     
    964967       
    965968        for (i = 1; args[i]; i++) {
    966                 mget_mask = talloc_strdup(ctx,ctx->remote_cur_dir);
     969                mget_mask = talloc_strdup(ctx, ctx->remote_cur_dir);
    967970                if(mget_mask[strlen(mget_mask)-1]!='\\')
    968971                        mget_mask = talloc_append_string(ctx, mget_mask, "\\");
     
    12931296{
    12941297        talloc_free(ctx->fileselection);
    1295         ctx->fileselection = talloc_strdup(NULL, args[1]);
     1298        ctx->fileselection = talloc_strdup(ctx, args[1]);
    12961299
    12971300        return 0;
     
    15341537                return 1;
    15351538        }
    1536         mask = talloc_asprintf(ctx,"%s%s", ctx->remote_cur_dir, args[1]);
     1539        mask = talloc_asprintf(ctx, "%s%s", ctx->remote_cur_dir, args[1]);
    15371540
    15381541        if (NT_STATUS_IS_ERR(smbcli_unlink(ctx->cli->tree, mask))) {
     
    22492252        if (NT_STATUS_IS_ERR(smbcli_unix_chmod(ctx->cli->tree, src, mode))) {
    22502253                d_printf("%s chmod file %s 0%o\n",
    2251                         smbcli_errstr(ctx->cli->tree), src, (mode_t)mode);
     2254                        smbcli_errstr(ctx->cli->tree), src, (unsigned)mode);
    22522255                return 1;
    22532256        }
     
    26042607        do {
    26052608                ZERO_STRUCT(ctr1);
    2606                 status = dcerpc_srvsvc_NetShareEnumAll(p, mem_ctx, &r);
     2609                status = dcerpc_srvsvc_NetShareEnumAll_r(p->binding_handle, mem_ctx, &r);
    26072610
    26082611                if (NT_STATUS_IS_OK(status) &&
     
    28312834{
    28322835        char *dirmask;
    2833         int i;
     2836        int i, ret;
    28342837        completion_remote_t info;
    28352838
     
    28542857                info.dirmask = talloc_strndup(NULL, text, i+1);
    28552858                info.dirmask[i+1] = 0;
    2856                 asprintf(&dirmask, "%s%*s*", rl_ctx->remote_cur_dir, i-1, text);
    2857         } else
    2858                 asprintf(&dirmask, "%s*", rl_ctx->remote_cur_dir);
     2859                ret = asprintf(&dirmask, "%s%*s*", rl_ctx->remote_cur_dir, i-1,
     2860                               text);
     2861        } else {
     2862                ret = asprintf(&dirmask, "%s*", rl_ctx->remote_cur_dir);
     2863        }
     2864        if (ret < 0) {
     2865                goto cleanup;
     2866        }
    28592867
    28602868        if (smbcli_list(rl_ctx->cli->tree, dirmask,
     
    29953003
    29963004        /* and get the first part of the command */
    2997         args = str_list_make_shell(ctx, cline, NULL);
     3005        args = (const char **) str_list_make_shell(ctx, cline, NULL);
    29983006        if (!args || !args[0])
    29993007                return 0;
     
    30543062                       struct smbcli_options *options,
    30553063                       struct smbcli_session_options *session_options,
    3056                            struct smb_iconv_convenience *iconv_convenience,
    30573064                           struct gensec_settings *gensec_settings)
    30583065{
     
    30773084                                        cred, resolve_ctx,
    30783085                                        ev_ctx, options, session_options,
    3079                                         iconv_convenience,
    30803086                                        gensec_settings);
    30813087        if (!NT_STATUS_IS_OK(status)) {
     
    30833089                         server, share, nt_errstr(status));
    30843090                talloc_free(ctx);
    3085                 return NULL;
    3086         }
    3087 
    3088         return ctx;
     3091                return false;
     3092        }
     3093
     3094        return true;
    30893095}
    30903096
     
    31123118                         struct resolve_context *resolve_ctx,
    31133119                         struct smbcli_options *options,
    3114                          struct smb_iconv_convenience *iconv_convenience,
    31153120             const char *socket_options)
    31163121{
     
    31283133            !smbcli_socket_connect(cli, server_name, destports,
    31293134                                   ev_ctx, resolve_ctx, options,
    3130                                    iconv_convenience,
    31313135                   socket_options)) {
    31323136                d_printf("Connection to %s failed\n", server_name);
     
    31523156 int main(int argc,char *argv[])
    31533157{
    3154         const char *base_directory = NULL;
     3158        char *base_directory = NULL;
    31553159        const char *dest_ip = NULL;
    31563160        int opt;
    31573161        const char *query_host = NULL;
    31583162        bool message = false;
    3159         const char *desthost = NULL;
     3163        char *desthost = NULL;
    31603164        poptContext pc;
    31613165        const char *service = NULL;
     
    32583262        poptFreeContext(pc);
    32593263
    3260         lp_smbcli_options(cmdline_lp_ctx, &smb_options);
    3261         lp_smbcli_session_options(cmdline_lp_ctx, &smb_session_options);
     3264        lpcfg_smbcli_options(cmdline_lp_ctx, &smb_options);
     3265        lpcfg_smbcli_session_options(cmdline_lp_ctx, &smb_session_options);
    32623266
    32633267        ev_ctx = s4_event_context_init(talloc_autofree_context());
     
    32733277        if (query_host) {
    32743278                rc = do_host_query(cmdline_lp_ctx, ev_ctx, query_host,
    3275                                    lp_workgroup(cmdline_lp_ctx));
     3279                                   lpcfg_workgroup(cmdline_lp_ctx));
    32763280                return rc;
    32773281        }
    32783282
    32793283        if (message) {
    3280                 rc = do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost,
    3281                                    lp_smb_ports(cmdline_lp_ctx), dest_ip,
     3284                rc = do_message_op(lpcfg_netbios_name(cmdline_lp_ctx), desthost,
     3285                                   lpcfg_smb_ports(cmdline_lp_ctx), dest_ip,
    32823286                                   name_type, ev_ctx,
    3283                                    lp_resolve_context(cmdline_lp_ctx),
    3284                                    &smb_options, lp_iconv_convenience(cmdline_lp_ctx),
    3285                    lp_socket_options(cmdline_lp_ctx));
     3287                                   lpcfg_resolve_context(cmdline_lp_ctx),
     3288                                   &smb_options,
     3289                   lpcfg_socket_options(cmdline_lp_ctx));
    32863290                return rc;
    32873291        }
    32883292       
    3289         if (!do_connect(ctx, ev_ctx, lp_resolve_context(cmdline_lp_ctx),
    3290                         desthost, lp_smb_ports(cmdline_lp_ctx), service,
    3291                         lp_socket_options(cmdline_lp_ctx),
     3293        if (!do_connect(ctx, ev_ctx, lpcfg_resolve_context(cmdline_lp_ctx),
     3294                        desthost, lpcfg_smb_ports(cmdline_lp_ctx), service,
     3295                        lpcfg_socket_options(cmdline_lp_ctx),
    32923296                        cmdline_credentials, &smb_options, &smb_session_options,
    3293                         lp_iconv_convenience(cmdline_lp_ctx),
    3294                         lp_gensec_settings(ctx, cmdline_lp_ctx)))
     3297                        lpcfg_gensec_settings(ctx, cmdline_lp_ctx)))
    32953298                return 1;
    32963299
  • vendor/current/source4/client/tests/test_smbclient.sh

    r414 r740  
    117117
    118118# do some simple operations using old protocol versions
    119 runcmd "List directory with LANMAN1" 'ls' -m LANMAN1 || failed=`expr $failed + 1`
    120 runcmd "List directory with LANMAN2" 'ls' -m LANMAN2 || failed=`expr $failed + 1`
     119runcmd "List directory with LANMAN1" 'ls' -m LANMAN1 --option=clientntlmv2auth=no || failed=`expr $failed + 1`
     120runcmd "List directory with LANMAN2" 'ls' -m LANMAN2 --option=clientntlmv2auth=no || failed=`expr $failed + 1`
    121121
    122122runcmd "Print current working directory" 'pwd'|| failed=`expr $failed + 1`
Note: See TracChangeset for help on using the changeset viewer.