Review Request 108389: Respect the HOME environment variable

Jon Severinsson jon at severinsson.net
Sat Jan 19 22:35:02 UTC 2013



> On Jan. 19, 2013, 2:14 p.m., Oswald Buddenhagen wrote:
> > kdecore/util/kuser_unix.cpp, line 67
> > <http://git.reviewboard.kde.org/r/108389/diff/4/?file=107287#file107287line67>
> >
> >     i don't think it's actually useful to check the euid. HOME is supposed to match the real uid, and setuid programs better make sure that this holds true (not that setuid with kde libs would be particularly good idea to start with).
> >     
> >     if you are concerned about the extra getuid calls, you could pass this in an (optional) parameter.
> >

Regarding euid, I tried to match the behavior of the existing KUser(UIDMode mode) constructor, witch only consults the environment when euid == uid.

As for the extra parameter, I tried but that only resulted in spaghetti code, so from a readability standpoint it's either the extra calls, or code duplication. And as sys-calls are cheap on the major platform (x86_{32,64}) I think that is preferred after all...


- Jon


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108389/#review25788
-----------------------------------------------------------


On Jan. 19, 2013, 10:52 a.m., Jon Severinsson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/108389/
> -----------------------------------------------------------
> 
> (Updated Jan. 19, 2013, 10:52 a.m.)
> 
> 
> Review request for KDE Frameworks and Oswald Buddenhagen.
> 
> 
> Description
> -------
> 
> This turns KUser::homeDir (and thus KShell::tildeExpand) closer to
> QDir::homePath, which only consults the environment variable.
> 
> It will therefore also fix the kdecore-kshelltest test when HOME is set to a different directory.
> 
> 
> Diffs
> -----
> 
>   kdecore/util/kuser_unix.cpp 6a612a6 
> 
> Diff: http://git.reviewboard.kde.org/r/108389/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Jon Severinsson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130119/f8736690/attachment.html>


More information about the Kde-frameworks-devel mailing list