[cgiwrap-users] RE: cgiwrap and auth files
Brought to you by:
nneul
From: Neulinger, N. R. <nn...@um...> - 2000-11-10 20:57:32
|
Committed to CVS. > -----Original Message----- > From: Scott Sutherland [mailto:sc...@ma...] > Sent: Friday, November 10, 2000 2:17 PM > To: nn...@um... > Subject: Re: cgiwrap and auth files > > > >>>>> "Nathan" == Neulinger, Nathan R <nn...@um...> writes: > Nathan> You have to check it out of CVS at the > sourceforge project page > Nathan> for cgiwrap. www.sourceforge.net/projects/cgiwrap > > OK. Version 3.6.4 terminates strings read from the file at the first > nonprinting character, which solves the problem of the > unwanted newline > chars. > > However, it is still very easy to accidentally put trailing > spaces in the > file, so I changed my version to delete trailing whitespace > from lines. > I only delete whitespace from the end of the line. It would > probably make > sense (and make simpler) to just change your test to terminate the > line at the first nonprinting or whitespace character, but it seemed > presumptious to assume that usernames couldn't contain spaces > (they can't in > Unix, but...). > > I also added debug messages when it is checking the auth files. > > Here is my patch, which you may include or not, as you like. > Thanks for your quick responses. > > Scott Sutherland > > > *** util-orig.c Fri Nov 10 12:29:25 2000 > --- util.c Fri Nov 10 15:08:07 2000 > *************** > *** 241,244 **** > --- 241,245 ---- > if ( deny_exists ) > { > + DEBUG_Str("Checking deny file for",user->pw_name); > in_deny = UserInFile(CONF_DENYFILE, user->pw_name); > } > *************** > *** 247,250 **** > --- 248,252 ---- > if ( allow_exists ) > { > + DEBUG_Str("Checking allow file for",user->pw_name); > in_allow = UserInFile(CONF_ALLOWFILE, user->pw_name); > } > *************** > *** 760,764 **** > char *i; > #endif > ! int j; > > #if defined(CONF_CHECKHOST) > --- 762,766 ---- > char *i; > #endif > ! int j, intail; > > #if defined(CONF_CHECKHOST) > *************** > *** 785,789 **** > return 0; > } > ! for (j=0; j<=strlen(temp); j++) > { > if ( !isprint(temp[j]) ) > --- 787,792 ---- > return 0; > } > ! intail=1; > ! for (j=strlen(temp)-1; j>=0; j--) > { > if ( !isprint(temp[j]) ) > *************** > *** 791,794 **** > --- 794,811 ---- > temp[j] = 0; > } > + else > + { > + if (intail) > + { > + if (isspace(temp[j])) > + { > + temp[j] = 0; > + } > + else > + { > + intail = 0; > + } > + } > + } > } > > *************** > *** 796,799 **** > --- 813,817 ---- > { > fclose(file); > + DEBUG_Str("Found",user); > return 1; > } > |