Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 349867 - net-p2p/transmission: ebuild badly resets permissions
Summary: net-p2p/transmission: ebuild badly resets permissions
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Peter Volkov (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-27 15:47 UTC by Tony Levi
Modified: 2011-10-19 10:59 UTC (History)
3 users (show)

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


Attachments
remove permissions change from postinst (transmission-2.13.ebuild.patch,156 bytes, patch)
2010-12-27 15:49 UTC, Tony Levi
Details | Diff
chown to $runas_user, not ot hardcoded "transmission" (transmission-chown.patch,1.17 KB, patch)
2011-08-03 19:08 UTC, Nikolaj Šujskij
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Levi 2010-12-27 15:47:41 UTC
in postinst() ebuild sets config etc permissions which do not match user-configured option, preventing the transmission-daemon from starting
(the init script only partly sets up dirs and permissions...)

Reproducible: Always

Steps to Reproduce:
1. emerge transmssion
2. setup as alternate user
3. remerge tranmission, transmission-daemon won't start



Expected Results:  
emerge net-p2p/transmission does not break existing install

Maybe the ebuild should not do this at all, or better should use the runas_user setting from config.
Comment 1 Tony Levi 2010-12-27 15:49:46 UTC
Created attachment 258184 [details, diff]
remove permissions change from postinst

Quick and maybe bad fix
Comment 2 Peter Volkov (RETIRED) gentoo-dev 2010-12-29 09:14:32 UTC
Thank you for report!

Removing this line is not an option as it is required to make transmission workable out of box after user upgrades from the previous versions of transmission.

Current idea is: var/{transmission/{,config,downloads},log/transmission} are system, or iow, ebuild controlled directories and if user wants to deviate from defaults he/she needs to create new directories.

I'll add some earn message for this, bug I agree that this is not nice solution and I'm open to ideas.

Comment 3 Peter Volkov (RETIRED) gentoo-dev 2011-02-12 01:48:29 UTC
ewarn is added in 2.21. If there are better solutions, please, suggest.
Comment 4 Nikolaj Šujskij 2011-07-27 11:17:43 UTC
> Removing this line is not an option as it is required to make transmission
> workable out of box after user upgrades from the previous versions of
> transmission.
 Why? What should undesirably change ownership of these directories, for ebuild to force `transmission:transmission` on them?
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2011-07-28 08:32:41 UTC
(In reply to comment #4)
> > Removing this line is not an option as it is required to make transmission
> > workable out of box after user upgrades from the previous versions of
> > transmission.
>  Why? What should undesirably change ownership of these directories, for ebuild
> to force `transmission:transmission` on them?

Init script assumes transmission daemon be run by transmission:transmission.
Comment 6 Nikolaj Šujskij 2011-07-28 08:48:25 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > > Removing this line is not an option as it is required to make transmission
> > > workable out of box after user upgrades from the previous versions of
> > > transmission.
> >  Why? What should undesirably change ownership of these directories, for ebuild
> > to force `transmission:transmission` on them?
> 
> Init script assumes transmission daemon be run by transmission:transmission.

Where initscript "assumes" that, exactly? It uses `run_as` setting from /etc/conf.d/transmission-daemon, doesn't it?
Comment 7 Peter Volkov (RETIRED) gentoo-dev 2011-07-28 09:39:36 UTC
Right and default user there is transmission:transmission.
Comment 8 Nikolaj Šujskij 2011-07-28 19:37:41 UTC
(In reply to comment #7)
> Right and default user there is transmission:transmission.

 Indeed. And if it is set to some other value, and user have chown'ed /var/transmission, what exactly would break after upgrade? Why can't ebuild source /etc/conf.d/transmission-daemon too, just like initscript?
Comment 9 Peter Volkov (RETIRED) gentoo-dev 2011-07-29 09:54:20 UTC
(In reply to comment #8)
>  Indeed. And if it is set to some other value, and user have chown'ed
> /var/transmission, what exactly would break after upgrade? Why can't ebuild
> source /etc/conf.d/transmission-daemon too, just like initscript?

Good question. Personally I always assumed that this is bad thing to do, but... on second thought I have not idea why. Could you create patch, please?

Reopening.
Comment 10 Nikolaj Šujskij 2011-07-29 10:03:51 UTC
> Good question. Personally I always assumed that this is bad thing to do, but...
> on second thought I have not idea why. Could you create patch, please?

 I think I could, but is chown'ing really called for? I still can't grasp the reason what could possibly go wrong when $runas set to another user and /var/transmission belongs to him as well.
Comment 11 Peter Volkov (RETIRED) gentoo-dev 2011-07-29 12:47:43 UTC
(In reply to comment #10)
> I still can't grasp the reason what could possibly go wrong when $runas set
> to another user and /var/transmission belongs to him as well.

There is no problems in this case.

Actually this code is for upgrading for case when /var/transmission belonged to another user.
Comment 12 Nikolaj Šujskij 2011-07-29 15:04:40 UTC
 All right. So what _working_ setup would be broken by Transmission upgrade _without_ chowning /var/transmission?

(In reply to comment #11)
> (In reply to comment #10)
> > I still can't grasp the reason what could possibly go wrong when $runas set
> > to another user and /var/transmission belongs to him as well.
> 
> There is no problems in this case.
> 
> Actually this code is for upgrading for case when /var/transmission belonged to
> another user.
Comment 13 Peter Volkov (RETIRED) gentoo-dev 2011-08-01 07:08:07 UTC
(In reply to comment #12)
>  All right. So what _working_ setup would be broken by Transmission upgrade
> _without_ chowning /var/transmission?

Upgrade from transmission-2.04-r1 and below (which happened less then year ago).
Comment 14 Nikolaj Šujskij 2011-08-01 07:12:08 UTC
(In reply to comment #13)
> (In reply to comment #12)
> >  All right. So what _working_ setup would be broken by Transmission upgrade
> > _without_ chowning /var/transmission?
> 
> Upgrade from transmission-2.04-r1 and below (which happened less then year
> ago).

Why? What was so different then?
Comment 15 Andrew Savchenko gentoo-dev 2011-08-01 13:19:57 UTC
(In reply to comment #13)
> (In reply to comment #12)
> >  All right. So what _working_ setup would be broken by Transmission upgrade
> > _without_ chowning /var/transmission?
> 
> Upgrade from transmission-2.04-r1 and below (which happened less then year
> ago).

Not in the tree == not supported isn't it?
It is well known, that upgrades from very old setup will cause problems.
You can issue news for such cases, so users will be notified and will pay attention to how to fix the problem.

At this moment ownership enforcement break more than fixes.
Comment 16 Nikolaj Šujskij 2011-08-01 13:25:01 UTC
> Not in the tree == not supported isn't it?
> It is well known, that upgrades from very old setup will cause problems.
> You can issue news for such cases, so users will be notified and will pay
> attention to how to fix the problem.
> 
> At this moment ownership enforcement break more than fixes.

 I agree. Now upgrade certainly breaks everything for every up-to-date user, while we could ewarn "old upgraders". And I'd break things only once per box, not every revbump, like now
Comment 17 Peter Volkov (RETIRED) gentoo-dev 2011-08-03 13:18:44 UTC
(In reply to comment #14)
> Why? What was so different then?

From the top of my head, I don't remember. And cvs is available for you to dig.

(In reply to comment #15)
> (In reply to comment #13)
> Not in the tree == not supported isn't it?

Never been the case. Last discussed we do your best to support packages for 1 year (but probably in reality it is half of year). This enforcement will stay in the tree until 15 Oct 2011.

> At this moment ownership enforcement break more than fixes.

Personally I don't see any reason to change owner name. runas was added to support transmission work from different user and different directory. So either change both or don't touch this setting.
Comment 18 Nikolaj Šujskij 2011-08-03 18:04:42 UTC
(In reply to comment #17)
> (In reply to comment #14)
> > Why? What was so different then?
> 
> From the top of my head, I don't remember. And cvs is available for you to dig.

 So basically you're saying "I do not know why I enforce it, but I'll jolly well have it enforced"?

>> At this moment ownership enforcement break more than fixes.
> Personally I don't see any reason to change owner name. runas was added to
> support transmission work from different user and different directory. So
> either change both or don't touch this setting.

 Why do Gentoo have to enforce such a setup on its users? You want not to break others' upgrade (although you can't remember what should break) - that's fine. Add ewarn along the lines "If you upgrade from 2.04-r1 or below, please check that permissions are correct..." and be done. No chowning for other users every week etc., all's good'n'proper.
Comment 19 Peter Volkov (RETIRED) gentoo-dev 2011-08-03 18:12:38 UTC
Nikolaj, ebuilds should work out of box. ewarn and other staff is laziness of developers. This package does not work in your specific case. Now you have two choices: either help me to fix this and attach patch or keep silence. Discussions should go elsewhere. Thanks for understanding.
Comment 20 Nikolaj Šujskij 2011-08-03 19:08:00 UTC
(In reply to comment #19)
> Nikolaj, ebuilds should work out of box.
 This one does *not*, and noone knows why or what for.

> Now you have two
> choices: either help me to fix this and attach patch or keep silence.
 All right, if you putting it like that... Here it is.
Comment 21 Nikolaj Šujskij 2011-08-03 19:08:07 UTC
Created attachment 281981 [details, diff]
chown to $runas_user, not ot hardcoded "transmission"
Comment 22 Andrew Savchenko gentoo-dev 2011-08-08 07:51:42 UTC
(In reply to comment #17)
> Personally I don't see any reason to change owner name. runas was added to
> support transmission work from different user and different directory. So
> either change both or don't touch this setting.

It's not that simple. I'm using transmission with permissions for downloads and torrent directories like transmission:user. This ensures both security for user separation and convenience to work with download and torrent directories as a regular user.
Comment 23 Peter Volkov (RETIRED) gentoo-dev 2011-10-19 10:59:44 UTC
Ok, one year passed and I've dropped that line in 2.41. And thank you guys for getting my attention here. Enjoy :)