Re: High UID support for Linux

H. Peter Anvin (hpa@transmeta.com)
1 Dec 1998 17:26:15 GMT


Followup to: <5liufwy8bs.fsf@tequila.cs.yale.edu>
By author: Stefan Monnier <monnier+lists/linux/kernel/news/@tequila.cs.yale.edu>
In newsgroup: linux.dev.kernel
>
> > Incidentally, remember that not all programs will load registers in
> > the same order, and that the arguments pushed on the stack are not
> > necessarily done consecutively...
>
> And since the problem is to replace getpwent with getenv(HOME), you have to
> recognize that the output of getpwent is only used to extract the home
> directory and then patch it up correctly. So much trouble, so little gain.
>

It's also important to recognize that using getpwent to extract one's
own home directory is *WRONG*. HOME and USER may point to a different
place/user than getuid() and getpwuid(getuid()) will give you; this is
quite common for setuid programs and when using su -m.

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/