emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: $USERPROFILE for $HOME on W32


From: Eli Zaretskii
Subject: Re: $USERPROFILE for $HOME on W32
Date: Fri, 26 Nov 2004 22:56:01 +0200

> Date: Thu, 25 Nov 2004 23:45:18 +0200
> From: "Eli Zaretskii" <address@hidden>
> Cc: address@hidden, address@hidden
> 
> > From: Stefan <address@hidden>
> > Date: Thu, 25 Nov 2004 12:45:48 -0500
> > Cc: address@hidden, Jason Rumney <address@hidden>
> > 
> > >> +      /* Set dir and shell from environment variables. */
> > >> +      strcpy (the_passwd.pw_dir, getenv ("HOME"));
> > 
> > > What if strlen (getenv ("HOME")) >= sizeof (the_passwd.pw_dir)?
> > 
> > Well, tough!
> > This code is not new: it's just moved from one place to another so it's not
> > a new problem.
> 
> Can you (or someone else) look at the w32 system headers and see how
> struct passwd is defined there?

Silly me: it's defined on w32.c, right there.  The pw_dir etc. struct
members are defined as fixed-size strings, and the sizes are all 256
bytes, including the terminating null.  So I think, at least that
should be changed to 261, since the longest file name supported by
Windows is 260 characters.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]