From: Paul Park Date: Mon, 7 Aug 1995 21:44:32 +0000 (+0000) Subject: Restore input strings to their original state after parsing X-Git-Tag: krb5-1.0-beta6~1382 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6df64028850b170d358c88e2dca2b74abafe1a23;p=krb5.git Restore input strings to their original state after parsing git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6442 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm/ChangeLog b/src/lib/kadm/ChangeLog index 7af5edab8..e1083625b 100644 --- a/src/lib/kadm/ChangeLog +++ b/src/lib/kadm/ChangeLog @@ -1,4 +1,12 @@ +Mon Aug 7 17:38:45 EDT 1995 Paul Park (pjpark@mit.edu) + * keysalt.c(krb5_string_to_keysalt) - Don't do the silly whitespace + filling logic. If the string has imbedded whitespace, then + it's just tough rocks. Save replaced string separators and + terminators so that they string looks the same coming out as + going in. + + Fri Aug 4 16:21:50 EDT 1995 Paul Park (pjpark@mit.edu) * Makefile.in, .Sanitize, keysalt.c - Add keysalt.c modules. diff --git a/src/lib/kadm/keysalt.c b/src/lib/kadm/keysalt.c index 2802de261..817cb66ad 100644 --- a/src/lib/kadm/keysalt.c +++ b/src/lib/kadm/keysalt.c @@ -110,7 +110,8 @@ krb5_string_to_keysalts(string, tupleseps, ksaltseps, dups, ksaltp, nksaltp) krb5_int32 *nksaltp; { krb5_error_code kret; - char *kp, *sp, *ep, *tp; + char *kp, *sp, *ep; + char sepchar, trailchar; krb5_keytype ktype; krb5_int32 stype; krb5_key_salt_tuple *savep; @@ -133,16 +134,9 @@ krb5_string_to_keysalts(string, tupleseps, ksaltseps, dups, ksaltp, nksaltp) } if (ep) { - /* Fill in trailing whitespace of kp */ - tp = ep - 1; - while (isspace(*tp) && (tp < kp)) { - *tp = '\0'; - tp--; - } + trailchar = *ep; *ep = '\0'; ep++; - /* Skip trailing whitespace of ep */ - while (isspace(*ep) && (*ep)) ep++; } /* * kp points to something (hopefully) of the form: @@ -159,6 +153,7 @@ krb5_string_to_keysalts(string, tupleseps, ksaltseps, dups, ksaltp, nksaltp) if (sp) { /* Separate keytype from salttype */ + sepchar = *sp; *sp = '\0'; sp++; } @@ -198,6 +193,10 @@ krb5_string_to_keysalts(string, tupleseps, ksaltseps, dups, ksaltp, nksaltp) break; } } + if (sp) + sp[-1] = sepchar; + if (ep) + ep[-1] = trailchar; kp = ep; } return(kret);