Last change
on this file since 2469 was
2469,
checked in by daduve, 4 years ago
|
Adding new files
|
-
Property svn:executable set to
*
|
File size:
675 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | import xmlrpclib as x |
---|
3 | import sys |
---|
4 | import os |
---|
5 | if len(sys.argv) != 4: |
---|
6 | sys.exit(0) |
---|
7 | home = sys.argv[1] |
---|
8 | group = sys.argv[2] |
---|
9 | user = sys.argv[3] |
---|
10 | s = x.ServerProxy('https://server:9779') |
---|
11 | list_acl = s.get_acl_group_filtered('','NetFoldersManager',group) |
---|
12 | try: |
---|
13 | apply_nobody_nogroup = False |
---|
14 | if len(list_acl) > 0: |
---|
15 | list_acl.append(['-m','u:'+user+':rwx']) |
---|
16 | apply_nobody_nogroup = True |
---|
17 | for x in list_acl: |
---|
18 | os.system('setfacl ' + ' '.join(x) + ' "' + home + '"') |
---|
19 | |
---|
20 | # Apply --- to others to every single home |
---|
21 | os.system('setfacl -m o:--- "%s"'%home) |
---|
22 | |
---|
23 | if apply_nobody_nogroup: |
---|
24 | os.system('chown ' + user+':nogroup "' + home + '"') |
---|
25 | except Exception as e: |
---|
26 | pass |
---|
Note: See
TracBrowser
for help on using the repository browser.