Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 265969 - net-p2p/rtorrent init.d script should support homedirs outside /home
Summary: net-p2p/rtorrent init.d script should support homedirs outside /home
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor
Assignee: Jeremy Olexa (darkside) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-13 10:50 UTC by Michał Górny
Modified: 2009-05-20 03:09 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for the initscript (rtorrentd.init.diff,457 bytes, patch)
2009-04-13 10:51 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-04-13 10:50:02 UTC
Currently, init.d script provided with rtorrent uses simple /home/$USER to set homedir for rtorrent. In some more complex configurations it's possible that user running rtorrent has homedir outside /home (e.g. in /srv).

I think we should instead use passwd to determine the real homedir. As I wasn't able to find any standard tool allowing to easily get that information within one command call, I decided to use getent+awk, which should work fine.

AFAICS gawk is part of system set even of BSD, so using it shouldn't cause any trouble, I think. But getent is part of glibc, so I'm not sure what to do about it (2>/dev/null ? [ -x … ] ?).

I assumed that if for some reason getent+awk return empty string, we fallback to old /home/$USER behavior.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-04-13 10:51:16 UTC
Created attachment 188207 [details, diff]
Patch for the initscript
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-05-20 03:09:01 UTC
(In reply to comment #1)
> Created an attachment (id=188207) [edit]
> Patch for the initscript
> 

Nice, thx. No version bump here though.

I don't know about fbsd either, I guess I will re-evaluate when someone suggests a fix (or complains).