s4:drsuapi RPC server - check for the "SPN" attribute != NULL
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 1 Mar 2011 12:03:59 +0000 (13:03 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 1 Mar 2011 12:55:45 +0000 (13:55 +0100)
The SPN attribute could derive from an untrusted source (client).

Reviewed-by: Jelmer
source4/rpc_server/drsuapi/writespn.c

index e2e12f1689c4c40f6dad5b5c96d903df1c8585df..63fdef21f599a9300d58773dc07c95326c9e094e 100644 (file)
@@ -59,6 +59,12 @@ static bool writespn_check_spn(struct drsuapi_bind_state *b_state,
        krb5_principal principal;
        const char *dns_name, *dnsHostName;
 
+       /* The service principal name shouldn't be NULL */
+       if (spn == NULL) {
+               talloc_free(tmp_ctx);
+               return false;
+       }
+
        /*
          get the objectSid of the DN that is being modified, and
          check it matches the user_sid in their token