Ignore:
Timestamp:
Jul 6, 2011, 8:21:13 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update trunk to 3.5.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/libsmb/cliconnect.c

    r590 r599  
    10571057                }
    10581058
    1059                 /* If we get a bad principal, try to guess it if
    1060                    we have a valid host NetBIOS name.
     1059                /* We may not be allowed to use the server-supplied SPNEGO principal, or it may not have been supplied to us
    10611060                 */
    1062                 if (strequal(principal, ADS_IGNORE_PRINCIPAL)) {
     1061                if (!lp_client_use_spnego_principal() || strequal(principal, ADS_IGNORE_PRINCIPAL)) {
    10631062                        TALLOC_FREE(principal);
    10641063                }
     
    10691068                                cli->desthost)) {
    10701069                        char *realm = NULL;
    1071                         char *machine = NULL;
    10721070                        char *host = NULL;
    1073                         DEBUG(3,("cli_session_setup_spnego: got a "
    1074                                 "bad server principal, trying to guess ...\n"));
     1071                        DEBUG(3,("cli_session_setup_spnego: using target "
     1072                                 "hostname not SPNEGO principal\n"));
    10751073
    10761074                        host = strchr_m(cli->desthost, '.');
    1077                         if (host) {
    1078                                 /* We had a '.' in the name. */
    1079                                 machine = SMB_STRNDUP(cli->desthost,
    1080                                         host - cli->desthost);
    1081                         } else {
    1082                                 machine = SMB_STRDUP(cli->desthost);
    1083                         }
    1084                         if (machine == NULL) {
    1085                                 return ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
    1086                         }
    1087 
    10881075                        if (dest_realm) {
    10891076                                realm = SMB_STRDUP(dest_realm);
     
    11001087
    11011088                        if (realm && *realm) {
    1102                                 if (host) {
    1103                                         /* DNS name. */
    1104                                         principal = talloc_asprintf(talloc_tos(),
    1105                                                         "cifs/%s@%s",
    1106                                                         cli->desthost,
    1107                                                         realm);
    1108                                 } else {
    1109                                         /* NetBIOS name, use machine account. */
    1110                                         principal = talloc_asprintf(talloc_tos(),
    1111                                                         "%s$@%s",
    1112                                                         machine,
    1113                                                         realm);
    1114                                 }
     1089                                principal = talloc_asprintf(talloc_tos(),
     1090                                                            "cifs/%s@%s",
     1091                                                            cli->desthost,
     1092                                                            realm);
    11151093                                if (!principal) {
    1116                                         SAFE_FREE(machine);
    11171094                                        SAFE_FREE(realm);
    11181095                                        return ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
     
    11221099                                        principal ? principal : "<null>"));
    11231100                        }
    1124                         SAFE_FREE(machine);
    11251101                        SAFE_FREE(realm);
    11261102                }
Note: See TracChangeset for help on using the changeset viewer.