- ifelse(`
- /etc/samba/smb-shares.m4
- Copyright 2002 Jonas Smedegaard <dr@jones.dk>
- $Id: smb-shares.m4,v 1.7 2002-04-07 23:48:42 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
- _homefiles(<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]
- comment = $2
- path = $3
- force user = %u
- writable = yes
- browsable = yes
- root preexec = '/bin/mkdir $3/%U \
- /bin/chown %U $3/%U \
- /bin/chmod 700 $3/%U'
- )dnl
- define(_share_reference,
- [$1]
- comment = $2
- path = $3
- guest ok = yes
- )dnl
- dnl
- define(_share_home,
- [$2]
- comment = $3
- path = $4
- writeable = yes
- root preexec = '/bin/mkdir $4 \
- /bin/chown %S $4 \
- /bin/chmod 700 $4'
- )dnl
- define(_share_home_mac,
- [home_mac]
- comment = $1
- path = $2
- )dnl
- define(_share_home_web,
- [$1]
- comment = $2
- path = $3
- writeable = yes
- create mask = 0644
- directory mask = 0755
- )dnl
- dnl
- define(_share_pc,
- [$1]
- comment = $2
- path = $3
- browsable = yes
- writeable = yes
- create mask = 0660
- directory mask = 0770
- valid users = @$4
- force group = +$4
- )dnl
- define(_share_mac,
- [$1]
- comment = $2
- path = $3
- browsable = yes
- valid users = @$4
- veto files = _veto_mac
- )dnl
- define(_share_common,
- [$1]
- comment = $2
- path = $3
- browsable = yes
- writeable = yes
- create mask = 0660
- directory mask = 0770
- valid users = @$4
- force group = +$4
- delete veto files = Yes
- veto files = _veto_mac
- )dnl
- define(_share_printer,
- [$1]
- comment = $2
- path = $3
- printable = yes
- printer name = $4
- )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
|