diff options
author | Jonas Smedegaard <dr@jones.dk> | 2002-04-07 23:23:11 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2002-04-07 23:23:11 +0000 |
commit | 8881ae8a67b935415a34ed53ce1b694ab87a1826 (patch) | |
tree | 74f1372d77d7f251bbf302e6bca026b932636527 /samba | |
parent | 7b02c8a6779291224b31d7be775fc977886678ef (diff) |
Major update to m4 file sharing config generation.
Diffstat (limited to 'samba')
-rw-r--r-- | samba/cf.samba.m4 | 42 | ||||
-rw-r--r-- | samba/smb-shares.m4 | 123 | ||||
-rw-r--r-- | samba/smb_gandalf.xenux.local.conf | 78 | ||||
-rw-r--r-- | samba/smb_gandalf.xenux.local.conf.m4 | 17 | ||||
-rw-r--r-- | samba/smb_jawa.homebase.dk.conf.m4 | 51 | ||||
-rw-r--r-- | samba/smb_thor.venture.local.conf.m4 | 13 |
6 files changed, 89 insertions, 235 deletions
diff --git a/samba/cf.samba.m4 b/samba/cf.samba.m4 deleted file mode 100644 index 48dc460..0000000 --- a/samba/cf.samba.m4 +++ /dev/null @@ -1,42 +0,0 @@ -dnl -dnl /etc/cfengine/cf.samba.m4 -dnl Copyright 2002 Jonas Smedegaard <dr@jones.dk> -dnl -dnl $Id: cf.samba.m4,v 1.1 2002-04-02 16:03:04 jonas Exp $ -dnl -dnl m4 skeleton file for Samba server cfengine cleanup file -dnl -define(_tab,` ')dnl -define(_dir,_tab$1 - mode=$2 - owner=$3 - group=$4 -)dnl -define(_nonshare,_dir($3,$6,$4,$5))dnl -define(_share_home,_dir($3,$6,$4,$5))dnl -define(_share_pc_wrr,_dir($3,$6,$4,$5))dnl -define(_share_pc_wwr,_dir($3,$6,$4,$5))dnl -define(_share_pc_www,_dir($3,$6,$4,$5))dnl -control: - AddInstallable = ( samba samba_reload netatalk netatalk_reload ) - - samba_reload:: - { /etc/samba/smb-shares-$(fqdn).conf - LocateLineMatching "^; EDITED BY CFENGINE .*" - ReplaceAll '; EDITED BY CFENGINE .*$' With '; EDITED BY CFENGINE $(date)' - CatchAbort - BeginGroupIfNoMatch "^; EDITED BY CFENGINE .*" - Append '; EDITED BY CFENGINE $(date)' - EndGroup - } - -directories: -dnl include(smb_esyscmd(hostname -f).m4)dnl -include(smb_thor.venture.local.conf.m4)dnl - -processes: - "smbd" restart "/etc/init.d/samba restart" - -shellcommands: - samba_reload:: - "/etc/init.d/samba force-reload" diff --git a/samba/smb-shares.m4 b/samba/smb-shares.m4 index 0cf86e4..96f5b7c 100644 --- a/samba/smb-shares.m4 +++ b/samba/smb-shares.m4 @@ -1,25 +1,47 @@ -dnl -dnl /etc/samba/smb-shares.m4 -dnl Copyright 2002 Jonas Smedegaard <dr@jones.dk> -dnl -dnl $Id: smb-shares.m4,v 1.5 2002-04-02 16:03:04 jonas Exp $ -dnl -dnl m4 share definitions for generating Samba server smb.conf -dnl -define(_veto_mac,/.AppleDouble/.AppleDesktop/Network Trash Folder/DesktopFolderDB/resource.frk/Icon^M/TheVolumeSettingsFolder/)dnl -dnl -dnl Common share options -dnl -------------------- -dnl -dnl $1 Share name -dnl $2 Description -dnl $3 Path -dnl -define(_share_logon,[$1] +ifelse(` +/etc/samba/smb-shares.m4 +Copyright 2002 Jonas Smedegaard <dr@jones.dk> + +$Id: smb-shares.m4,v 1.6 2002-04-07 23:23:11 jonas Exp $ + +m4 share definitions for generating Samba server smb.conf include file + +Usage: m4 -DFQDN=<FQDN> /etc/samba/smb-shares.conf.m4 > /etc/samba/smb-shares.conf + +Depend on file /etc/local-COMMON/file-<FQDN>.m4 containing lines of +the following syntax: + _dir(<path>,<uid>,<gid>,<modes>)dnl + _home(<os>,<mount>,<desc>,<path>[,ro])dnl + _files(<os>,<mount>,<desc>,<path>,<uid>,<gid>,<modes>[,ro[,<group>]|,rw,<group>[,<othergroup>]])dnl +where + <os>: Client operating systems (mac|win|any) + <mount>: Mount point name (Samba: single word and max. 8 characters for backwards compatibility) + <desc>: Mount point description (iso8859-1 is (fully?) supported). + <uid>: user name of mountpoint owner + <gid>: group name of mountpoint owner + <modes>: Numeric access modes of mount point + <path>: Full path to mount point + <group>: Primary group with (readonly) access to mountpoint. Public (or whatever limited by filesystem) readonly access if omitted + <othergroup>: Secondary group with readonly access + +Example: + + _dir(/home/fsadmin/COMMON,fsadmin,fsadmin,755)dnl + _homefiles(win,homes,Personal files,%H/pc)) + _homefiles(mac,,Personal files,~/mac)) + _files(win,soft,softshare,/home/fsadmin/COMMON/software,fsadmin,fsadmin,775)dnl + _printer(win,LW,Networkprinter queue for Apple LaserWriter 16/600,/tmp,lw) + +')dnl +define(_veto_mac, + `/.AppleDouble/.AppleDesktop/Network Trash Folder/DesktopFolderDB/resource.frk/Icon^M/TheVolumeSettingsFolder/')dnl +define(_share_logon, +[$1] comment = $2 path = $3 )dnl -define(_share_profiles,[$1] +define(_share_profiles, +[$1] comment = $2 path = $3 force user = %u @@ -29,25 +51,29 @@ define(_share_profiles,[$1] /bin/chown %U $3/%U \ /bin/chmod 700 $3/%U' )dnl -define(_share_reference,[$1] +define(_share_reference, +[$1] comment = $2 path = $3 guest ok = yes )dnl dnl -define(_share_home,[$1] - comment = $2 - path = $3 +define(_share_home, +[$2] + comment = $3 + path = $4 writeable = yes - root preexec = '/bin/mkdir $3 \ - /bin/chown %S $3 \ - /bin/chmod 700 $3' + root preexec = '/bin/mkdir $4 \ + /bin/chown %S $4 \ + /bin/chmod 700 $4' )dnl -define(_share_home_mac,[home_mac] +define(_share_home_mac, +[home_mac] comment = $1 path = $2 )dnl -define(_share_home_web,[$1] +define(_share_home_web, +[$1] comment = $2 path = $3 writeable = yes @@ -55,7 +81,8 @@ define(_share_home_web,[$1] directory mask = 0755 )dnl dnl -define(_share_pc,[$1] +define(_share_pc, +[$1] comment = $2 path = $3 browsable = yes @@ -65,14 +92,16 @@ define(_share_pc,[$1] valid users = @$4 force group = +$4 )dnl -define(_share_mac,[$1] +define(_share_mac, +[$1] comment = $2 path = $3 browsable = yes valid users = @$4 veto files = _veto_mac )dnl -define(_share_common,[$1] +define(_share_common, +[$1] comment = $2 path = $3 browsable = yes @@ -84,11 +113,37 @@ define(_share_common,[$1] delete veto files = Yes veto files = _veto_mac )dnl -define(_share_printer,[$1] +define(_share_printer, +[$1] comment = $2 path = $3 printable = yes printer name = $4 )dnl -dnl include(smb_esyscmd(hostname -f).m4)dnl -include(smb_thor.venture.local.conf.m4)dnl +dnl +define(_megashare, +[$1] +ifelse($2,,, + comment = $2 +) path = $3 + browsable = yes +ifelse($7,rw, + writeable = yes + create mask = 0660 + directory mask = 0770 +ifelse($8,,, + valid users = @$8 + force group = +$8 +) delete veto files = Yes +) veto files = _veto_mac +)dnl +dnl +define(_dir,`')dnl +define(_homefiles,`ifelse($1,win,_share_home($2,$3,$4))')dnl +dnl define(_files,`ifelse($1,win,_megashare($2,$3,$4,$5,$6,$7,$8))')dnl +define(_files,`ifelse($1,win, + ifelse($2,netlogon,_share_logon($2,$3,$4), + $2,profiles,_share_profiles($2,$3,$4), + $2,reference,_share_reference($2,$3,$4), + _share_common($2,$3,$4,$6)))')dnl +include(/etc/local-COMMON/file-FQDN.m4)dnl diff --git a/samba/smb_gandalf.xenux.local.conf b/samba/smb_gandalf.xenux.local.conf deleted file mode 100644 index fd624ba..0000000 --- a/samba/smb_gandalf.xenux.local.conf +++ /dev/null @@ -1,78 +0,0 @@ -[netlogon] - comment = Network logon - path = $(netlogshare) - browsable = no - writeable = no - share modes = no -[userprofiles] - path = $(profshare) - force user = %u - writable = yes - browsable = yes - root preexec = '/bin/mkdir $(profshare)/%U \ - /bin/chown %U $(profshare)/%U \ - /bin/chmod 700 $(profshare)/%U' -[homes] - path = %H/$(privpcshare) - browsable = no - writeable = yes - root preexec = '/bin/mkdir %H/$(privpcshare) \ - /bin/chown %S %H/$(privpcshare) \ - /bin/chmod 700 %H/$(privpcshare)' -[software] - path = $(softshare) - comment = Fælles software for Xenux ApS - browsable = yes - guest ok = no - writeable = yes - create mask = 0660 - directory mask = 0770 - valid users = @$(admingrp) - force group = +$(admingrp) - delete veto files = Yes - veto files = /.AppleDouble/.AppleDesktop/Network Trash Folder/DesktopFolderDB/resource.frk/Icon^M/TheVolumeSettingsFolder/ -[dokumenter] - path = $(datashare) - comment = Fælles dokumenter for Xenux ApS - browsable = yes - guest ok = no - writeable = yes - create mask = 0660 - directory mask = 0770 - valid users = @$(admingrp) - force group = +$(admingrp) - delete veto files = Yes - veto files = /.AppleDouble/.AppleDesktop/Network Trash Folder/DesktopFolderDB/resource.frk/Icon^M/TheVolumeSettingsFolder/ -[fssoftware] - path = /home/finn/documents - comment = Fælles software for Finn Strandgaard A/S - browsable = yes - guest ok = no - writeable = yes - create mask = 0660 - directory mask = 0770 - valid users = @finn - force group = +$finn - delete veto files = Yes - veto files = /.AppleDouble/.AppleDesktop/Network Trash Folder/DesktopFolderDB/resource.frk/Icon^M/TheVolumeSettingsFolder/ -[fsdokumenter] - path = /home/finn/software - comment = Fælles dokumenter for Finn Strandgaard A/S - browsable = yes - guest ok = no - writeable = yes - create mask = 0660 - directory mask = 0770 - valid users = @finn - force group = +finn - delete veto files = Yes - veto files = /.AppleDouble/.AppleDesktop/Network Trash Folder/DesktopFolderDB/resource.frk/Icon^M/TheVolumeSettingsFolder/ -[media] - comment = Mp3 filer, film, spil etc. - path = /home/jrisch/media - public = no - valid users = @mp3 - force group = +mp3 - writable = yes - create mask = 0660 - directory mask = 0770 diff --git a/samba/smb_gandalf.xenux.local.conf.m4 b/samba/smb_gandalf.xenux.local.conf.m4 deleted file mode 100644 index 4aa5ba6..0000000 --- a/samba/smb_gandalf.xenux.local.conf.m4 +++ /dev/null @@ -1,17 +0,0 @@ -include(smb-shares.m4)dnl -_share_logon(netlogon,Network logon,$(netlogshare)) -_share_profiles(userprofiles,Brugerprofiler,$(profshare)) -_share_home(homes,Personlige dokumenter,%H/$(privpcshare)) -_share_common(software,Fælles software for Xenux ApS,$(softshare),$(admingrp)) -_share_common(dokumenter,Fælles dokumenter for Xenux ApS,$(datashare),$(admingrp)) -_share_common(fssoftware,Fælles software for Finn Strandgaard A/S,/home/finn/documents,finn) -_share_common(fsdokumenter,Fælles dokumenter for Finn Strandgaard A/S,/home/finn/software,finn) -[media] - comment = Mp3 filer, film, spil etc. - path = /home/jrisch/media - public = no - valid users = @mp3 - force group = +mp3 - writable = yes - create mask = 0660 - directory mask = 0770 diff --git a/samba/smb_jawa.homebase.dk.conf.m4 b/samba/smb_jawa.homebase.dk.conf.m4 deleted file mode 100644 index b4452c0..0000000 --- a/samba/smb_jawa.homebase.dk.conf.m4 +++ /dev/null @@ -1,51 +0,0 @@ -dnl -dnl /etc/samba/smb_jawa.homebase.dk.conf.m4 -dnl Copyright 2002 Jonas Smedegaard <dr@jones.dk> -dnl -dnl $Id: smb_jawa.homebase.dk.conf.m4,v 1.4 2002-03-20 20:06:46 jonas Exp $ -dnl -dnl Samba shares for Homebase Samba server -dnl -dnl Usage: m4 thisfile > `/etc/samba/smb_jawa.homebase.dk.conf` -dnl -dnl or from Midnight Commander with this file selected and /etc/samba in the other frame: -dnl m4 %s > `basename %s .m4` -dnl -include(smb-shares.m4)dnl -_share_logon(netlogon,Netværkslogon,/var/local/samba/COMMON/C/netlogon) -_share_profiles(userprofiles,Brugerprofiler,/var/local/samba/userprofiles) -_share_reference(reference,DEBIAN: Samba Linux server,/var/local/samba/COMMON/C/reference) -dnl -_share_home(homes,Personlige dokumenter,%H/pc) -_share_home_mac(home_mac,Personlige Macintosh-dokumenter,%H/mac) -_share_home_web(home_web,Personlige web-dokumenter,%H/public_html) -dnl -_share_mac(hb,Homebase Arkiver (Mac),/volumes/homebase/hb/hb,hb) -_share_mac(hbsoft,Homebase Software (Mac),/volumes/homebase/hb/admin,hb) -_share_mac(admin,Homebase Teknik (Mac),/volumes/homebase/admin/admin,admin) -dnl -_share_mac(fl,Frontløberne Fællesarkiver (Mac),/volumes/misc/fl/fl,fl) -_share_mac(fllock,Frontløberne Låste arkiver (Mac),/volumes/misc/fl/flstab,fl) -_share_mac(flstab,Frontløberne Stabsarkiver (Mac),/volumes/misc/flstab/flstab,flstab) -dnl -_share_mac(std,`Software, dr.jones',/var/local/netatalk/COMMON/C/software/users/jonas/,users) -_share_mac(std_en,`Software, engelsk, dr.jones',/var/local/netatalk/COMMON/en/software/users/jonas/,users) -_share_mac(std_da,`Software, dansk, dr.jones',/var/local/netatalk/COMMON/da/software/users/jonas/,users) -dnl -_share_mac(adm,`Admin, dr.jones',/var/local/netatalk/COMMON/C/admin/users/jonas/,admin) -_share_mac(adm_en,`Admin, engelsk, dr.jones',/var/local/netatalk/COMMON/en/admin/users/jonas/,admin) -_share_mac(adm_da,`Admin, dansk, dr.jones',/var/local/netatalk/COMMON/da/admin/users/jonas/,admin) -dnl -_share_mac(km,KaosManagement Arkiver (Mac),/volumes/km/km/km,km) -_share_mac(kmstab,KaosMAnagement Administration (Mac),/volumes/km/kmstab/kmstab,kmstab) -dnl -_share_mac(kp,KaosPiloterne Fællesarkiver (Mac),/volumes/kp/kp/kp,kp) -_share_mac(kplock,KaosPiloterne Låste arkiver (Mac),/volumes/kp/kp/kpstab,kp) -_share_mac(kpstab,KaosPiloterne Stabsarkiver (Mac),/volumes/kp/kpstab/kpstab,kpstab) -dnl -_share_mac(fl,Café Kølbert (Mac),/volumes/misc/kolbert/kolbert,kolbert) -dnl -_share_printer(HP,Networkprinter queue for HP 2100 (postscript level 3),/tmp,hp) -_share_printer(KPHP,Networkprinter queue for HP 2100 (postscript level 3),/tmp,kphp) -_share_printer(KPLW,Networkprinter queue for Apple LaserWriter 8500 (postscript level 3),/tmp,kplw) -_share_printer(LW,Networkprinter queue for Apple LaserWriter 16/600,/tmp,lw) diff --git a/samba/smb_thor.venture.local.conf.m4 b/samba/smb_thor.venture.local.conf.m4 deleted file mode 100644 index 264c428..0000000 --- a/samba/smb_thor.venture.local.conf.m4 +++ /dev/null @@ -1,13 +0,0 @@ -_nonshare(common,commonshare,/home/fsadmin/COMMON,fsadmin,fsadmin,755)dnl -_share_pc_wwr(soft,softshare,/home/fsadmin/COMMON/software,fsadmin,fsadmin,775)dnl -_share_home(homes,Personlige dokumenter,%H/.pcshare)) -_share_pc_wwr($(datashare),fsadmin,fsadmin,775)dnl -_share_pc_wwr(admin,Administration,/home/admin/admin,admin,admin,775)dnl -_share_pc_wwr(business,Business,/home/business/business,business,business,775)dnl -_share_pc_wwr(accounting,Accounting,/home/accounting/accounting,accounting,accounting,775)dnl -_share_pc_wwr(graphics,Graphics,/home/graphics/graphics,graphics,graphics,775)dnl -_share_pc_wwr(it,IT,/home/it/it,it,it,775)dnl -_share_pc_wwr(edu,Education,/home/edu/edu,edu,edu,775)dnl -_share_pc_wwr(service,Service,/home/service/service,service,service,775)dnl -_share_pc_wrr(netlogon,Network logon,/etc/samba/netlogon,root,root,755)dnl -_share_pc_www(profiles,Brugerprofiler,/home/fsadmin/COMMON/samba/userprofiles,fsadmin,fsadmin,777)dnl |