[PATCH] kdesu for FreeBSD non-wheel users

Oswald Buddenhagen ossi at kde.org
Wed Nov 12 15:57:33 GMT 2003


On Wed, Nov 12, 2003 at 07:40:06AM -0800, Will Andrews wrote:
> On Wed, Nov 12, 2003 at 04:10:52PM +0100, Oswald Buddenhagen wrote:
> > i think that's wrong. potentially every system can have a wheel group,
> > particularily those which use pam can be trivially configured to do so.
> > instead, the prompt recognizion should be improved. i mean, a prompt is
> > really not that hard to recognize: it ends with a colon (minus trailing
> > whitespace), has no trailing newline, and the program hangs afterwards
> > (i.e., does not exit or output something else).
> 
> What's wrong with matching "^Password:$"?  Are there systems this
> does not work on?  What about "^.*word:$" (in case there is
> something that lowercases the "p")?
> 
theoretically the prompt could be "password for <user>" or
"<user>@<domain>'s password:" or whatever ... pam leaves everything
open. whether something is even a _password_ prompt at all can be only
determined by checking whether the pty has echo on or not (not that it
is likely that su would ask anything else).

therefore the _real_ solution would be reimplementing kdesu using the
model i recently used for kdesktop_lock (and kdm). that's quite a bit of
work, though.

for now, i think matching "password.*: *$" case-insensitively is ok.
note that the matched buffer should contain the newline, if one was
read (so it does not match the prompt regex).

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