Thread View: news.software.nntp
2 messages
2 total messages
Started by Mark Crother
Mon, 08 Apr 1996 00:00
INN inews bug for Solaris 2.x
Author: Mark Crother
Date: Mon, 08 Apr 1996 00:00
Date: Mon, 08 Apr 1996 00:00
44 lines
2073 bytes
2073 bytes
I am running inn1.4-unoff-4 on a 2.4 solaris box. While hacking
inews, I found that multiple calls to the getpw family will not work
the same as one would expect. For example, in inews.c, the first time
this is called is in main, line 1204...
/* Find out who we are. */
if ((i = geteuid()) < 0)
PerrorExit(TRUE, "Can't get your user ID");
if ((pwp = getpwuid((UID_T)i)) == NULL)
PerrorExit(TRUE, "Can't get your password entry");
The next time it is in AnAdministrator, line 388
/* Find out who we are. */
if ((pwp = getpwnam(NEWSUSER)) == NULL)
/* Silent falure; clients might not have the group. */
return FALSE;
The call in AnAdministrator will overwrite the data from the
first call, which in esence will make inews think the caller of
inews is NEWSUSER and AnAdministrator will always return true.
This "feature" is documented in a Solaris 2.x's man page for the
getpw family.
To fix this I used getpwuid_r, where r is for reentrant, in main's call.
char pwp_buff[1024];
/* Find out who we are. */
pwp=(struct passwd *)malloc(sizeof(struct passwd));
if ((i = geteuid()) < 0)
PerrorExit(TRUE, "Can't get your user ID");
if ((pwp = getpwuid_r((UID_T)i, pwp, pwp_buff, 1024) ) == NULL)
PerrorExit(TRUE, "Can't get your password entry");
--
Mark Crother mark@calstate.edu--All opinions are mine, not my employer's.
"Don't mind me.... I just spent the last hour in alt.beer!!!"
Re: INN inews bug for Solaris 2.x
Author: Mark Crother
Date: Tue, 09 Apr 1996 00:00
Date: Tue, 09 Apr 1996 00:00
25 lines
1346 bytes
1346 bytes
After looking further into inews, I found 2 things, 1) The overwriting of the buffer exists for all flavors of unix 2) inews never seems to use the "struct passwd *pwp" after possible "tainting" I had to deal with it because of some changes I made to inews where I needed to call AnAdministrator early in main(). I added the ability for the "NEWSUSER" to use a -s (Sender header) argument from the command line when invoking inews. Sorry for the premature bug... -- Mark Crother mark@calstate.edu--All opinions are mine, not my employer's. "Don't mind me.... I just spent the last hour in alt.beer!!!" FUCK THE CDA and all it implies and FUCK the spineless SHIThead congress folks that voted for it. LET US UNITE UNDER THIS!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads