Hack: UNIX Passwords and .ppp

Mury Johnson (mury@main.goldengate.net)
Fri, 16 Feb 1996 02:37:06 -0600 (CST)

I just finished changing some of the radius code to allow "UNIX"
passwords with the .ppp/.slip hack. It basically strips off any "." in
the username including everything after the "." So if the user logs in
as "joeblow" to get a shell login, and "joeblow.ppp" to get a ppp login
radius sends "joeblow" in both cases as the username for Unix to check.

I am writing this to the list for two reasons:
1) Some of you may also find this useful for your situation.
2) I am not much of a C programmer, so if someone who is could take a
quick look at the code and let me know if I made a mistake in my
programming, I would deeply appreciate it.

First of all you have to add two global definitions in radiusd.c:

int len;
char ptrout[20]; /*** Assuming your logins are less than 20 chars ***/

Then under the section "Special Handling for passwords which are
encrypted..." here is the diff:

57a58
> int len; /*** Added By Mury ***/
62a64
> char ptrout[20]; /*** Added By Mury ***/
1031,1033c1033,1042
< if(strcmp(check_item->strvalue, "UNIX") == 0) {
< if(unix_pass(namepair->strvalue,
< string) != 0) {

---
> 					if(strcmp(check_item->strvalue, "UNIX") == 0) {
> 					ptr = namepair->strvalue;
> 					{
> 					len=strcspn(ptr,".");
> 					strncpy(ptrout,ptr,len);
> 					strcpy(ptr,ptrout);
> }
> 					if(unix_pass(ptr,string) != 0) {

This is similar to the SCP patch. It just uses a different method for changing the string due to the fact that the part you need to get rid of is at the end instead of the beginning. ____________________________________________________________________________ mury@goldengate.net GoldenGate Internet Services (612) 574-2200 Office PO Box 32031 (612) 574-2444 Fax Fridley, MN 55432 ----------------------------------------------------------------------------