From a599be55937b040b57234a8a5298ad77919d1a85 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Thu, 15 Sep 1994 20:57:54 +0000 Subject: [PATCH] Don't chop off last character of principal name if it is passed in to the add principal function. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4252 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/client/ChangeLog | 6 ++++++ src/kadmin/client/kadmin_add.c | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/kadmin/client/ChangeLog b/src/kadmin/client/ChangeLog index b930af57b..0d352b3ff 100644 --- a/src/kadmin/client/ChangeLog +++ b/src/kadmin/client/ChangeLog @@ -1,3 +1,9 @@ +Thu Sep 15 16:49:19 1994 Theodore Y. Ts'o (tytso@dcl) + + * kadm_add.c (kadm_add_user): Don't chop off last character of + principal if it was supplied by the caller (instead of + prompting the user to enter a principal). + Wed Sep 14 22:20:46 1994 Theodore Y. Ts'o (tytso@dcl) * kadmin_add.c (kadm_add_user): removed a duplicated diff --git a/src/kadmin/client/kadmin_add.c b/src/kadmin/client/kadmin_add.c index 278207802..f4e986d3f 100644 --- a/src/kadmin/client/kadmin_add.c +++ b/src/kadmin/client/kadmin_add.c @@ -80,14 +80,14 @@ char *principal; fprintf(stderr, "Invalid Principal name!\n"); count++; } while (username[0] == '\n' && count < 3); - } - if (username[0] == '\n') { - fprintf(stderr, "Aborting!!\n\n"); - return(1); - } + if (username[0] == '\n') { + fprintf(stderr, "Aborting!!\n\n"); + return(1); + } - username[strlen(username) -1] = '\0'; + username[strlen(username) -1] = '\0'; + } (void) memcpy( inbuf.data + 3, username, strlen(username)); inbuf.length = strlen(username) + 3; -- 2.26.2