[PATCH] kdesu for FreeBSD non-wheel users

Oswald Buddenhagen ossi at kde.org
Thu Nov 13 13:26:57 GMT 2003


On Thu, Nov 13, 2003 at 11:56:57AM +0100, Adriaan de Groot wrote:
> On Wednesday 12 November 2003 17:19, Waldo Bastian 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.
> 
> That message is written out in two parts (ie. there are two write(2) calls): 
> "su: " and "you .." Depending on the relative timing between the su process 
> and kdesu, those two chunks may be read separately, or as one chunk. If they 
> are read separately, then "su: " matches the regexp and kdesu assumes it's a 
> password prompt.
> 
haha, i knew that this could happen. that's why i put "and the process
hangs afterwards" on my condition list. i think one needs to use a
qtimer that waits some 200 ms (that _should_ be enough even in the worst
case) for more data before "flushing" it by handing it down to the
prompt matcher.

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