1 (* Samba module for Augeas
2 Author: Free Ekanayaka <free@64studio.com>
4 Reference: man smb.conf(5)
12 (************************************************************************
14 *************************************************************************)
16 let comment = IniFile.comment IniFile.comment_re IniFile.comment_default
17 let sep = del /[ \t]*=/ " ="
18 let indent = del /[ \t]*/ " "
20 (* Import useful INI File primitives *)
22 let empty = IniFile.empty
25 . store /[^;# \t\n][^;#\n]*[^;# \t\n]|[^;# \t\n]/
27 (************************************************************************
29 * smb.conf allows indented entries
30 *************************************************************************)
32 let entry_re = /[A-Za-z0-9_.-][A-Za-z0-9 _.:-]*[A-Za-z0-9_.-]/
33 let entry = let kw = entry_re in
41 (************************************************************************
43 *************************************************************************)
45 let title = IniFile.title_label "target" IniFile.record_label_re
46 let record = IniFile.record title entry
48 (************************************************************************
50 *************************************************************************)
52 let lns = IniFile.lns record comment
54 let filter = (incl "/etc/samba/smb.conf")
57 let xfm = transform lns filter