Don't chop off last character of principal name if it is passed in to
authorTheodore Tso <tytso@mit.edu>
Thu, 15 Sep 1994 20:57:54 +0000 (20:57 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 15 Sep 1994 20:57:54 +0000 (20:57 +0000)
the add principal function.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4252 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/client/ChangeLog
src/kadmin/client/kadmin_add.c

index b930af57b74717106be27c42e891e71a42d66a7b..0d352b3ff052a2eb39a19a90eb0afe1b49bbd6c9 100644 (file)
@@ -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
index 278207802d1802e902193e4403a101dbb0f4a3b4..f4e986d3f9ed5b719d92d873ce81998fc7952d16 100644 (file)
@@ -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;