[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [PATCH] kdesu for FreeBSD non-wheel users
From:       Waldo Bastian <bastian () kde ! org>
Date:       2003-11-13 9:23:28
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu November 13 2003 05:01, Oswald Buddenhagen wrote:
> 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

Ah, *hm*, well, the code seems to implement \s instead of \w:

            // Match "Password: " with the regex ^[^:]+:[\w]*$.
            for (i=0,j=0,colon=0; i<line.length(); i++)
            {
                if (line[i] == ':')
                {
                    j = i; colon++;
                    continue;
                }
                if (!isspace(line[i]))
                    j++;
            }
            if ((colon == 1) && (line[j] == ':'))
            {
               ...

So I still fail to see how the code would match
	"su: you are not allowed to su root"

Cheers,
Waldo
- -- 
bastian@kde.org -=|[ SUSE, The Linux Desktop Experts ]|=- bastian@suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/s02QN4pvrENfboIRAnN+AJ9whjBv/QBeAnF6PWBNbHC4Ww5NzgCdEpzs
Lmf8eZxE53cPsf28Q5O9F+o=
=iEt1
-----END PGP SIGNATURE-----

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic