Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 254995 - net-p2p/deluge - /etc/init.d/deluged finds the incorrect home directory when similar usernames exist
Summary: net-p2p/deluge - /etc/init.d/deluged finds the incorrect home directory when ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Raúl Porcel (RETIRED)
URL: http://dev.deluge-torrent.org/ticket/728
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-15 01:22 UTC by Matt Farmer
Modified: 2009-01-15 09:43 UTC (History)
1 user (show)

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


Attachments
minor patch to resolve the issue. (etc-init.d-deluge.patch,731 bytes, patch)
2009-01-15 01:22 UTC, Matt Farmer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Farmer 2009-01-15 01:22:09 UTC
When running /etc/init.d/deluged the script can find the wrong home directory of a user if DELUGED_USER is set to a username that also appears inside of another username on the system.

Example:

$ DELUGED_USER=my_user:my_user
$ getent passwd | grep $( echo "${DELUGED_USER}" | cut -d ':' -f 1 )
my_user:x:1000:1000::/home/my_user:/bin/bash
my_user_on_another_machine:x:501:100:,,,:/space:/bin/bash

In this example it will return /space, instead of /home/my_user.

Patch attached.

Also filed with Deluge at: http://dev.deluge-torrent.org/ticket/728

Reproducible: Always

Steps to Reproduce:
1.  Create a user, testuser1, with a certain home directory (/home/testuser1)
2.  Create another user, testuser12, with another home directory (/mnt/external)
3.  Set DELUGED_USER=testuser1 in /etc/conf.d/deluged
4.  Run '/etc/init.d/deluged start' and see that it has set DELUGED_USER_HOME to /mnt/external, instead of /home/testuser1

Actual Results:  
The wrong home directory is set.

Expected Results:  
The correct home directory should be set.
Comment 1 Matt Farmer 2009-01-15 01:22:34 UTC
Created attachment 178532 [details, diff]
minor patch to resolve the issue.
Comment 2 Raúl Porcel (RETIRED) gentoo-dev 2009-01-15 09:43:53 UTC
Fixed, thanks for the patch.