Changeset 4867


Ignore:
Timestamp:
May 23, 2017, 10:19:42 AM (2 years ago)
Author:
hectorgh
Message:

adding no_root_squash

Location:
n4d-nfs/trunk/fuentes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • n4d-nfs/trunk/fuentes/debian/postinst

    r1116 r4867  
    2424
    2525        n4d-modules enable-plugin /etc/n4d/conf.d/NfsManager || true
     26
     27        if dpkg --compare-versions "$2" lt 0.4; then
     28
     29                if [ -e "/net/exports/net.exports" ]; then
     30                       
     31                        python -c "import imp;imp.load_source('NfsManager','/usr/share/n4d/python-plugins/NfsManager.py').NfsManager().fix_missing_no_root_squash()"
     32
     33                fi
     34
     35
     36        fi
     37
     38
    2639        ;;
    2740
  • n4d-nfs/trunk/fuentes/install/etc/n4d/conf.d/NfsManager

    r2264 r4867  
    1212backup=adm,admins
    1313restore=adm,admins
     14fix_missing_no_root_squash=adm,admins
  • n4d-nfs/trunk/fuentes/install/usr/share/n4d/python-plugins/NfsManager.py

    r4337 r4867  
    1414                self.nfs_dir="/etc/exports.d/"
    1515                self.nfs_file=self.nfs_dir+"net.exports"
    16                 self.default_options="rw,sync,no_subtree_check"
     16                self.default_options="rw,sync,no_subtree_check,no_root_squash"
    1717                self.regex_pattern="^(/[\-/\w]+)(\s+)((((\d{1,3}\.){3}\d{1,3})|\w+)\((.*)\)(\s+|$))+"
    1818                self.file_header="#\n# File generated by NfsManager plugin. Do not edit\n#\n\n"
     
    6868       
    6969        #def parse_exports_file
     70
     71        def fix_missing_no_root_squash(self):
     72               
     73                exports=self.parse_exports_file()
     74
     75                for d in exports:
     76                        for ip in exports[d]:
     77                                if "no_root_squash" in exports[d][ip]:
     78                                        exports[d][ip]+=",no_root_squash"
     79
     80                self.write_exports_file(exports)
     81
     82        #def fix_missing_no_root_squash
    7083       
    7184
     
    176189                file_name=p.communicate()[0].strip("\n")+".mount"
    177190                file_dest="/lib/systemd/system/"+file_name
    178                 print tmpfilepath
    179                 print target.lstrip("/")
    180                 print file_dest
    181191               
    182192                n4d_mv(tmpfilepath,file_dest,True,'root','root','0644',False )
     
    310320if __name__=="__main__":
    311321       
    312         nfsman=NfsManager()
    313        
    314         #nfsman.add_share("/net","172.20.8.5")
    315         nfsman.parse_exports_file()
    316         nfsman.remove_ip_from_share("/net","1.2.3.4")
    317         nfsman.add_share("/pepito","2.3.4.4","one,two,three")
    318         nfsman.configure_mount_on_boot("server:/net","/net/server-sync")
    319 
     322        pass
     323
     324
Note: See TracChangeset for help on using the changeset viewer.