Ignore:
Timestamp:
Jul 11, 2008, 1:13:42 AM (17 years ago)
Author:
Paul Smedley
Message:

Update branch to 3.0.31 release

Location:
branches/samba-3.0/source/utils
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/utils/net.c

    r134 r140  
    182182                                        opt_password, 0, Undefined, NULL);
    183183
    184         if (NT_STATUS_IS_OK(nt_status)) {
     184        if (NT_STATUS_IS_OK(nt_status) ||
     185            NT_STATUS_EQUAL(nt_status, NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT) ||
     186            NT_STATUS_EQUAL(nt_status, NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT) ||
     187            NT_STATUS_EQUAL(nt_status, NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT)) {
    185188                return nt_status;
    186         } else {
    187                 d_fprintf(stderr, "Could not connect to server %s\n", server_name);
    188 
    189                 /* Display a nicer message depending on the result */
    190 
    191                 if (NT_STATUS_V(nt_status) ==
    192                     NT_STATUS_V(NT_STATUS_LOGON_FAILURE))
    193                         d_fprintf(stderr, "The username or password was not correct.\n");
    194 
    195                 if (NT_STATUS_V(nt_status) ==
    196                     NT_STATUS_V(NT_STATUS_ACCOUNT_LOCKED_OUT))
    197                         d_fprintf(stderr, "The account was locked out.\n");
    198 
    199                 if (NT_STATUS_V(nt_status) ==
    200                     NT_STATUS_V(NT_STATUS_ACCOUNT_DISABLED))
    201                         d_fprintf(stderr, "The account was disabled.\n");
    202 
    203                 return nt_status;
    204         }
     189        }
     190
     191        d_fprintf(stderr, "Could not connect to server %s\n", server_name);
     192
     193        /* Display a nicer message depending on the result */
     194
     195        if (NT_STATUS_V(nt_status) ==
     196            NT_STATUS_V(NT_STATUS_LOGON_FAILURE))
     197                d_fprintf(stderr, "The username or password was not correct.\n");
     198
     199        if (NT_STATUS_V(nt_status) ==
     200            NT_STATUS_V(NT_STATUS_ACCOUNT_LOCKED_OUT))
     201                d_fprintf(stderr, "The account was locked out.\n");
     202
     203        if (NT_STATUS_V(nt_status) ==
     204            NT_STATUS_V(NT_STATUS_ACCOUNT_DISABLED))
     205                d_fprintf(stderr, "The account was disabled.\n");
     206
     207        return nt_status;
    205208}
    206209
     
    482485        struct in_addr server_ip;
    483486        struct cli_state *cli = NULL;
    484         NTSTATUS nt_status;
     487        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
    485488
    486489        if ( !server || !ip ) {
     
    494497        }
    495498
     499        if (opt_user_name && opt_password) {
     500                nt_status = connect_to_ipc(&cli, &server_ip, server_name);
     501                if (NT_STATUS_IS_OK(nt_status)) {
     502                        goto connected;
     503                }
     504        }
    496505        if (flags & NET_FLAGS_ANONYMOUS) {
    497506                nt_status = connect_to_ipc_anonymous(&cli, &server_ip, server_name);
    498         } else {
    499                 nt_status = connect_to_ipc(&cli, &server_ip, server_name);
    500         }
    501 
     507                if (NT_STATUS_IS_OK(nt_status)) {
     508                        goto connected;
     509                }
     510        }
     511
     512        SAFE_FREE(server_name);
     513        d_fprintf(stderr, "Connection failed: %s\n",
     514                  nt_errstr(nt_status));
     515        return NULL;
     516
     517 connected:
    502518        /* store the server in the affinity cache if it was a PDC */
    503519
     
    505521                saf_store( cli->server_domain, cli->desthost );
    506522
    507         SAFE_FREE(server_name);
    508         if (NT_STATUS_IS_OK(nt_status)) {
    509                 return cli;
    510         } else {
    511                 d_fprintf(stderr, "Connection failed: %s\n",
    512                           nt_errstr(nt_status));
    513                 return NULL;
    514         }
     523        return cli;
    515524}
    516525
  • branches/samba-3.0/source/utils/net_domain.c

    r124 r140  
    214214        uchar pwbuf[532];
    215215        SAM_USERINFO_CTR ctr;
     216        SAM_USER_INFO_24 p24;
    216217        SAM_USER_INFO_25 p25;
    217218        const int infolevel = 25;
     
    338339                                           infolevel, &cli->user_session_key, &ctr);
    339340
     341        if (NT_STATUS_EQUAL(status, NT_STATUS(DCERPC_FAULT_INVALID_TAG))) {
     342
     343                uchar pwbuf2[516];
     344
     345                ZERO_STRUCT(p24);
     346
     347                encode_pw_buffer(pwbuf2, clear_pw, STR_UNICODE);
     348
     349                /* retry with level 24 */
     350                init_sam_user_info24(&p24, (char *)pwbuf2, 24);
     351
     352                ctr.switch_value = 24;
     353                ctr.info.id24    = &p24;
     354
     355                status = rpccli_samr_set_userinfo(pipe_hnd, mem_ctx,
     356                                                  &user_pol,
     357                                                  24,
     358                                                  &cli->user_session_key,
     359                                                  &ctr);
     360        }
     361
    340362        if ( !NT_STATUS_IS_OK(status) ) {
    341363                d_fprintf( stderr, "Failed to set password for machine account (%s)\n",
  • branches/samba-3.0/source/utils/net_help.c

    r1 r140  
    6262"  RPC RAP ADS FILE SHARE SESSION SERVER DOMAIN PRINTQ USER GROUP VALIDATE\n"\
    6363"  GROUPMEMBER ADMIN SERVICE PASSWORD TIME LOOKUP GETLOCALSID SETLOCALSID\n"\
    64 SETDOMAINSID CHANGESCRETPW LOOKUP SAM\n");
     64GETDOMAINSID SETDOMAINSID CHANGESCRETPW LOOKUP SAM\n");
    6565        return -1;
    6666}
     
    229229                 "  net join\t\tto join a domain\n"\
    230230                 "  net cache\t\tto operate on cache tdb file\n"\
    231                  "  net getlocalsid [NAME]\tto get the SID for local name\n"\
     231                 "  net getlocalsid [NAME]\tto get the SID for local machine name\n"\
    232232                 "  net setlocalsid SID\tto set the local domain SID\n"\
     233                 "  net getdomainsid the machine SID and the domain SID on the local server\n"\
    233234                 "  net setdomainsid SID\tto set the domain SID on member servers\n"\
    234235                 "  net changesecretpw\tto change the machine password in the local secrets database only\n"\
    235236                 "                    \tthis requires the -f flag as a safety barrier\n"\
    236237                 "  net status\t\tShow server status\n"\
    237                 "  net usersidlist\tto get a list of all users with their SIDs\n"
    238                 "  net usershare\t\tto add, delete and list locally user-modifiable shares\n"
     238                 "  net usersidlist\tto get a list of all users with their SIDs\n"
     239                 "  net usershare\t\tto add, delete and list locally user-modifiable shares\n"
    239240                 "\n"\
    240241                 "  net ads <command>\tto run ADS commands\n"\
  • branches/samba-3.0/source/utils/net_idmap.c

    r44 r140  
    271271int net_help_idmap(int argc, const char **argv)
    272272{
    273         d_printf("net idmap dump <outputfile>\n"\
     273        d_printf("net idmap dump <inputfile>\n"\
    274274                 "    Dump current id mapping\n");
    275275
  • branches/samba-3.0/source/utils/net_rpc.c

    r134 r140  
    54475447                                       argc, argv);
    54485448        } else {
    5449                 d_printf("Usage: net rpc trustdom add <domain>\n");
     5449                d_printf("Usage: net rpc trustdom add <domain> <trust password>\n");
    54505450                return -1;
    54515451        }
  • branches/samba-3.0/source/utils/net_rpc_join.c

    r134 r140  
    4646        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
    4747        enum security_types sec;
    48         unsigned int conn_flags = NET_FLAGS_PDC;
     48        unsigned int conn_flags = NET_FLAGS_PDC | NET_FLAGS_ANONYMOUS;
    4949        struct cli_state *cli = NULL;
    5050        struct rpc_pipe_client *pipe_hnd = NULL;
     
    5959                net_use_machine_account();
    6060
    61         } else {
    62                 /* some servers (e.g. WinNT) don't accept machine-authenticated
    63                    smb connections */
    64                 conn_flags |= NET_FLAGS_ANONYMOUS;
    6561        }
    6662
Note: See TracChangeset for help on using the changeset viewer.