DragonFly BSD
DragonFly users List (threaded) for 2005-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Note to LEAF users on ssh logins


From: Hummel Tom <tom@xxxxxxxxxxxxx>
Date: Thu, 17 Mar 2005 23:48:46 +0100

Can anybody tell me what those lines do, or correct me?

	if ((str = strstr(buf, "Failed password for root from")) != NULL ||
	    (str = strstr(buf, "Failed password for admin from")) != NULL
If we find one of those strings in the line that 'buf' gives us, and the address of the where this string is beginning is successfully stored in 'str'...
	) {
	    while (*str && (*str < '0' || *str > '9'))
we check if the value to which *str points, is not NULL and not between 0-9 if so...
++str;
we add 1 to str and...
lockout(str);
call lockout() with some address which is now higher (where does it point to now ?)
continue;
if not we leave the while-loop.

what does str really contain? I'm afraid i understand it completely wrong.
str should point to the beginning of the string we were looking for with strstr(), thus using str, cannot let me do something which located before the occurrence of "Failed...."?


tom



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]