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

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

krb5 commit: Accept new passwords as const char pointers

daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Oct 7 11:59:40 2015

Date: Wed, 7 Oct 2015 11:59:36 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201510071559.t97Fxa6X006847@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/03c5058f2a1315aa718f0a083f5568bedaf187e8
commit 03c5058f2a1315aa718f0a083f5568bedaf187e8
Author: Andreas Schneider <asn@samba.org>
Date:   Tue Oct 6 13:35:03 2015 +0200

    Accept new passwords as const char pointers
    
    In krb5_change_password(), krb5_set_password(), and
    krb5_set_password_using_ccache(), accept the new password as a const
    char * instead of a char *.  Propagate this change to the necessary
    internal functions.
    
    [ghudson@mit.edu: commit message rewrite]
    
    ticket: 8269 (new)
    target_version: 1.14
    tags: pullup

 src/include/krb5/krb5.hin    |   11 ++++++-----
 src/lib/krb5/krb/chpw.c      |    4 ++--
 src/lib/krb5/krb/int-proto.h |    4 ++--
 src/lib/krb5/os/changepw.c   |   10 +++++-----
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin
index 0d19a65..851cea3 100644
--- a/src/include/krb5/krb5.hin
+++ b/src/include/krb5/krb5.hin
@@ -5037,9 +5037,9 @@ krb5_sname_match(krb5_context context, krb5_const_principal matching,
  * @retval 0 Success; otherwise - Kerberos error codes
  */
 krb5_error_code KRB5_CALLCONV
-krb5_change_password(krb5_context context, krb5_creds *creds, char *newpw,
-                     int *result_code, krb5_data *result_code_string,
-                     krb5_data *result_string);
+krb5_change_password(krb5_context context, krb5_creds *creds,
+                     const char *newpw, int *result_code,
+                     krb5_data *result_code_string, krb5_data *result_string);
 
 /**
  * Set a password for a principal using specified credentials.
@@ -5072,7 +5072,7 @@ krb5_change_password(krb5_context context, krb5_creds *creds, char *newpw,
  * Kerberos error codes.
  */
 krb5_error_code KRB5_CALLCONV
-krb5_set_password(krb5_context context, krb5_creds *creds, char *newpw,
+krb5_set_password(krb5_context context, krb5_creds *creds, const char *newpw,
                   krb5_principal change_password_for, int *result_code,
                   krb5_data *result_code_string, krb5_data *result_string);
 
@@ -5108,7 +5108,8 @@ krb5_set_password(krb5_context context, krb5_creds *creds, char *newpw,
  */
 krb5_error_code KRB5_CALLCONV
 krb5_set_password_using_ccache(krb5_context context, krb5_ccache ccache,
-                               char *newpw, krb5_principal change_password_for,
+                               const char *newpw,
+                               krb5_principal change_password_for,
                                int *result_code, krb5_data *result_code_string,
                                krb5_data *result_string);
 
diff --git a/src/lib/krb5/krb/chpw.c b/src/lib/krb5/krb/chpw.c
index b8010b3..41a3cdd 100644
--- a/src/lib/krb5/krb/chpw.c
+++ b/src/lib/krb5/krb/chpw.c
@@ -13,7 +13,7 @@ krb5_error_code
 krb5int_mk_chpw_req(krb5_context context,
                     krb5_auth_context auth_context,
                     krb5_data *ap_req,
-                    char *passwd,
+                    const char *passwd,
                     krb5_data *packet)
 {
     krb5_error_code ret = 0;
@@ -284,7 +284,7 @@ krb5int_mk_setpw_req(krb5_context context,
                      krb5_auth_context auth_context,
                      krb5_data *ap_req,
                      krb5_principal targprinc,
-                     char *passwd,
+                     const char *passwd,
                      krb5_data *packet)
 {
     krb5_error_code ret;
diff --git a/src/lib/krb5/krb/int-proto.h b/src/lib/krb5/krb/int-proto.h
index db6fa95..5739f83 100644
--- a/src/lib/krb5/krb/int-proto.h
+++ b/src/lib/krb5/krb/int-proto.h
@@ -152,7 +152,7 @@ k5_privsafe_check_addrs(krb5_context context, krb5_auth_context ac,
 
 krb5_error_code
 krb5int_mk_chpw_req(krb5_context context, krb5_auth_context auth_context,
-                    krb5_data *ap_req, char *passwd, krb5_data *packet);
+                    krb5_data *ap_req, const char *passwd, krb5_data *packet);
 
 krb5_error_code
 krb5int_rd_chpw_rep(krb5_context context, krb5_auth_context auth_context,
@@ -166,7 +166,7 @@ krb5_chpw_result_code_string(krb5_context context, int result_code,
 krb5_error_code
 krb5int_mk_setpw_req(krb5_context context, krb5_auth_context auth_context,
                      krb5_data *ap_req, krb5_principal targetprinc,
-                     char *passwd, krb5_data *packet);
+                     const char *passwd, krb5_data *packet);
 
 void
 k5_ccselect_free_context(krb5_context context);
diff --git a/src/lib/krb5/os/changepw.c b/src/lib/krb5/os/changepw.c
index dde8436..a62de2b 100644
--- a/src/lib/krb5/os/changepw.c
+++ b/src/lib/krb5/os/changepw.c
@@ -48,7 +48,7 @@ struct sendto_callback_context {
     krb5_context        context;
     krb5_auth_context   auth_context;
     krb5_principal      set_password_for;
-    char                *newpw;
+    const char          *newpw;
     krb5_data           ap_req;
     krb5_ui_4           remote_seq_num, local_seq_num;
 };
@@ -207,7 +207,7 @@ cleanup:
 static krb5_error_code
 change_set_password(krb5_context context,
                     krb5_creds *creds,
-                    char *newpw,
+                    const char *newpw,
                     krb5_principal set_password_for,
                     int *result_code,
                     krb5_data *result_code_string,
@@ -328,7 +328,7 @@ cleanup:
 krb5_error_code KRB5_CALLCONV
 krb5_change_password(krb5_context context,
                      krb5_creds *creds,
-                     char *newpw,
+                     const char *newpw,
                      int *result_code,
                      krb5_data *result_code_string,
                      krb5_data *result_string)
@@ -345,7 +345,7 @@ krb5_change_password(krb5_context context,
 krb5_error_code KRB5_CALLCONV
 krb5_set_password(krb5_context context,
                   krb5_creds *creds,
-                  char *newpw,
+                  const char *newpw,
                   krb5_principal change_password_for,
                   int *result_code,
                   krb5_data *result_code_string,
@@ -359,7 +359,7 @@ krb5_set_password(krb5_context context,
 krb5_error_code KRB5_CALLCONV
 krb5_set_password_using_ccache(krb5_context context,
                                krb5_ccache ccache,
-                               char *newpw,
+                               const char *newpw,
                                krb5_principal change_password_for,
                                int *result_code,
                                krb5_data *result_code_string,
_______________________________________________
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