Bug 31764 - samba/printers.conf* race condition
samba/printers.conf* race condition
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Printserver
UCS 3.1
Other Linux
: P5 normal (vote)
: UCS 3.2
Assigned To: Arvid Requate
Moritz Muehlenhoff
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-18 20:50 CEST by Stefan Gohmann
Modified: 2013-11-19 06:42 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2013-06-18 20:50:00 CEST
There is a race condition in the samba printers.conf handling while removing a printer. First the printers definition is removed /etc/samba/printers.conf.d/<printer> and 15 seconds later in the postrun the file /etc/samba/printers.conf is written. 

In the meanwhile smaba-tool throws an exception:

root@master501:~# samba-tool user list
ERROR(runtime): uncaught exception - Unable to load default file
  File "/usr/lib/python2.6/dist-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/samba/netcmd/user.py", line 233, in run
    lp = sambaopts.get_loadparm()
  File "/usr/lib/python2.6/dist-packages/samba/getopt.py", line 92, in get_loadparm
    self._lp.load_default()
root@master501:~#
Comment 1 Arvid Requate univentionstaff 2013-06-24 17:25:41 CEST
We might use a similar approach as for Bug #31800.
Comment 2 Tobias Peters univentionstaff 2013-07-22 16:04:02 CEST
When changing a printer, /etc/samba/printers.conf is refreshed instantly and in an atomic operation
Comment 3 Arvid Requate univentionstaff 2013-08-13 20:15:40 CEST
The patch needed to be revised, package currently builds.
Comment 4 Moritz Muehlenhoff univentionstaff 2013-08-20 08:25:59 CEST
The creation of /etc/samba/printers.conf now occurs by writing to /etc/samba/printers.conf.temp, which is then renamed to /etc/samba/printers.conf. Creation, modification and removal of printer shares was successfully tested. Changelog exists.
Comment 5 Stefan Gohmann univentionstaff 2013-11-19 06:42:04 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".