Ignore:
Timestamp:
Nov 25, 2016, 8:04:54 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.7

Location:
vendor/current/source3/utils
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/utils/net_ads.c

    r988 r989  
    15971597        }
    15981598
     1599        /* print out informative error string in case there is one */
     1600        if (r->out.error_string != NULL) {
     1601                d_printf("%s\n", r->out.error_string);
     1602        }
     1603
    15991604        /*
    16001605         * We try doing the dns update (if it was compiled in
  • vendor/current/source3/utils/net_printing.c

    r988 r989  
    265265
    266266                if (strncmp((const char *)kbuf.dptr, FORMS_PREFIX, strlen(FORMS_PREFIX)) == 0) {
    267                         dump_form(ctx, (const char *)kbuf.dptr+strlen(FORMS_PREFIX), dbuf.dptr, dbuf.dsize);
     267                        char *key_name = NULL;
     268                        size_t converted_size = 0;
     269                        bool ok;
     270
     271                        ok = pull_ascii_talloc(ctx,
     272                                               &key_name,
     273                                               (const char *) kbuf.dptr + strlen(FORMS_PREFIX),
     274                                               &converted_size);
     275                        if (!ok) {
     276                                continue;
     277                        }
     278
     279                        dump_form(ctx, key_name, dbuf.dptr, dbuf.dsize);
     280                        TALLOC_FREE(key_name);
    268281                        SAFE_FREE(dbuf.dptr);
    269282                        continue;
     
    271284
    272285                if (strncmp((const char *)kbuf.dptr, DRIVERS_PREFIX, strlen(DRIVERS_PREFIX)) == 0) {
     286                        char *key_name = NULL;
     287                        size_t converted_size = 0;
     288                        bool ok;
     289
     290                        ok = pull_ascii_talloc(ctx,
     291                                               &key_name,
     292                                               (const char *) kbuf.dptr + strlen(DRIVERS_PREFIX),
     293                                               &converted_size);
     294                        if (!ok) {
     295                                continue;
     296                        }
     297
    273298                        dump_driver(ctx,
    274                                     (const char *)kbuf.dptr+strlen(DRIVERS_PREFIX),
     299                                    key_name,
    275300                                    dbuf.dptr,
    276301                                    dbuf.dsize,
    277302                                    do_string_conversion);
     303                        TALLOC_FREE(key_name);
    278304                        SAFE_FREE(dbuf.dptr);
    279305                        continue;
     
    281307
    282308                if (strncmp((const char *)kbuf.dptr, PRINTERS_PREFIX, strlen(PRINTERS_PREFIX)) == 0) {
     309                        char *key_name = NULL;
     310                        size_t converted_size = 0;
     311                        bool ok;
     312
     313                        ok = pull_ascii_talloc(ctx,
     314                                               &key_name,
     315                                               (const char *) kbuf.dptr + strlen(PRINTERS_PREFIX),
     316                                               &converted_size);
     317                        if (!ok) {
     318                                continue;
     319                        }
     320
    283321                        dump_printer(ctx,
    284                                      (const char *)kbuf.dptr+strlen(PRINTERS_PREFIX),
     322                                     key_name,
    285323                                     dbuf.dptr,
    286324                                     dbuf.dsize,
    287325                                     do_string_conversion);
     326                        TALLOC_FREE(key_name);
    288327                        SAFE_FREE(dbuf.dptr);
    289328                        continue;
     
    358397
    359398                if (strncmp((const char *) kbuf.dptr, FORMS_PREFIX, strlen(FORMS_PREFIX)) == 0) {
     399                        char *key_name = NULL;
     400                        size_t converted_size = 0;
     401                        bool ok;
     402
     403                        ok = pull_ascii_talloc(tmp_ctx,
     404                                               &key_name,
     405                                               (const char *) kbuf.dptr + strlen(FORMS_PREFIX),
     406                                               &converted_size);
     407                        if (!ok) {
     408                                continue;
     409                        }
     410
    360411                        printing_tdb_migrate_form(tmp_ctx,
    361412                                     winreg_pipe,
    362                                      (const char *) kbuf.dptr + strlen(FORMS_PREFIX),
     413                                     key_name,
    363414                                     dbuf.dptr,
    364415                                     dbuf.dsize);
     416                        TALLOC_FREE(key_name);
    365417                        SAFE_FREE(dbuf.dptr);
    366418                        continue;
     
    368420
    369421                if (strncmp((const char *) kbuf.dptr, DRIVERS_PREFIX, strlen(DRIVERS_PREFIX)) == 0) {
     422                        char *key_name = NULL;
     423                        size_t converted_size = 0;
     424                        bool ok;
     425
     426                        ok = pull_ascii_talloc(tmp_ctx,
     427                                               &key_name,
     428                                               (const char *) kbuf.dptr + strlen(DRIVERS_PREFIX),
     429                                               &converted_size);
     430                        if (!ok) {
     431                                continue;
     432                        }
     433
    370434                        printing_tdb_migrate_driver(tmp_ctx,
    371435                                       winreg_pipe,
    372                                        (const char *) kbuf.dptr + strlen(DRIVERS_PREFIX),
     436                                       key_name,
    373437                                       dbuf.dptr,
    374438                                       dbuf.dsize,
    375439                                       do_string_conversion);
     440                        TALLOC_FREE(key_name);
    376441                        SAFE_FREE(dbuf.dptr);
    377442                        continue;
     
    379444
    380445                if (strncmp((const char *) kbuf.dptr, PRINTERS_PREFIX, strlen(PRINTERS_PREFIX)) == 0) {
     446                        char *key_name = NULL;
     447                        size_t converted_size = 0;
     448                        bool ok;
     449
     450                        ok = pull_ascii_talloc(tmp_ctx,
     451                                               &key_name,
     452                                               (const char *) kbuf.dptr + strlen(PRINTERS_PREFIX),
     453                                               &converted_size);
     454                        if (!ok) {
     455                                continue;
     456                        }
     457
    381458                        printing_tdb_migrate_printer(tmp_ctx,
    382459                                        winreg_pipe,
    383                                         (const char *) kbuf.dptr + strlen(PRINTERS_PREFIX),
     460                                        key_name,
    384461                                        dbuf.dptr,
    385462                                        dbuf.dsize,
    386463                                        do_string_conversion);
     464                        TALLOC_FREE(key_name);
    387465                        SAFE_FREE(dbuf.dptr);
    388466                        continue;
  • vendor/current/source3/utils/net_rpc.c

    r988 r989  
    429429        }
    430430
     431        /* print out informative error string in case there is one */
     432        if (r->out.error_string != NULL) {
     433                d_printf("%s\n", r->out.error_string);
     434        }
     435
    431436        TALLOC_FREE(mem_ctx);
    432437
     
    606611                d_printf("Joined '%s' to domain '%s'\n", r->in.machine_name,
    607612                        r->out.netbios_domain_name);
     613        }
     614
     615        /* print out informative error string in case there is one */
     616        if (r->out.error_string != NULL) {
     617                d_printf("%s\n", r->out.error_string);
    608618        }
    609619
  • vendor/current/source3/utils/ntlm_auth.c

    r988 r989  
    2828#include "lib/param/param.h"
    2929#include "popt_common.h"
     30#include "libcli/security/security.h"
    3031#include "utils/ntlm_auth.h"
    3132#include "../libcli/auth/libcli_auth.h"
     
    711712                                                struct auth_session_info **session_info_out)
    712713{
    713         char *unix_username = (char *)server_returned_info;
    714         struct auth_session_info *session_info = talloc_zero(mem_ctx, struct auth_session_info);
    715         if (!session_info) {
     714        const char *unix_username = (const char *)server_returned_info;
     715        bool ok;
     716        struct dom_sid *sids = NULL;
     717        struct auth_session_info *session_info = NULL;
     718
     719        session_info = talloc_zero(mem_ctx, struct auth_session_info);
     720        if (session_info == NULL) {
    716721                return NT_STATUS_NO_MEMORY;
    717722        }
    718723
    719724        session_info->unix_info = talloc_zero(session_info, struct auth_user_info_unix);
    720         if (!session_info->unix_info) {
     725        if (session_info->unix_info == NULL) {
    721726                TALLOC_FREE(session_info);
    722727                return NT_STATUS_NO_MEMORY;
    723728        }
    724         session_info->unix_info->unix_name = talloc_steal(session_info->unix_info, unix_username);
     729        session_info->unix_info->unix_name = talloc_strdup(session_info->unix_info,
     730                                                           unix_username);
     731        if (session_info->unix_info->unix_name == NULL) {
     732                TALLOC_FREE(session_info);
     733                return NT_STATUS_NO_MEMORY;
     734        }
     735
     736        session_info->security_token = talloc_zero(session_info, struct security_token);
     737        if (session_info->security_token == NULL) {
     738                TALLOC_FREE(session_info);
     739                return NT_STATUS_NO_MEMORY;
     740        }
     741
     742        sids = talloc_zero_array(session_info->security_token,
     743                                 struct dom_sid, 3);
     744        if (sids == NULL) {
     745                TALLOC_FREE(session_info);
     746                return NT_STATUS_NO_MEMORY;
     747        }
     748        ok = dom_sid_parse(SID_WORLD, &sids[0]);
     749        if (!ok) {
     750                TALLOC_FREE(session_info);
     751                return NT_STATUS_INTERNAL_ERROR;
     752        }
     753        ok = dom_sid_parse(SID_NT_NETWORK, &sids[1]);
     754        if (!ok) {
     755                TALLOC_FREE(session_info);
     756                return NT_STATUS_INTERNAL_ERROR;
     757        }
     758        ok = dom_sid_parse(SID_NT_AUTHENTICATED_USERS, &sids[2]);
     759        if (!ok) {
     760                TALLOC_FREE(session_info);
     761                return NT_STATUS_INTERNAL_ERROR;
     762        }
     763
     764        session_info->security_token->num_sids = talloc_array_length(sids);
     765        session_info->security_token->sids = sids;
    725766
    726767        *session_info_out = session_info;
  • vendor/current/source3/utils/smbcquotas.c

    r988 r989  
    569569        struct cli_state *cli;
    570570        bool fix_user = False;
     571        bool ok;
    571572        SMB_NTQUOTA_STRUCT qt;
    572573        TALLOC_CTX *frame = talloc_stackframe();
     
    602603        fault_setup();
    603604
    604         lp_load_global(get_dyn_CONFIGFILE());
    605         load_interfaces();
    606 
    607605        smbcquotas_auth_info = user_auth_info_init(frame);
    608606        if (smbcquotas_auth_info == NULL) {
     
    695693        popt_burn_cmdline_password(argc, argv);
    696694
     695        ok = lp_load_global(get_dyn_CONFIGFILE());
     696        if (!ok) {
     697                DBG_ERR("ERROR: Loading config file %s - "
     698                        "run testparm to debug it\n",
     699                        get_dyn_CONFIGFILE());
     700                exit(EXIT_PARSE_ERROR);
     701        }
     702
     703        /* We must load interfaces after we load the smb.conf */
     704        load_interfaces();
     705
    697706        string_replace(path, '/', '\\');
    698707
  • vendor/current/source3/utils/smbget.c

    r988 r989  
    106106        static char *savedun;
    107107        static char *savedpw;
    108         char tmp[128];
    109108
    110109        if (hasasked) {
     
    116115        hasasked = true;
    117116
    118         if (!opt.nonprompt && !opt.username_specified) {
    119                 printf("Username for %s at %s [guest] ", shr, srv);
    120                 if (fgets(tmp, sizeof(tmp), stdin) == NULL) {
    121                         return;
    122                 }
    123                 if ((strlen(tmp) > 0) && (tmp[strlen(tmp) - 1] == '\n')) {
    124                         tmp[strlen(tmp) - 1] = '\0';
    125                 }
    126                 strncpy(un, tmp, unlen - 1);
    127         } else if (opt.username != NULL) {
     117        /*
     118         * If no user has been specified un is initialized with the current
     119         * username of the user who started smbget.
     120         */
     121        if (opt.username_specified) {
    128122                strncpy(un, opt.username, unlen - 1);
    129123        }
    130124
    131         if (!opt.nonprompt && !opt.password_specified) {
     125        if (!opt.nonprompt && !opt.password_specified && pw[0] == '\0') {
    132126                char *prompt;
    133                 if (asprintf(&prompt, "Password for %s at %s: ", shr, srv) ==
    134                     -1) {
     127                int rc;
     128
     129                rc = asprintf(&prompt,
     130                              "Password for [%s] connecting to //%s/%s: ",
     131                              un, shr, srv);
     132                if (rc == -1) {
    135133                        return;
    136134                }
Note: See TracChangeset for help on using the changeset viewer.