Change permissions via API

Status
Not open for further replies.

onlyanegg

Cadet
Joined
Aug 6, 2015
Messages
7
Hi,
I'm trying to change permissions on a dataset using the API and I'm having trouble. I'm getting a '201 CREATED' response from the server, but the permissions don't change. Can anyone help me? Is this a bug?
Here's the request in python:

r = requests.put("freenasServer/api/v1.0/storage/permission/",
auth = ( "root", self._password ),
headers = { "Content-Type": "application/json" },
verify = False,
data = json.dumps({ "mp_path": "/mnt/myVolume/users/home1/apiTest",

"mp_acl": "unix",
"mp_mode": "755",
"mp_user": "myUser",
"mp_group": myGroup" })
)

Note that the server name should have an h++p protocol prefix, but this forum wont let me post anything that looks remotely like a url. #sneakyurls
 
Last edited:

onlyanegg

Cadet
Joined
Aug 6, 2015
Messages
7
Not yet. I was gunna bump it today. I think I'll file a bug report, and I'll be sure to update the thread if it gets resolved.
 

onlyanegg

Cadet
Joined
Aug 6, 2015
Messages
7
I traced freenas's manage.py process while trying to change permissions via the API. I got like 11,000 lines of kernel calls back, so I'll post them below... just kidding. I found some here that seem to be relevant. I can't be sure that all of these calls are from my API call, because this process is pretty talkative. Can anyone help me figure this out? In particular, what is it doing when it tries to access the .windows and .mac files? And why isn't there a similar call for the directory (/mnt/datapool/users/home1/apiTest)? Shouldn't there be a chown call somewhere?

10995 4725: 8.488074869 access("/mnt/datapool/users/home1/apiTest/.windows",0) ERR#2 'No such file or directory'
10996 4725: 8.488118339 stat("/mnt/datapool/users/home1/apiTest/.mac",0x7fffffbfa170) ERR#2 'No such file or directory'
10997 4725: 8.488386895 sendto(12,"\^A\^F\0\^A\0|\^D\0",8,0x0,NULL,0x0) = 8 (0x8)
10998 4725: 8.488438935 sendto(12,"Status: 201 CREATED\r\nContent-L"...,124,0x0,NULL,0x0) = 124 (0x7c)
10999 4725: 8.488483350 sendto(12,"\0\0\0\0",4,0x0,NULL,0x0) = 4 (0x4)
11000 4725: 8.488539265 sendto(12,"\^A\^F\0\^A\0-\^C\0",8,0x0,NULL,0x0) = 8 (0x8)
11001 4725: 8.488584395 sendto(12,"Mount Point permissions successf"...,45,0x0,NULL,0x0) = 45 (0x2d)
11002 4725: 8.488627175 sendto(12,"\0\0\0",3,0x0,NULL,0x0) = 3 (0x3)
11003 4725: 8.488796953 fstat(17,{ mode=-rw-r----- ,inode=13,size=311296,blksize=131072 }) = 0 (0x0)
11004 4725: 8.488833987 stat("/data/freenas-v1.db",{ mode=-rw-r----- ,inode=13,size=311296,blksize=131072 }) = 0 (0x0)
11005 4725: 8.488865956 close(17) = 0 (0x0)
 
Status
Not open for further replies.
Top