ktpass: also use userPrincipalName for locating the principal
authorMatthieu Patou <mat@matws.net>
Tue, 19 Oct 2010 13:24:27 +0000 (17:24 +0400)
committerMatthieu Patou <mat@samba.org>
Fri, 12 Nov 2010 20:24:23 +0000 (20:24 +0000)
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Fri Nov 12 20:24:23 UTC 2010 on sn-devel-104

source4/scripting/bin/ktpass.sh

index 7c13fe4ac0e7ab3d002cb530c9b151118dfedf93..74f740a8bb4d510cff2d30afa522ff7491f45ab0 100755 (executable)
@@ -66,7 +66,8 @@ fi
 if [ -z $host ]; then
   host=`hostname`
 fi
-kvno=`${path}ldbsearch -H ldap://$host "(|(samaccountname=$princ)(serviceprincipalname=$princ))" msds-keyversionnumber  -k 1 -N 2>/dev/null| grep -i msds-keyversionnumber`
+
+kvno=`${path}ldbsearch -H ldap://$host "(|(samaccountname=$princ)(serviceprincipalname=$princ)(userprincipalname=$princ))" msds-keyversionnumber  -k 1 -N 2>/dev/null| grep -i msds-keyversionnumber`
 if [ "$kvno" == "" ]; then
   echo -ne "Unable to find kvno for principal $princ\n"
   echo -ne " check that you are authentified with kerberos\n"