[28402] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit [krb5-1.12]: Avoid duplicate "/etc/krb5.conf" in profile

daemon@ATHENA.MIT.EDU (Tom Yu)
Thu Jun 26 16:36:30 2014

Date: Thu, 26 Jun 2014 16:36:12 -0400
From: Tom Yu <tlyu@mit.edu>
Message-Id: <201406262036.s5QKaCmD007710@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/51ef4b50e46d21374319b7070ad63ba7bb672ee2
commit 51ef4b50e46d21374319b7070ad63ba7bb672ee2
Author: Tom Yu <tlyu@mit.edu>
Date:   Tue Feb 25 17:35:35 2014 -0500

    Avoid duplicate "/etc/krb5.conf" in profile path
    
    If configure gets run with --sysconfdir=/etc, "/etc/krb5.conf" shows
    up twice in the profile path, which causes its contents to be read
    twice.  This can cause some confusing and possibly problematic
    behavior.
    
    Add some logic to configure.in to avoid adding the duplicate entry for
    "/etc/krb5.conf".
    
    Reported independently by Denis Vlasenko and Fredrik Tolf.
    
    (back ported from commit 8df1965d1ccdbcb8d74a3e68ad35d7579db9ac44)
    
    ticket: 3277
    version_fixed: 1.12.2
    status: resolved

 src/configure.in        |    9 +++++++++
 src/include/Makefile.in |    4 +++-
 src/include/osconf.hin  |    4 ++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/configure.in b/src/configure.in
index 5b7121b..2d29336 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1,5 +1,14 @@
 K5_AC_INIT([aclocal.m4])
 
+# Don't make duplicate profile path entries for /etc/krb5.conf if
+# $sysconfdir is /etc
+if test "$sysconfdir" == /etc; then
+  SYSCONFCONF=""
+else
+  SYSCONFCONF=":${sysconfdir}/krb5.conf"
+fi
+AC_SUBST(SYSCONFCONF)
+
 CONFIG_RULES
 KRB5_VERSION=K5_VERSION
 AC_SUBST(KRB5_VERSION)
diff --git a/src/include/Makefile.in b/src/include/Makefile.in
index e13042a..4f478d1 100644
--- a/src/include/Makefile.in
+++ b/src/include/Makefile.in
@@ -56,6 +56,7 @@ LOCALSTATEDIR = @localstatedir@
 BINDIR = @bindir@
 SBINDIR = @sbindir@
 LIBDIR  = @libdir@
+SYSCONFCONF = @SYSCONFCONF@
 
 PROCESS_REPLACE = -e "s+@KRB5RCTMPDIR+$(KRB5RCTMPDIR)+" \
 		  -e "s+@PREFIX+$(INSTALL_PREFIX)+" \
@@ -67,7 +68,8 @@ PROCESS_REPLACE = -e "s+@KRB5RCTMPDIR+$(KRB5RCTMPDIR)+" \
 		  -e "s+@GSSMODULEDIR+$(GSS_MODULE_DIR)+" \
 		  -e 's+@LOCALSTATEDIR+$(LOCALSTATEDIR)+' \
 		  -e 's+@SYSCONFDIR+$(SYSCONFDIR)+' \
-		  -e 's+@DYNOBJEXT+$(DYNOBJEXT)+'
+		  -e 's+@DYNOBJEXT+$(DYNOBJEXT)+' \
+		  -e 's+@SYSCONFCONF+$(SYSCONFCONF)+'
 
 OSCONFSRC = $(srcdir)/osconf.hin
 
diff --git a/src/include/osconf.hin b/src/include/osconf.hin
index 90ab86d..0dbd22d 100644
--- a/src/include/osconf.hin
+++ b/src/include/osconf.hin
@@ -44,13 +44,13 @@
 #define DEFAULT_PROFILE_FILENAME "krb5.ini"
 #else /* !_WINDOWS */
 #if TARGET_OS_MAC
-#define DEFAULT_SECURE_PROFILE_PATH "/Library/Preferences/edu.mit.Kerberos:/etc/krb5.conf:@SYSCONFDIR/krb5.conf"
+#define DEFAULT_SECURE_PROFILE_PATH "/Library/Preferences/edu.mit.Kerberos:/etc/krb5.conf@SYSCONFCONF"
 #define DEFAULT_PROFILE_PATH        ("~/Library/Preferences/edu.mit.Kerberos" ":" DEFAULT_SECURE_PROFILE_PATH)
 #define KRB5_PLUGIN_BUNDLE_DIR       "/System/Library/KerberosPlugins/KerberosFrameworkPlugins"
 #define KDB5_PLUGIN_BUNDLE_DIR       "/System/Library/KerberosPlugins/KerberosDatabasePlugins"
 #define KRB5_AUTHDATA_PLUGIN_BUNDLE_DIR  "/System/Library/KerberosPlugins/KerberosAuthDataPlugins"
 #else
-#define DEFAULT_SECURE_PROFILE_PATH     "/etc/krb5.conf:@SYSCONFDIR/krb5.conf"
+#define DEFAULT_SECURE_PROFILE_PATH     "/etc/krb5.conf@SYSCONFCONF"
 #define DEFAULT_PROFILE_PATH        DEFAULT_SECURE_PROFILE_PATH
 #endif
 #endif /* _WINDOWS  */
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post