|
219 |
finally: |
219 |
finally: |
220 |
listener.unsetuid() |
220 |
listener.unsetuid() |
221 |
|
221 |
|
|
|
222 |
if ( not (new and old) ) or (new['univentionShareSambaName'][0] != old['univentionShareSambaName'][0]): |
223 |
listener.setuid(0) |
224 |
try: |
225 |
fp = open('/etc/samba/shares.conf', 'w') |
226 |
print >>fp, '# Warning: This file is auto-generated and will be overwritten by \n# univention-directory-listener module. \n# Please edit the following file instead: \n# /etc/samba/local.conf \n \n# Warnung: Diese Datei wurde automatisch generiert und wird durch ein \n# univention-directory-listener Modul überschrieben werden. \n# Ergänzungen können an folgende Datei vorgenommen werden: \n# \n# /etc/samba/local.conf \n#' |
227 |
|
228 |
for f in os.listdir('/etc/samba/shares.conf.d'): |
229 |
print >>fp, 'include = %s' % os.path.join('/etc/samba/shares.conf.d', f) |
230 |
fp.close() |
231 |
finally: |
232 |
listener.unsetuid() |
233 |
|
222 |
def initialize(): |
234 |
def initialize(): |
223 |
if not os.path.exists('/etc/samba/shares.conf.d'): |
235 |
if not os.path.exists('/etc/samba/shares.conf.d'): |
224 |
listener.setuid(0) |
236 |
listener.setuid(0) |
|
242 |
def postrun(): |
254 |
def postrun(): |
243 |
listener.setuid(0) |
255 |
listener.setuid(0) |
244 |
try: |
256 |
try: |
245 |
fp = open('/etc/samba/shares.conf', 'w') |
|
|
246 |
print >>fp, '# Warning: This file is auto-generated and will be overwritten by \n# univention-directory-listener module. \n# Please edit the following file instead: \n# /etc/samba/local.conf \n \n# Warnung: Diese Datei wurde automatisch generiert und wird durch ein \n# univention-directory-listener Modul überschrieben werden. \n# Ergänzungen können an folgende Datei vorgenommen werden: \n# \n# /etc/samba/local.conf \n#' |
247 |
|
248 |
for f in os.listdir('/etc/samba/shares.conf.d'): |
249 |
print >>fp, 'include = %s' % os.path.join('/etc/samba/shares.conf.d', f) |
250 |
fp.close() |
251 |
initscript='/etc/init.d/samba' |
257 |
initscript='/etc/init.d/samba' |
252 |
os.spawnv(os.P_WAIT, initscript, ['samba', 'reload']) |
258 |
os.spawnv(os.P_WAIT, initscript, ['samba', 'reload']) |
253 |
finally: |
259 |
finally: |