REQUEST: chmod file when removed from rTorrent

lisas4567

Member
May 25, 2018
773
0
16
While a torrent is active in rTorrent, it shouldn't be moved on the file-system level, but rather on rTorrents level so that rTorrent can keep track of it. This is how it currently works -- the files are set to 0755 (by default -- I guess this can be changed per system). However, this functionality isn't need once the torrent is removed from rTorrent.

I'm requesting a plugin that chmods a file upon removal. This will, for example, allow users to set the chmod to something like 0777 once the torrent is removed from rTorrent so that the file may be moved around by anyone.
 

simur612

Member
May 25, 2018
879
0
16
this is stupid. you can set umask at the user level OR in the .rtorrent.rc


add:
Code:
umask = 0000
to .rtorrent.rc for 777 permissions.

or edit the umask for your user (defaul umask in your case is 0022 obviously if directories are 755)
 

randac56

Member
May 25, 2018
915
0
16
Then rtorrent will create the files with 0777 which is bad because then anybody can move the downloads when they are done and seeding. I'm afraid rtorrent will see this as a corrupted download and re-download the data
 

saroos1

Member
May 25, 2018
718
0
16
No, I think you are confused, or I didn't explain my position well enough.

When rTorrent or it's user creates a file (when you load it with a .torrent), it MUST have write restrictions in place to prevent the files from moving by other while they are downloading or seeding. This means that the file creation mask needs to be something like 755, where it prevents anyone but rTorrents user to modify the files. If the creation mask was 777, rTorrent may be downloading or seeding from the file when someone comes along and moves it for whatever reason (reason here is not important, what's important is the fact that it's moved). Moving or deleting a file that is active in rTorrent can be annoying, because rTorrent assumes that it won't be altered. When it is, it may spit back errors, think it's a faulty download, and try again by downloading the entire torrent again.

So, point 1: rTorrent needs a 755 mask while it's working with torrents to avoid those file from being altered by someone who doesn't know what they're doing or not paying attention.

However, if the torrent is removed from rTorrent, rTorrent no longer needs to have absolute control over writing to the file(s) owned by that torrent. It may be moved around, deleted, renamed, etc since rTorrent is no longer tracking it (that is to day there is no download and/or upload activity involved with that torrent or it's files). However, it still has the 755 mask from when it was created, preventing others to move, delete, rename, or otherwise modify it.

So, point 2: if rTorrent, or ruTorrent via a plugin, could chmod the file(s) once the torrent is deleted from rTorrent to new permissions based on what the TorrentMaster(tm) wants, this doesn't become a problem.

Hope I explained it better this time. All I want is for rTorrent to relinquish control over files that it no longer monitors, while still denying write access to files that it's using.

Unless I really am the one confused... tongue.gif
 

simur612

Member
May 25, 2018
879
0
16
Yes, ^

By default, rtorrent will create files with permissions for the user its running as. The umask option is for CHANGING this to whatever you may want.
I know. undecided.gif But it will not change the permissions once the torrent is removed from rTorrent, will it?
 

peshua19

Member
May 25, 2018
897
0
16
No, I think you are confused, or I didn't explain my position well enough.

When rTorrent or it's user creates a file (when you load it with a .torrent), it MUST have write restrictions in place to prevent the files from moving by other while they are downloading or seeding. This means that the file creation mask needs to be something like 755, where it prevents anyone but rTorrents user to modify the files. If the creation mask was 777, rTorrent may be downloading or seeding from the file when someone comes along and moves it for whatever reason (reason here is not important, what's important is the fact that it's moved). Moving or deleting a file that is active in rTorrent can be annoying, because rTorrent assumes that it won't be altered. When it is, it may spit back errors, think it's a faulty download, and try again by downloading the entire torrent again.

So, point 1: rTorrent needs a 755 mask while it's working with torrents to avoid those file from being altered by someone who doesn't know what they're doing or not paying attention.

However, if the torrent is removed from rTorrent, rTorrent no longer needs to have absolute control over writing to the file(s) owned by that torrent. It may be moved around, deleted, renamed, etc since rTorrent is no longer tracking it (that is to day there is no download and/or upload activity involved with that torrent or it's files). However, it still has the 755 mask from when it was created, preventing others to move, delete, rename, or otherwise modify it.

So, point 2: if rTorrent, or ruTorrent via a plugin, could chmod the file(s) once the torrent is deleted from rTorrent to new permissions based on what the TorrentMaster(tm) wants, this doesn't become a problem.

Hope I explained it better this time. All I want is for rTorrent to relinquish control over files that it no longer monitors, while still denying write access to files that it's using.

Unless I really am the one confused... tongue.gif
I still don't understand why you can't rely on basic user umask settings. If you understand how unix permissions work, and you understand what you need, you can have files create with the proper permissions from jump.

755 for directories means owner can read/write/execute, group can read/execute and everyone else can read/execute.

I'm not sure what you are trying to accomplish exactly but it can probably be done by either:


using a specific umask.
using groups and a specific umask (perhaps having files created by a user in group whatever and setting umask to 0002 )

or something else....I don't see the point in changing the permissions post mortem when you can create the files in whatever mask you wish them to be in.
 

saroos1

Member
May 25, 2018
718
0
16
Thank you Sky. I will look into it. I tried to search for that myself but nothing stuck out during my initial search.

won, undecided.gif Dunno what to tell you. It's not a basic Linux permission problem that I'm having trouble with. It's the fact that I want the permissions to change when the torrent is removed from rTorrent, which would require either rTorrent or ruTorrent to do. I can't describe it any better than that.