mirror of
https://github.com/samba-team/samba.git
synced 2025-11-26 04:23:49 +03:00
r5952: BUG 2469: patch from Jason Mader to cleanup compiler warning when not using krb5
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
e84d070275
commit
19a639ac46
@@ -173,7 +173,9 @@ static ADS_STATUS ads_sasl_spnego_bind(ADS_STRUCT *ads)
|
|||||||
DATA_BLOB blob;
|
DATA_BLOB blob;
|
||||||
char *principal = NULL;
|
char *principal = NULL;
|
||||||
char *OIDs[ASN1_MAX_OIDS];
|
char *OIDs[ASN1_MAX_OIDS];
|
||||||
|
#ifdef HAVE_KRB5
|
||||||
BOOL got_kerberos_mechanism = False;
|
BOOL got_kerberos_mechanism = False;
|
||||||
|
#endif
|
||||||
|
|
||||||
rc = ldap_sasl_bind_s(ads->ld, NULL, "GSS-SPNEGO", NULL, NULL, NULL, &scred);
|
rc = ldap_sasl_bind_s(ads->ld, NULL, "GSS-SPNEGO", NULL, NULL, NULL, &scred);
|
||||||
|
|
||||||
@@ -202,10 +204,12 @@ static ADS_STATUS ads_sasl_spnego_bind(ADS_STRUCT *ads)
|
|||||||
/* make sure the server understands kerberos */
|
/* make sure the server understands kerberos */
|
||||||
for (i=0;OIDs[i];i++) {
|
for (i=0;OIDs[i];i++) {
|
||||||
DEBUG(3,("ads_sasl_spnego_bind: got OID=%s\n", OIDs[i]));
|
DEBUG(3,("ads_sasl_spnego_bind: got OID=%s\n", OIDs[i]));
|
||||||
|
#ifdef HAVE_KRB5
|
||||||
if (strcmp(OIDs[i], OID_KERBEROS5_OLD) == 0 ||
|
if (strcmp(OIDs[i], OID_KERBEROS5_OLD) == 0 ||
|
||||||
strcmp(OIDs[i], OID_KERBEROS5) == 0) {
|
strcmp(OIDs[i], OID_KERBEROS5) == 0) {
|
||||||
got_kerberos_mechanism = True;
|
got_kerberos_mechanism = True;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
free(OIDs[i]);
|
free(OIDs[i]);
|
||||||
}
|
}
|
||||||
DEBUG(3,("ads_sasl_spnego_bind: got server principal name =%s\n", principal));
|
DEBUG(3,("ads_sasl_spnego_bind: got server principal name =%s\n", principal));
|
||||||
|
|||||||
@@ -702,7 +702,9 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
|
|||||||
char *principal;
|
char *principal;
|
||||||
char *OIDs[ASN1_MAX_OIDS];
|
char *OIDs[ASN1_MAX_OIDS];
|
||||||
int i;
|
int i;
|
||||||
|
#ifdef HAVE_KRB5
|
||||||
BOOL got_kerberos_mechanism = False;
|
BOOL got_kerberos_mechanism = False;
|
||||||
|
#endif
|
||||||
DATA_BLOB blob;
|
DATA_BLOB blob;
|
||||||
|
|
||||||
DEBUG(3,("Doing spnego session setup (blob length=%lu)\n", (unsigned long)cli->secblob.length));
|
DEBUG(3,("Doing spnego session setup (blob length=%lu)\n", (unsigned long)cli->secblob.length));
|
||||||
@@ -731,10 +733,12 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
|
|||||||
/* make sure the server understands kerberos */
|
/* make sure the server understands kerberos */
|
||||||
for (i=0;OIDs[i];i++) {
|
for (i=0;OIDs[i];i++) {
|
||||||
DEBUG(3,("got OID=%s\n", OIDs[i]));
|
DEBUG(3,("got OID=%s\n", OIDs[i]));
|
||||||
|
#ifdef HAVE_KRB5
|
||||||
if (strcmp(OIDs[i], OID_KERBEROS5_OLD) == 0 ||
|
if (strcmp(OIDs[i], OID_KERBEROS5_OLD) == 0 ||
|
||||||
strcmp(OIDs[i], OID_KERBEROS5) == 0) {
|
strcmp(OIDs[i], OID_KERBEROS5) == 0) {
|
||||||
got_kerberos_mechanism = True;
|
got_kerberos_mechanism = True;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
free(OIDs[i]);
|
free(OIDs[i]);
|
||||||
}
|
}
|
||||||
DEBUG(3,("got principal=%s\n", principal));
|
DEBUG(3,("got principal=%s\n", principal));
|
||||||
|
|||||||
@@ -417,7 +417,9 @@ static int reply_spnego_negotiate(connection_struct *conn,
|
|||||||
DATA_BLOB secblob;
|
DATA_BLOB secblob;
|
||||||
int i;
|
int i;
|
||||||
DATA_BLOB chal;
|
DATA_BLOB chal;
|
||||||
BOOL got_kerberos = False;
|
#ifdef HAVE_KRB5
|
||||||
|
BOOL got_kerberos_mechanism = False;
|
||||||
|
#endif
|
||||||
NTSTATUS nt_status;
|
NTSTATUS nt_status;
|
||||||
|
|
||||||
/* parse out the OIDs and the first sec blob */
|
/* parse out the OIDs and the first sec blob */
|
||||||
@@ -435,10 +437,12 @@ static int reply_spnego_negotiate(connection_struct *conn,
|
|||||||
client (2ksp3) replied with ntlmssp/mskrb5/krb5 and an
|
client (2ksp3) replied with ntlmssp/mskrb5/krb5 and an
|
||||||
NTLMSSP mechtoken. --jerry */
|
NTLMSSP mechtoken. --jerry */
|
||||||
|
|
||||||
|
#ifdef HAVE_KRB5
|
||||||
if (strcmp(OID_KERBEROS5, OIDs[0]) == 0 ||
|
if (strcmp(OID_KERBEROS5, OIDs[0]) == 0 ||
|
||||||
strcmp(OID_KERBEROS5_OLD, OIDs[0]) == 0) {
|
strcmp(OID_KERBEROS5_OLD, OIDs[0]) == 0) {
|
||||||
got_kerberos = True;
|
got_kerberos_mechanism = True;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i=0;OIDs[i];i++) {
|
for (i=0;OIDs[i];i++) {
|
||||||
DEBUG(3,("Got OID %s\n", OIDs[i]));
|
DEBUG(3,("Got OID %s\n", OIDs[i]));
|
||||||
@@ -447,7 +451,7 @@ static int reply_spnego_negotiate(connection_struct *conn,
|
|||||||
DEBUG(3,("Got secblob of size %lu\n", (unsigned long)secblob.length));
|
DEBUG(3,("Got secblob of size %lu\n", (unsigned long)secblob.length));
|
||||||
|
|
||||||
#ifdef HAVE_KRB5
|
#ifdef HAVE_KRB5
|
||||||
if (got_kerberos && (SEC_ADS == lp_security())) {
|
if (got_kerberos_mechanism && (SEC_ADS == lp_security())) {
|
||||||
int ret = reply_spnego_kerberos(conn, inbuf, outbuf,
|
int ret = reply_spnego_kerberos(conn, inbuf, outbuf,
|
||||||
length, bufsize, &secblob);
|
length, bufsize, &secblob);
|
||||||
data_blob_free(&secblob);
|
data_blob_free(&secblob);
|
||||||
|
|||||||
Reference in New Issue
Block a user