BUG 9699: Fix adding case sensitive spn.
authorAndreas Schneider <asn@samba.org>
Wed, 3 Apr 2013 13:46:00 +0000 (15:46 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 3 Apr 2013 21:57:32 +0000 (23:57 +0200)
We should be able to define the case of the spn cause it is important
for some services like nfs. 'net ads keytab add "nfs"' should not
result in an uppercase spn.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr  3 23:57:32 CEST 2013 on sn-devel-104

source3/libads/ldap.c

index ca5962cf3201347ddbcbc4c31d718eb8c684cb04..2a4a83b34ae9ea9aff53e8e85debb6ee88967090 100644 (file)
@@ -1949,12 +1949,7 @@ ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_n
                ads_msgfree(ads, res);
                return ADS_ERROR(LDAP_NO_MEMORY);
        }
-       if (!strupper_m(psp1)) {
-               ret = ADS_ERROR(LDAP_NO_MEMORY);
-               goto out;
-       }
-
-       if (!strlower_m(&psp1[strlen(spn)])) {
+       if (!strlower_m(&psp1[strlen(spn) + 1])) {
                ret = ADS_ERROR(LDAP_NO_MEMORY);
                goto out;
        }
@@ -1970,12 +1965,7 @@ ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_n
                ret = ADS_ERROR(LDAP_NO_MEMORY);
                goto out;
        }
-       if (!strupper_m(psp2)) {
-               ret = ADS_ERROR(LDAP_NO_MEMORY);
-               goto out;
-       }
-
-       if (!strlower_m(&psp2[strlen(spn)])) {
+       if (!strlower_m(&psp2[strlen(spn) + 1])) {
                ret = ADS_ERROR(LDAP_NO_MEMORY);
                goto out;
        }