Thanks, patch applied
authorTom Yu <tlyu@mit.edu>
Wed, 9 Apr 2003 23:42:06 +0000 (23:42 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 9 Apr 2003 23:42:06 +0000 (23:42 +0000)
* kerberos.c (kerberos4_status): Always copy in username if
present.  Patch from Nathan Neulinger to make "-a user" work.

* kerberos5.c (kerberos5_status): Always copy in username if
present.  Patch from Nathan Neulinger to make "-a user" work.

ticket: 1362
tags: pullup
status: open

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

src/appl/telnet/libtelnet/ChangeLog
src/appl/telnet/libtelnet/kerberos.c
src/appl/telnet/libtelnet/kerberos5.c

index 11380530f915dfdd3323eec36b63fe158f0fc41d..03d794b1432280d25b81287bfcdbc863e6850e4b 100644 (file)
@@ -1,3 +1,11 @@
+2003-04-09  Tom Yu  <tlyu@mit.edu>
+
+       * kerberos.c (kerberos4_status): Always copy in username if
+       present.  Patch from Nathan Neulinger to make "-a user" work.
+
+       * kerberos5.c (kerberos5_status): Always copy in username if
+       present.  Patch from Nathan Neulinger to make "-a user" work.
+
 2003-04-01  Nalin Dahyabhai  <nalin@redhat.com>
 
        * kerberos5.c (kerberos5_is): Check principal name length before
index 56a07319101b55e4e5e87bc472325c82001c2a53..8d4c7f330cc7a89077c91033a686c320edcaf76c 100644 (file)
@@ -612,10 +612,17 @@ kerberos4_status(ap, kname, level)
        if (level < AUTH_USER)
                return(level);
 
-       if (UserNameRequested && !kuserok(&adat, UserNameRequested)) {
+       /*
+        * Always copy in UserNameRequested if the authentication
+        * is valid, because the higher level routines need it.
+        */
+       if (UserNameRequested) {
                /* the name buffer comes from telnetd/telnetd{-ktd}.c */
                strncpy(kname, UserNameRequested, 255);
                name[255] = '\0';
+       }
+
+       if (UserNameRequested && !kuserok(&adat, UserNameRequested)) {
                return(AUTH_VALID);
        } else
                return(AUTH_USER);
index eb150a7c053675fa882d2f83bc7a7c8d044a6606..59982d3bf53e5d09a3a549d837e11484ab5fb4b4 100644 (file)
@@ -731,13 +731,20 @@ kerberos5_status(ap, name, level)
        if (level < AUTH_USER)
                return(level);
 
+       /*
+        * Always copy in UserNameRequested if the authentication
+        * is valid, because the higher level routines need it.
+        * the name buffer comes from telnetd/telnetd{-ktd}.c
+        */
+       if (UserNameRequested) {
+               strncpy(name, UserNameRequested, 255);
+               name[255] = '\0';
+       }
+
        if (UserNameRequested &&
            krb5_kuserok(telnet_context, ticket->enc_part2->client, 
                         UserNameRequested))
        {
-               /* the name buffer comes from telnetd/telnetd{-ktd}.c */
-               strncpy(name, UserNameRequested, 255);
-               name[255] = '\0';
                return(AUTH_VALID);
        } else
                return(AUTH_USER);