[PATCH] kdesu for FreeBSD non-wheel users
Oswald Buddenhagen
ossi at kde.org
Thu Nov 13 04:01:13 GMT 2003
On Wed, Nov 12, 2003 at 10:45:47PM -0500, Dawit Alemayehu wrote:
> > Btw, the comment in su.cpp says:
> > // Match "Password: " with the regex ^[^:]+:[\w]*$.
> >
> > I actually fail to see how
> > "su: you are not allowed to su root"
> > would match that.
>
> Why would it not ? ? To me the regexp says match anything that starts with one
> or more characters other than a colon, followed by a colon, followed by zero
> or more
> words
>
word characters
> (letter, number or _)
> and ending with any character
>
???
> including a \n,
>
i'm not sure about that part and hope it's not; if it is, the regex
engine can (and must) be taught not to accept a trailing newline.
i think waldo (and quite probably the original author - whoever that
was) confused \s with \w, unless there was some deeply hidden intention
i don't see now ...
i don't see a reason to not match colons within the prompt (but there is
potential that it might actually hurt), so i think the string should
simply read ":[ \t]*$" (\\s would indeed include \n, i think).
greetings
--
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.
More information about the kde-core-devel
mailing list