summaryrefslogtreecommitdiffstats
path: root/abs/core/certmaster/acl_fix_fstab.py
blob: 8e49a1539b49628db7f17f6908b17981599f141d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/python2
import os
import sys
cmd="cp -f /etc/fstab /etc/fstab.backup.pre_acl"
os.system(cmd)
f = open('/etc/fstab', 'r')
fstab=f.readlines()
f.close()




mp=['/' , '/myth', '/data']
newfstab=[]
for line in fstab:
    new_line=line
    split_line=line.split()
    try:
        if split_line[1] in mp:
            #print split_line[3]
            if "acl" in split_line[3]:
                pass
            else:
                print "Adding ACL"
                new_acl=split_line[3]+",acl"
                split_line[3]=new_acl
                new_line='\t'.join(split_line)
    except:
        pass
    newfstab.append(new_line)


f = open('/etc/fstab', 'w')
for i in newfstab:
    f.write(i)
    f.write("\n")

f.close()