summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2003-05-21 23:55:58 +0000
committerTom Yu <tlyu@mit.edu>2003-05-21 23:55:58 +0000
commit7460d7fdc679b019fabd12d1f90a9a7661ce73c6 (patch)
tree68a19daa97cb4966028844bb761bc05581c3dcc1 /src/lib/krb5
parenta9ee9b5ed1c1f2aa756f83e7b9ac255c1bc0fe95 (diff)
downloadkrb5-7460d7fdc679b019fabd12d1f90a9a7661ce73c6.tar.gz
krb5-7460d7fdc679b019fabd12d1f90a9a7661ce73c6.tar.xz
krb5-7460d7fdc679b019fabd12d1f90a9a7661ce73c6.zip
Set length correctly in krb5_get_in_tkt_with_password if password is
actually passed in. Also, fix test suite to be more lenient about password prompts, which changed under the previous patches for this ticket. ticket: 1480 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15463 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5')
-rw-r--r--src/lib/krb5/krb/ChangeLog5
-rw-r--r--src/lib/krb5/krb/gic_pwd.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog
index 4cfa1f5f7f..0802d0e344 100644
--- a/src/lib/krb5/krb/ChangeLog
+++ b/src/lib/krb5/krb/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-21 Tom Yu <tlyu@mit.edu>
+
+ * gic_pwd.c (krb5_get_in_tkt_with_password): Set pw0.length
+ correctly if a password is passed in.
+
2003-05-20 Sam Hartman <hartmans@mit.edu>
* get_in_tkt.c: get_in_tkt only supports old (non-etype-info2)
diff --git a/src/lib/krb5/krb/gic_pwd.c b/src/lib/krb5/krb/gic_pwd.c
index 97db38e198..1d373f5086 100644
--- a/src/lib/krb5/krb/gic_pwd.c
+++ b/src/lib/krb5/krb/gic_pwd.c
@@ -433,13 +433,15 @@ krb5_get_in_tkt_with_password(krb5_context context, krb5_flags options,
pw0array[0] = '\0';
pw0.data = pw0array;
if (password) {
- if (strlen(password) >= sizeof(pw0array))
+ pw0.length = strlen(password);
+ if (pw0.length > sizeof(pw0array))
return EINVAL;
strncpy(pw0.data, password, sizeof(pw0array));
- pw0array[strlen(password)] = '\0';
+ if (pw0.length == 0)
+ pw0.length = sizeof(pw0array);
+ } else {
+ pw0.length = sizeof(pw0array);
}
- pw0.length = sizeof(pw0array);
-
krb5int_populate_gic_opt(context, &opt,
options, addrs, ktypes,
pre_auth_types);