[PATCH] kdesu for FreeBSD non-wheel users

Waldo Bastian bastian at kde.org
Thu Nov 13 09:23:28 GMT 2003


-----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 at kde.org -=|[ SUSE, The Linux Desktop Experts ]|=- bastian at 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-----




More information about the kde-core-devel mailing list