On Wed, 20 Jan 1999, Harald Hanche-Olsen wrote:
>
> But wait! I have an idea! It just occured to me that "lindgren" is
> exactly 8 characters long, which is exactly the maximum length of a
> username on many systems. So here is my conjecture: When your
> system's getpwnam() is fed anything longer than 8 characters, it chops
> it down to 8 characters and looks up the remainder in the database.
> In fact, looking at the code in qmail-getpw.c, this is the only
> reasonable explanation I can come up with (for some unreasonable
> definition of "reasonable").
>
> To help verify my hypothesis, try compiling and running the appended
> program. Running it as ./getpwnam lindgren-pat will then return
>
> lindgren-pat: name="lindgren", uid=1021, gid=1021, homedir=/home/lindgren
It returned:
lindgren-pat: name="lindgren", uid=1021, gid=1021, homedir=/home/lindgren
I think you're on to something here; I tested this on another virtual
domain with an 8-char username, and got the same results (sorry that I
claimed this was the only domain on which this happened, I only tested on
non-8-char username domains and made an assumption).
> So what system is this happening on? I am sure Dan will be
> interested, so he can try to harden qmail against this kind of
> silliness.
This is on FreeBSD 2.2.8. So, um, what do I/we do now?
Thanks very much!
Chris
---------------------------------------------
Chris Hardie [EMAIL PROTECTED]
http://www.summersault.com/chris
great is the power of truth
---------------------------------------------