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/libsmb
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/libsmb/asn1.c

    r1 r140  
    397397        if (strcmp(id, OID) != 0) {
    398398                data->has_error = True;
     399                free(id);
    399400                return False;
    400401        }
  • branches/samba-3.0/source/libsmb/cliconnect.c

    r134 r140  
    788788/****************************************************************************
    789789 Do a spnego encrypted session setup.
     790
     791 user_domain: The shortname of the domain the user/machine is a member of.
     792 dest_realm: The realm we're connecting to, if NULL we use our default realm.
    790793****************************************************************************/
    791794
    792795ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
    793                               const char *pass, const char *domain)
    794 {
    795         char *principal;
     796                              const char *pass, const char *user_domain,
     797                              const char * dest_realm)
     798{
     799        char *principal = NULL;
    796800        char *OIDs[ASN1_MAX_OIDS];
    797801        int i;
     
    814818        blob = data_blob(cli->secblob.data+16, cli->secblob.length-16);
    815819
    816         /* the server sent us the first part of the SPNEGO exchange in the negprot
    817            reply */
     820        /* The server sent us the first part of the SPNEGO exchange in the
     821         * negprot reply. It is WRONG to depend on the principal sent in the
     822         * negprot reply, but right now we do it. If we don't receive one,
     823         * we try to best guess, then fall back to NTLM.  */
    818824        if (!spnego_parse_negTokenInit(blob, OIDs, &principal)) {
    819825                data_blob_free(&blob);
     
    833839
    834840        DEBUG(3,("got principal=%s\n", principal ? principal : "<null>"));
    835 
    836         if (got_kerberos_mechanism && (principal == NULL)) {
    837                 /*
    838                  * It is WRONG to depend on the principal sent in the negprot
    839                  * reply, but right now we do it. So for safety (don't
    840                  * segfault later) disable Kerberos when no principal was
    841                  * sent. -- VL
    842                  */
    843                 DEBUG(1, ("Kerberos mech was offered, but no principal was "
    844                           "sent, disabling Kerberos\n"));
    845                 cli->use_kerberos = False;
    846         }
    847841
    848842        fstrcpy(cli->user_name, user);
     
    897891                        }
    898892
    899                         realm = kerberos_get_default_realm_from_ccache();
     893                        if (dest_realm) {
     894                                realm = SMB_STRDUP(dest_realm);
     895                                strupper_m(realm);
     896                        } else {
     897                                realm = kerberos_get_default_realm_from_ccache();
     898                        }
    900899                        if (realm && *realm) {
    901900                                if (asprintf(&principal, "%s$@%s",
     
    914913
    915914                if (principal) {
    916                         rc = cli_session_setup_kerberos(cli, principal, domain);
     915                        rc = cli_session_setup_kerberos(cli, principal,
     916                                dest_realm);
    917917                        if (ADS_ERR_OK(rc) || !cli->fallback_after_kerberos) {
    918918                                SAFE_FREE(principal);
     
    927927ntlmssp:
    928928
    929         return ADS_ERROR_NT(cli_session_setup_ntlmssp(cli, user, pass, domain));
     929        return ADS_ERROR_NT(cli_session_setup_ntlmssp(cli, user, pass,
     930                user_domain));
    930931}
    931932
     
    10101011
    10111012        if (cli->capabilities & CAP_EXTENDED_SECURITY) {
    1012                 ADS_STATUS status = cli_session_setup_spnego(cli, user, pass, workgroup);
     1013                ADS_STATUS status = cli_session_setup_spnego(cli, user, pass,
     1014                                                             workgroup, NULL);
    10131015                if (!ADS_ERR_OK(status)) {
    10141016                        DEBUG(3, ("SPNEGO login failed: %s\n", ads_errstr(status)));
     
    13291331                        SAFE_FREE(cli->outbuf);
    13301332                        SAFE_FREE(cli->inbuf);
    1331                         cli->outbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+SAFETY_MARGIN);
    1332                         cli->inbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+SAFETY_MARGIN);
    1333                         cli->bufsize = CLI_SAMBA_MAX_LARGE_READX_SIZE;
     1333                        cli->outbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+LARGE_WRITEX_HDR_SIZE+SAFETY_MARGIN);
     1334                        cli->inbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+LARGE_WRITEX_HDR_SIZE+SAFETY_MARGIN);
     1335                        cli->bufsize = CLI_SAMBA_MAX_LARGE_READX_SIZE + LARGE_WRITEX_HDR_SIZE;
    13341336                }
    13351337
  • branches/samba-3.0/source/libsmb/clierror.c

    r124 r140  
    235235        {NT_STATUS_ACCESS_DENIED, EACCES},
    236236        {NT_STATUS_OBJECT_NAME_NOT_FOUND, ENOENT},
     237        {NT_STATUS_OBJECT_PATH_NOT_FOUND, ENOENT},
    237238        {NT_STATUS_SHARING_VIOLATION, EBUSY},
    238239        {NT_STATUS_OBJECT_PATH_INVALID, ENOTDIR},
  • branches/samba-3.0/source/libsmb/namequery.c

    r1 r140  
    14291429        BOOL done_auto_lookup = False;
    14301430        int auto_count = 0;
     1431        NTSTATUS status;
     1432
     1433        *ip_list = NULL;
     1434        *count = 0;
    14311435
    14321436        *ordered = False;
     
    14811485                if (internal_resolve_name(domain, 0x1C, sitename, ip_list, count,
    14821486                                          resolve_order)) {
    1483                         return NT_STATUS_OK;
     1487                        status = NT_STATUS_OK;
     1488                        goto out;
    14841489                } else {
    1485                         return NT_STATUS_NO_LOGON_SERVERS;
     1490                        status = NT_STATUS_NO_LOGON_SERVERS;
     1491                        goto out;
    14861492                }
    14871493        }
     
    14981504        p = pserver;
    14991505        while (next_token(&p,name,LIST_SEP,sizeof(name))) {
    1500                 if (strequal(name, "*")) {
     1506                if (!done_auto_lookup && strequal(name, "*")) {
    15011507                        if (internal_resolve_name(domain, 0x1C, sitename, &auto_ip_list,
    15021508                                                  &auto_count, resolve_order))
     
    15151521                if ( done_auto_lookup ) {
    15161522                        DEBUG(4,("get_dc_list: no servers found\n"));
    1517                         SAFE_FREE(auto_ip_list);
    1518                         return NT_STATUS_NO_LOGON_SERVERS;
     1523                        status = NT_STATUS_NO_LOGON_SERVERS;
     1524                        goto out;
    15191525                }
    15201526                if (internal_resolve_name(domain, 0x1C, sitename, ip_list, count,
    15211527                                          resolve_order)) {
    1522                         return NT_STATUS_OK;
     1528                        status = NT_STATUS_OK;
     1529                        goto out;
    15231530                } else {
    1524                         return NT_STATUS_NO_LOGON_SERVERS;
     1531                        status = NT_STATUS_NO_LOGON_SERVERS;
     1532                        goto out;
    15251533                }
    15261534        }
     
    15281536        if ( (return_iplist = SMB_MALLOC_ARRAY(struct ip_service, num_addresses)) == NULL ) {
    15291537                DEBUG(3,("get_dc_list: malloc fail !\n"));
    1530                 SAFE_FREE(auto_ip_list);
    1531                 return NT_STATUS_NO_MEMORY;
     1538                status = NT_STATUS_NO_MEMORY;
     1539                goto out;
    15321540        }
    15331541
     
    15861594        }
    15871595                               
    1588         SAFE_FREE(auto_ip_list);
    1589 
    15901596        /* need to remove duplicates in the list if we have any
    15911597           explicit password servers */
     
    16071613        *count = local_count;
    16081614
    1609         return ( *count != 0 ? NT_STATUS_OK : NT_STATUS_NO_LOGON_SERVERS );
     1615        status = ( *count != 0 ? NT_STATUS_OK : NT_STATUS_NO_LOGON_SERVERS );
     1616
     1617  out:
     1618
     1619        if (!NT_STATUS_IS_OK(status)) {
     1620                SAFE_FREE(return_iplist);
     1621                *ip_list = NULL;
     1622                *count = 0;
     1623        }
     1624
     1625        SAFE_FREE(auto_ip_list);
     1626
     1627        return status;
    16101628}
    16111629
  • branches/samba-3.0/source/libsmb/smbencrypt.c

    r124 r140  
    183183        if (domain_byte_len == (size_t)-1) {
    184184                DEBUG(0, ("push_uss2_allocate() for domain returned -1 (probably malloc() failure)\n"));
     185                SAFE_FREE(user);
    185186                return False;
    186187        }
Note: See TracChangeset for help on using the changeset viewer.