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

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

krb5 commit: Fix creation/rename of top-level profile sections

daemon@ATHENA.MIT.EDU (Greg Hudson)
Tue Jul 29 10:56:59 2014

Date: Tue, 29 Jul 2014 10:56:55 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201407291456.s6TEuteU028776@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/590df2f41f84e0f9492e08f7dbd26fbcd3118ea0
commit 590df2f41f84e0f9492e08f7dbd26fbcd3118ea0
Author: Greg Hudson <ghudson@mit.edu>
Date:   Wed Jul 16 16:30:26 2014 -0400

    Fix creation/rename of top-level profile sections
    
    profile_rename_section should demand only one name.
    
    profile_add_relation should demand only one name if it is creating a
    new section.  It aso needs to reset state before calling
    profile_find_node for the section, in case it didn't look up any
    parent sections previously.
    
    ticket: 7972 (new)
    target_version: 1.12.2
    tags: pullup

 src/util/profile/prof_set.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/util/profile/prof_set.c b/src/util/profile/prof_set.c
index b210236..af4b2f8 100644
--- a/src/util/profile/prof_set.c
+++ b/src/util/profile/prof_set.c
@@ -207,7 +207,7 @@ profile_rename_section(profile_t profile, const char **names,
     if (retval)
         return retval;
 
-    if (names == 0 || names[0] == 0 || names[1] == 0)
+    if (names == 0 || names[0] == 0)
         return PROF_BAD_NAMESET;
 
     k5_mutex_lock(&profile->first_file->data->lock);
@@ -264,7 +264,8 @@ profile_add_relation(profile_t profile, const char **names,
     if (retval)
         return retval;
 
-    if (names == 0 || names[0] == 0 || names[1] == 0)
+    /* Require at least two names for a new relation, one for a new section. */
+    if (names == 0 || names[0] == 0 || (names[1] == 0 && new_value))
         return PROF_BAD_NAMESET;
 
     k5_mutex_lock(&profile->first_file->data->lock);
@@ -282,6 +283,7 @@ profile_add_relation(profile_t profile, const char **names,
     }
 
     if (new_value == 0) {
+        state = 0;
         retval = profile_find_node(section, *cpp, 0, 1, &state, 0);
         if (retval == 0) {
             k5_mutex_unlock(&profile->first_file->data->lock);
_______________________________________________
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