summaryrefslogtreecommitdiff
path: root/samba/smb-shares.m4
blob: 6aca51ee800b9d53c71d87900dc38a709766bebe (plain)
  1. ifelse(`
  2. /etc/samba/smb-shares.m4
  3. Copyright 2002 Jonas Smedegaard <dr@jones.dk>
  4. $Id: smb-shares.m4,v 1.7 2002-04-07 23:48:42 jonas Exp $
  5. m4 share definitions for generating Samba server smb.conf include file
  6. Usage: m4 -DFQDN=<FQDN> /etc/samba/smb-shares.conf.m4 > /etc/samba/smb-shares.conf
  7. Depend on file /etc/local-COMMON/file-<FQDN>.m4 containing lines of
  8. the following syntax:
  9. _dir(<path>,<uid>,<gid>,<modes>)dnl
  10. _homefiles(<os>,<mount>,<desc>,<path>[,ro])dnl
  11. _files(<os>,<mount>,<desc>,<path>,<uid>,<gid>,<modes>[,ro[,<group>]|,rw,<group>[,<othergroup>]])dnl
  12. where
  13. <os>: Client operating systems (mac|win|any)
  14. <mount>: Mount point name (Samba: single word and max. 8 characters for backwards compatibility)
  15. <desc>: Mount point description (iso8859-1 is (fully?) supported).
  16. <uid>: user name of mountpoint owner
  17. <gid>: group name of mountpoint owner
  18. <modes>: Numeric access modes of mount point
  19. <path>: Full path to mount point
  20. <group>: Primary group with (readonly) access to mountpoint. Public (or whatever limited by filesystem) readonly access if omitted
  21. <othergroup>: Secondary group with readonly access
  22. Example:
  23. _dir(/home/fsadmin/COMMON,fsadmin,fsadmin,755)dnl
  24. _homefiles(win,homes,Personal files,%H/pc))
  25. _homefiles(mac,,Personal files,~/mac))
  26. _files(win,soft,softshare,/home/fsadmin/COMMON/software,fsadmin,fsadmin,775)dnl
  27. _printer(win,LW,Networkprinter queue for Apple LaserWriter 16/600,/tmp,lw)
  28. ')dnl
  29. define(_veto_mac,
  30. `/.AppleDouble/.AppleDesktop/Network Trash Folder/DesktopFolderDB/resource.frk/Icon^M/TheVolumeSettingsFolder/')dnl
  31. define(_share_logon,
  32. [$1]
  33. comment = $2
  34. path = $3
  35. )dnl
  36. define(_share_profiles,
  37. [$1]
  38. comment = $2
  39. path = $3
  40. force user = %u
  41. writable = yes
  42. browsable = yes
  43. root preexec = '/bin/mkdir $3/%U \
  44. /bin/chown %U $3/%U \
  45. /bin/chmod 700 $3/%U'
  46. )dnl
  47. define(_share_reference,
  48. [$1]
  49. comment = $2
  50. path = $3
  51. guest ok = yes
  52. )dnl
  53. dnl
  54. define(_share_home,
  55. [$2]
  56. comment = $3
  57. path = $4
  58. writeable = yes
  59. root preexec = '/bin/mkdir $4 \
  60. /bin/chown %S $4 \
  61. /bin/chmod 700 $4'
  62. )dnl
  63. define(_share_home_mac,
  64. [home_mac]
  65. comment = $1
  66. path = $2
  67. )dnl
  68. define(_share_home_web,
  69. [$1]
  70. comment = $2
  71. path = $3
  72. writeable = yes
  73. create mask = 0644
  74. directory mask = 0755
  75. )dnl
  76. dnl
  77. define(_share_pc,
  78. [$1]
  79. comment = $2
  80. path = $3
  81. browsable = yes
  82. writeable = yes
  83. create mask = 0660
  84. directory mask = 0770
  85. valid users = @$4
  86. force group = +$4
  87. )dnl
  88. define(_share_mac,
  89. [$1]
  90. comment = $2
  91. path = $3
  92. browsable = yes
  93. valid users = @$4
  94. veto files = _veto_mac
  95. )dnl
  96. define(_share_common,
  97. [$1]
  98. comment = $2
  99. path = $3
  100. browsable = yes
  101. writeable = yes
  102. create mask = 0660
  103. directory mask = 0770
  104. valid users = @$4
  105. force group = +$4
  106. delete veto files = Yes
  107. veto files = _veto_mac
  108. )dnl
  109. define(_share_printer,
  110. [$1]
  111. comment = $2
  112. path = $3
  113. printable = yes
  114. printer name = $4
  115. )dnl
  116. dnl
  117. define(_megashare,
  118. [$1]
  119. ifelse($2,,,
  120. comment = $2
  121. ) path = $3
  122. browsable = yes
  123. ifelse($7,rw,
  124. writeable = yes
  125. create mask = 0660
  126. directory mask = 0770
  127. ifelse($8,,,
  128. valid users = @$8
  129. force group = +$8
  130. ) delete veto files = Yes
  131. ) veto files = _veto_mac
  132. )dnl
  133. dnl
  134. define(_dir,`')dnl
  135. define(_homefiles,`ifelse($1,win,_share_home($2,$3,$4))')dnl
  136. dnl define(_files,`ifelse($1,win,_megashare($2,$3,$4,$5,$6,$7,$8))')dnl
  137. define(_files,`ifelse($1,win,
  138. ifelse($2,netlogon,_share_logon($2,$3,$4),
  139. $2,profiles,_share_profiles($2,$3,$4),
  140. $2,reference,_share_reference($2,$3,$4),
  141. _share_common($2,$3,$4,$6)))')dnl
  142. include(/etc/local-COMMON/file-FQDN.m4)dnl