[debian-edu-commits] [Git][debian-edu/debian-edu-config][buster] share/d-e-c/tools/gosa-modify-host: Only create Kerberos host and service...
Mike Gabriel (@sunweaver)
gitlab at salsa.debian.org
Tue Feb 8 15:35:17 GMT 2022
Mike Gabriel pushed to branch buster at Debian Edu / debian-edu-config
Commits:
add05ae0 by Mike Gabriel at 2022-02-07T16:14:30+01:00
share/d-e-c/tools/gosa-modify-host: Only create Kerberos host and service principals if they don't yet exist. (Closes: #1002014).
- - - - -
2 changed files:
- debian/changelog
- share/debian-edu-config/tools/gosa-modify-host
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+debian-edu-config (2.11.56+deb10u8) UNRELEASED; urgency=medium
+
+ * share/d-e-c/tools/gosa-modify-host: Only create Kerberos host and service
+ principals if they don't yet exist. (Closes: #1002014).
+
+ -- Mike Gabriel <sunweaver at debian.org> Fri, 14 Dec 2021 22:21:50 +0100
+
debian-edu-config (2.10.65+deb10u7) buster; urgency=medium
[ Mike Gabriel ]
=====================================
share/debian-edu-config/tools/gosa-modify-host
=====================================
@@ -7,11 +7,19 @@ set -ex
HOST="$1"
-kadmin.local -q "add_principal -policy hosts -randkey host/$HOST.intern"
-kadmin.local -q "ktadd -k /etc/debian-edu/host-keytabs/$HOST.intern.keytab host/$HOST.intern"
-kadmin.local -q "add_principal -policy hosts -randkey nfs/$HOST.intern"
-kadmin.local -q "ktadd -k /etc/debian-edu/host-keytabs/$HOST.intern.keytab nfs/$HOST.intern"
-logger -t gosa-modify-host -p notice Krb5 principals and keytab file for host \'$HOST\' created.
+# This is only for kerberizing host entries in LDAP stemming from earlier installations
+# of Debian Edu... Normally, host and service principals should have been created
+# by the gosa-host-create hook script.
+if ! LANG=C kadmin.local -q "get_principal host/$HOST.intern" 2>/dev/null | grep -q "^Principal: host/$HOST.intern at .*"; then
+ kadmin.local -q "add_principal -policy hosts -randkey host/$HOST.intern"
+ kadmin.local -q "ktadd -k /etc/debian-edu/host-keytabs/$HOST.intern.keytab host/$HOST.intern"
+ logger -t gosa-modify-host -p notice Krb5 host principal \'host/$HOST.intern\' created and added to host-specific keytab file.
+fi
+if ! LANG=C kadmin.local -q "get_principal nfs/$HOST.intern" 2>/dev/null | grep -q "^Principal: nfs/$HOST.intern at .*"; then
+ kadmin.local -q "add_principal -policy hosts -randkey nfs/$HOST.intern"
+ kadmin.local -q "ktadd -k /etc/debian-edu/host-keytabs/$HOST.intern.keytab nfs/$HOST.intern"
+ logger -t gosa-modify-host -p notice Krb5 service principal \'nfs/$HOST.intern\' created and added to host-specific keytab file.
+fi
# update services:
/usr/share/debian-edu-config/tools/gosa-sync-dns-nfs
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/add05ae0f791006c89333453549f6cd4bbca490c
--
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/add05ae0f791006c89333453549f6cd4bbca490c
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20220208/5da78010/attachment-0001.htm>
More information about the debian-edu-commits
mailing list