Ignore:
Timestamp:
May 23, 2008, 6:56:41 AM (17 years ago)
Author:
Paul Smedley
Message:

Update source to 3.0.29

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

Legend:

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

    r124 r134  
    347347
    348348/****************************************************************************
    349  Use the local machine's password for this session.
     349 Use the local machine account (krb) and password for this session.
    350350****************************************************************************/
    351351
    352 int net_use_machine_password(void)
     352int net_use_krb_machine_account(void)
    353353{
    354354        char *user_name = NULL;
     
    359359        }
    360360
    361         user_name = NULL;
    362361        opt_password = secrets_fetch_machine_password(opt_target_workgroup, NULL, NULL);
    363362        if (asprintf(&user_name, "%s$@%s", global_myname(), lp_realm()) == -1) {
     363                return -1;
     364        }
     365        opt_user_name = user_name;
     366        return 0;
     367}
     368
     369/****************************************************************************
     370 Use the machine account name and password for this session.
     371****************************************************************************/
     372
     373int net_use_machine_account(void)
     374{
     375        char *user_name = NULL;
     376               
     377        if (!secrets_init()) {
     378                d_fprintf(stderr, "ERROR: Unable to open secrets database\n");
     379                exit(1);
     380        }
     381
     382        opt_password = secrets_fetch_machine_password(opt_target_workgroup, NULL, NULL);
     383        if (asprintf(&user_name, "%s$", global_myname()) == -1) {
    364384                return -1;
    365385        }
     
    10351055                   machine account for testing purposes and for domain leave */
    10361056
    1037                 net_use_machine_password();
     1057                net_use_krb_machine_account();
    10381058        }
    10391059
  • branches/samba-3.0/source/utils/net_ads.c

    r62 r134  
    887887        }
    888888
    889         net_use_machine_password();
     889        net_use_krb_machine_account();
    890890
    891891        status = ads_startup(True, &ads);
     
    21712171        }
    21722172
    2173         net_use_machine_password();
     2173        net_use_krb_machine_account();
    21742174
    21752175        use_in_memory_ccache();
  • branches/samba-3.0/source/utils/net_proto.h

    r1 r134  
    2323                        struct in_addr *server_ip, const char *server_name);
    2424NTSTATUS connect_dst_pipe(struct cli_state **cli_dst, struct rpc_pipe_client **pp_pipe_hnd, int pipe_num);
    25 int net_use_machine_password(void) ;
     25int net_use_krb_machine_account(void) ;
     26int net_use_machine_account(void);
    2627BOOL net_find_server(const char *domain, unsigned flags, struct in_addr *server_ip, char **server_name);
    2728BOOL net_find_pdc(struct in_addr *server_ip, fstring server_name, const char *domain_name);
  • branches/samba-3.0/source/utils/net_rpc.c

    r124 r134  
    58845884
    58855885#ifdef DEBUG_PASSWORD
    5886         DEBUG(100,("sucessfully vampired trusted domain [%s], sid: [%s], password: [%s]\n", 
     5886        DEBUG(100,("successfully vampired trusted domain [%s], sid: [%s], password: [%s]\n", 
    58875887                trusted_dom_name, sid_string_static(&dom_sid), cleartextpwd));
    58885888#endif
  • branches/samba-3.0/source/utils/net_rpc_join.c

    r124 r134  
    4444int net_rpc_join_ok(const char *domain, const char *server, struct in_addr *ip )
    4545{
    46         uint32 neg_flags = NETLOGON_NEG_SELECT_AUTH2_FLAGS|NETLOGON_NEG_SCHANNEL;
     46        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
     47        enum security_types sec;
     48        unsigned int conn_flags = NET_FLAGS_PDC;
    4749        struct cli_state *cli = NULL;
    4850        struct rpc_pipe_client *pipe_hnd = NULL;
     
    5052        NTSTATUS ntret = NT_STATUS_UNSUCCESSFUL;
    5153
     54        sec = (enum security_types)lp_security();
     55
     56        if (sec == SEC_ADS) {
     57                /* Connect to IPC$ using machine account's credentials. We don't use anonymous
     58                   connection here, as it may be denied by server's local policy. */
     59                net_use_machine_account();
     60
     61        } else {
     62                /* some servers (e.g. WinNT) don't accept machine-authenticated
     63                   smb connections */
     64                conn_flags |= NET_FLAGS_ANONYMOUS;
     65        }
     66
    5267        /* Connect to remote machine */
    53         if (!(cli = net_make_ipc_connection_ex(domain, server, ip, (NET_FLAGS_ANONYMOUS|NET_FLAGS_PDC)))) {
     68        if (!(cli = net_make_ipc_connection_ex(domain, server, ip, conn_flags))) {
    5469                return -1;
    5570        }
     
    115130        TALLOC_CTX *mem_ctx;
    116131        uint32 acb_info = ACB_WSTRUST;
    117         uint32 neg_flags = NETLOGON_NEG_SELECT_AUTH2_FLAGS|(lp_client_schannel() ? NETLOGON_NEG_SCHANNEL : 0);
     132        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
    118133        uint32 sec_channel_type;
    119134        struct rpc_pipe_client *pipe_hnd = NULL;
  • branches/samba-3.0/source/utils/net_rpc_samsync.c

    r124 r134  
    239239        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
    240240        uchar trust_password[16];
    241         uint32 neg_flags = NETLOGON_NEG_SELECT_AUTH2_FLAGS;
     241        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
    242242        uint32 sec_channel_type = 0;
    243243
  • branches/samba-3.0/source/utils/net_sam.c

    r124 r134  
    10281028                }
    10291029
    1030                 smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectclass", LDAP_OBJ_POSIXGROUP);
     1030                smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_POSIXGROUP);
    10311031                smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_GROUPMAP);
    10321032                smbldap_set_mod(&mods, LDAP_MOD_ADD, "cn", uname);
     
    10821082                }
    10831083
    1084                 smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectclass", LDAP_OBJ_POSIXGROUP);
     1084                smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_POSIXGROUP);
    10851085                smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_GROUPMAP);
    10861086                smbldap_set_mod(&mods, LDAP_MOD_ADD, "cn", uname);
     
    13011301                sid_compose(&gsid, get_global_sam_sid(), DOMAIN_GROUP_RID_GUESTS);
    13021302
    1303                 smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectclass", LDAP_OBJ_POSIXGROUP);
     1303                smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_POSIXGROUP);
    13041304                smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_GROUPMAP);
    13051305                smbldap_set_mod(&mods, LDAP_MOD_ADD, "cn", uname);
  • branches/samba-3.0/source/utils/ntlm_auth.c

    r22 r134  
    691691        if (strlen(buf) < 2) {
    692692                DEBUG(1, ("NTLMSSP query [%s] invalid", buf));
    693                 x_fprintf(x_stdout, "BH\n");
     693                x_fprintf(x_stdout, "BH NTLMSSP query invalid\n");
    694694                return;
    695695        }
     
    715715                if (opt_password == NULL) {
    716716                        DEBUG(1, ("Out of memory\n"));
    717                         x_fprintf(x_stdout, "BH\n");
     717                        x_fprintf(x_stdout, "BH Out of memory\n");
    718718                        data_blob_free(&request);
    719719                        return;
     
    742742                        SAFE_FREE(key64);
    743743                } else {
    744                         x_fprintf(x_stdout, "BH\n");
     744                        x_fprintf(x_stdout, "BH No session key available\n");
    745745                }
    746746                       
     
    749749        } else {
    750750                DEBUG(1, ("NTLMSSP query [%s] invalid", buf));
    751                 x_fprintf(x_stdout, "BH\n");
     751                x_fprintf(x_stdout, "BH NTLMSSP query invalid\n");
    752752                return;
    753753        }
     
    819819        if (strlen(buf) < 2) {
    820820                DEBUG(1, ("NTLMSSP query [%s] invalid", buf));
    821                 x_fprintf(x_stdout, "BH\n");
     821                x_fprintf(x_stdout, "BH NTLMSSP query invalid\n");
    822822                return;
    823823        }
     
    843843                if (opt_password == NULL) {
    844844                        DEBUG(1, ("Out of memory\n"));
    845                         x_fprintf(x_stdout, "BH\n");
     845                        x_fprintf(x_stdout, "BH Out of memory\n");
    846846                        data_blob_free(&request);
    847847                        return;
     
    893893                }
    894894                else {
    895                         x_fprintf(x_stdout, "BH\n");
     895                        x_fprintf(x_stdout, "BH No session key available\n");
    896896                }
    897897
     
    900900        } else {
    901901                DEBUG(1, ("NTLMSSP query [%s] invalid", buf));
    902                 x_fprintf(x_stdout, "BH\n");
     902                x_fprintf(x_stdout, "BH NTLMSSP query invalid\n");
    903903                return;
    904904        }
     
    10281028        if (len == -1) {
    10291029                DEBUG(1, ("Could not write SPNEGO data blob\n"));
    1030                 x_fprintf(x_stdout, "BH\n");
     1030                x_fprintf(x_stdout, "BH Could not write SPNEGO data blob\n");
    10311031                return;
    10321032        }
     
    10591059        if (strlen(buf) < 2) {
    10601060                DEBUG(1, ("SPENGO query [%s] invalid", buf));
    1061                 x_fprintf(x_stdout, "BH\n");
     1061                x_fprintf(x_stdout, "BH SPENGO query invalid\n");
    10621062                return;
    10631063        }
     
    10701070        } else {
    10711071                DEBUG(1, ("SPENGO query [%s] invalid", buf));
    1072                 x_fprintf(x_stdout, "BH\n");
     1072                x_fprintf(x_stdout, "BH SPENGO query invalid\n");
    10731073                return;
    10741074        }
     
    10871087        if (strlen(buf) <= 3) {
    10881088                DEBUG(1, ("GSS-SPNEGO query [%s] invalid\n", buf));
    1089                 x_fprintf(x_stdout, "BH\n");
     1089                x_fprintf(x_stdout, "BH GSS-SPNEGO query invalid\n");
    10901090                return;
    10911091        }
     
    10971097        if (len == -1) {
    10981098                DEBUG(1, ("GSS-SPNEGO query [%s] invalid", buf));
    1099                 x_fprintf(x_stdout, "BH\n");
     1099                x_fprintf(x_stdout, "BH GSS-SPNEGO query invalid\n");
    11001100                return;
    11011101        }
     
    11091109                     (request.negTokenInit.mechTypes[0] == NULL) ) {
    11101110                        DEBUG(1, ("Client did not offer any mechanism"));
    1111                         x_fprintf(x_stdout, "BH\n");
     1111                        x_fprintf(x_stdout, "BH Client did not offer any mechanism\n");
    11121112                        return;
    11131113                }
     
    11171117
    11181118                        if ( request.negTokenInit.mechToken.data == NULL ) {
    1119                                 DEBUG(1, ("Client did not provide  NTLMSSP data\n"));
    1120                                 x_fprintf(x_stdout, "BH\n");
     1119                                DEBUG(1, ("Client did not provide NTLMSSP data\n"));
     1120                                x_fprintf(x_stdout, "BH Client did not provide NTLMSSP data\n");
    11211121                                return;
    11221122                        }
     
    11251125                                DEBUG(1, ("Client wants a new NTLMSSP challenge, but "
    11261126                                          "already got one\n"));
    1127                                 x_fprintf(x_stdout, "BH\n");
     1127                                x_fprintf(x_stdout, "BH Client wants a new NTLMSSP challenge, but already got one\n");
    11281128                                ntlmssp_end(&ntlmssp_state);
    11291129                                return;
     
    11581158                        if ( request.negTokenInit.mechToken.data == NULL ) {
    11591159                                DEBUG(1, ("Client did not provide Kerberos data\n"));
    1160                                 x_fprintf(x_stdout, "BH\n");
     1160                                x_fprintf(x_stdout, "BH Client did not provide Kerberos data\n");
    11611161                                return;
    11621162                        }
     
    11841184                                        DEBUG(1, ("Did not get a valid principal "
    11851185                                                  "from ads_verify_ticket\n"));
    1186                                         x_fprintf(x_stdout, "BH\n");
     1186                                        x_fprintf(x_stdout, "BH Did not get a valid principal from ads_verify_ticket\n");
    11871187                                        return;
    11881188                                }
     
    12071207                        DEBUG(1, ("Got a negTokenTarg for something non-NTLMSSP: %s\n",
    12081208                                  request.negTokenTarg.supportedMech));
    1209                         x_fprintf(x_stdout, "BH\n");
     1209                        x_fprintf(x_stdout, "BH Got a negTokenTarg for something non-NTLMSSP\n");
    12101210                        return;
    12111211                }
     
    12131213                if (request.negTokenTarg.responseToken.data == NULL) {
    12141214                        DEBUG(1, ("Got a negTokenTarg without a responseToken!\n"));
    1215                         x_fprintf(x_stdout, "BH\n");
     1215                        x_fprintf(x_stdout, "BH Got a negTokenTarg without a responseToken!\n");
    12161216                        return;
    12171217                }
     
    12571257        if (len == -1) {
    12581258                DEBUG(1, ("Could not write SPNEGO data blob\n"));
    1259                 x_fprintf(x_stdout, "BH\n");
     1259                x_fprintf(x_stdout, "BH Could not write SPNEGO data blob\n");
    12601260                return;
    12611261        }
     
    13471347        if (client_ntlmssp_state == NULL) {
    13481348                DEBUG(1, ("Got NTLMSSP tArg without a client state\n"));
    1349                 x_fprintf(x_stdout, "BH\n");
     1349                x_fprintf(x_stdout, "BH Got NTLMSSP tArg without a client state\n");
    13501350                return;
    13511351        }
     
    13711371                          "ntlmssp_client_update, got: %s\n",
    13721372                          nt_errstr(status)));
    1373                 x_fprintf(x_stdout, "BH\n");
     1373                x_fprintf(x_stdout, "BH Expected MORE_PROCESSING_REQUIRED from ntlmssp_client_update\n");
    13741374                data_blob_free(&request);
    13751375                ntlmssp_end(&client_ntlmssp_state);
     
    14871487        case SPNEGO_ACCEPT_INCOMPLETE:
    14881488                DEBUG(1, ("Got a Kerberos negTokenTarg with ACCEPT_INCOMPLETE\n"));
    1489                 x_fprintf(x_stdout, "BH\n");
     1489                x_fprintf(x_stdout, "BH Got a Kerberos negTokenTarg with ACCEPT_INCOMPLETE\n");
    14901490                break;
    14911491        case SPNEGO_ACCEPT_COMPLETED:
     
    15191519        if (strlen(buf) <= 3) {
    15201520                DEBUG(1, ("SPNEGO query [%s] too short\n", buf));
    1521                 x_fprintf(x_stdout, "BH\n");
     1521                x_fprintf(x_stdout, "BH SPNEGO query too short\n");
    15221522                return;
    15231523        }
     
    15331533                if (opt_password == NULL) {
    15341534                        DEBUG(1, ("Out of memory\n"));
    1535                         x_fprintf(x_stdout, "BH\n");
     1535                        x_fprintf(x_stdout, "BH Out of memory\n");
    15361536                        data_blob_free(&request);
    15371537                        return;
     
    15471547             (strncmp(buf, "NA ", 3) != 0) ) {
    15481548                DEBUG(1, ("SPNEGO request [%s] invalid\n", buf));
    1549                 x_fprintf(x_stdout, "BH\n");
     1549                x_fprintf(x_stdout, "BH SPNEGO request invalid\n");
    15501550                data_blob_free(&request);
    15511551                return;
     
    15601560        if (len == -1) {
    15611561                DEBUG(1, ("Could not read SPNEGO data for [%s]\n", buf));
    1562                 x_fprintf(x_stdout, "BH\n");
     1562                x_fprintf(x_stdout, "BH Could not read SPNEGO data\n");
    15631563                return;
    15641564        }
     
    15891589
    15901590                DEBUG(1, ("Server offered no compatible mechanism\n"));
    1591                 x_fprintf(x_stdout, "BH\n");
     1591                x_fprintf(x_stdout, "BH Server offered no compatible mechanism\n");
    15921592                return;
    15931593        }
     
    16111611                                          "unknown negResult: %d\n",
    16121612                                          spnego.negTokenTarg.negResult));
    1613                                 x_fprintf(x_stdout, "BH\n");
     1613                                x_fprintf(x_stdout, "BH Got a negTokenTarg with no mech and an unknown negResult\n");
    16141614                        }
    16151615
     
    16351635
    16361636        DEBUG(1, ("Got an SPNEGO token I could not handle [%s]!\n", buf));
    1637         x_fprintf(x_stdout, "BH\n");
     1637        x_fprintf(x_stdout, "BH Got an SPNEGO token I could not handle\n");
    16381638        return;
    16391639
Note: See TracChangeset for help on using the changeset viewer.