|
Lines 417-426
def handler(dn, new, old):
Link Here
|
| 417 |
print >>fp, 'include = %s' % os.path.join('/etc/samba/printers.conf.d', f) |
417 |
print >>fp, 'include = %s' % os.path.join('/etc/samba/printers.conf.d', f) |
| 418 |
fp.close() |
418 |
fp.close() |
| 419 |
os.rename('/etc/samba/printers.conf.temp', '/etc/samba/printers.conf') |
419 |
os.rename('/etc/samba/printers.conf.temp', '/etc/samba/printers.conf') |
| 420 |
|
|
|
| 421 |
finally: |
420 |
finally: |
| 422 |
listener.unsetuid() |
421 |
listener.unsetuid() |
| 423 |
|
422 |
|
|
|
423 |
reload_printer_restrictions() |
| 424 |
|
| 424 |
if need_to_reload_cups: |
425 |
if need_to_reload_cups: |
| 425 |
reload_daemon('cups', 'cups-printers: ') |
426 |
reload_daemon('cups', 'cups-printers: ') |
| 426 |
|
427 |
|
|
Lines 437-442
def reload_daemon(daemon, prefix):
Link Here
|
| 437 |
ud.debug(ud.LISTENER, ud.INFO, "%s no %s to reload found" % (prefix, daemon)) |
438 |
ud.debug(ud.LISTENER, ud.INFO, "%s no %s to reload found" % (prefix, daemon)) |
| 438 |
|
439 |
|
| 439 |
|
440 |
|
|
|
441 |
def reload_printer_restrictions(): |
| 442 |
listener.setuid(0) |
| 443 |
try: |
| 444 |
subprocess.call(['python', '/usr/share/pyshared/univention/lib/share_restrictions.py']) |
| 445 |
finally: |
| 446 |
listener.unsetuid() |
| 447 |
|
| 448 |
|
| 440 |
def reload_smbd(): |
449 |
def reload_smbd(): |
| 441 |
global reload_samba_in_postrun |
450 |
global reload_samba_in_postrun |
| 442 |
listener.setuid(0) |
451 |
listener.setuid(0) |