Restrict certain RPC changes

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
geeo
Posts: 2
Joined: Sat Jan 05, 2013 12:50 am

Restrict certain RPC changes

Post by geeo »

Hi folks !
I run transmission behind nginx for some friends and im looking for a way to prevent the modification of certain values ​​via RPC access, including "download-dir" and "cache-size-mb". I'm not familiar with the C language, my research leads me to the files to "daemon/remote.c" and "libtransmission/session.c." I apply some changes and build it to test on the value "start-added-torrents", unfortunately i can not prevent its modifcation :

I use transmissionrpc for Python to check that :
t = transmissionrpc.Client(...)
t.get_session().start_added_torrents
>> True
t.set_session(start_added_torrents=False)
t.get_session().start_added_torrents
>> False

Ideally, I would like to manage these values ​​only from "settings.json."

A develloper can give me a little track?
Thanks :)
Jordan
Transmission Developer
Posts: 2312
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Restrict certain RPC changes

Post by Jordan »

The restrictions should probably be put into rpcimpl.c.

There's an open ticket similar to this, https://trac.transmissionbt.com/ticket/5019
geeo
Posts: 2
Joined: Sat Jan 05, 2013 12:50 am

Re: Restrict certain RPC changes

Post by geeo »

Thanks, it work :D

I just comment out the condition on my choice "sessionGet" start at line 1534 on rpcimpl.c. It making the var readeable-only pretty well.

The idea to add a read-only mode seduce me, and im sure we are many on this case.
I think to something like that, on "settings.json" :

Code: Select all

"rpc-read-only" : ["download-dir", "rpc-port", "cache-size-mb"],
Jordan
Transmission Developer
Posts: 2312
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Restrict certain RPC changes

Post by Jordan »

Hmm, I was thinking more along the lines of having a read-only mode.
Post Reply