Bug 31539 - Removal of user logon script fails
Removal of user logon script fails
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Listener modules
UCS@school 3.1
Other Linux
: P3 minor (vote)
: UCS@school 3.2 R2 Errata
Assigned To: Sönke Schwardt-Krummrich
Florian Best
:
: 35082 (view as bug list)
Depends on:
Blocks: 35168
  Show dependency treegraph
 
Reported: 2013-05-28 14:23 CEST by Sönke Schwardt-Krummrich
Modified: 2014-08-27 17:01 CEST (History)
4 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 Sönke Schwardt-Krummrich univentionstaff 2013-05-28 14:23:31 CEST
24.05.13 15:06:30.210  LISTENER    ( WARN    ) : not removing home of user exam-anton57: /home/exam-anton57 is not a directory
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/ucs-school-user-logonscript.py", line 483, in handler
    userchange(dn, new, old)
  File "/usr/lib/univention-directory-listener/system/ucs-school-user-logonscript.py", line 473, in userchange
    os.remove("%s/%s.vbs" % (path, old['uid'][0]))
OSError: [Errno 13] Permission denied: '/var/lib/samba/netlogon/user/exam-anton57.vbs'


The code around 
     os.remove("%s/%s.vbs" % (path, old['uid'][0]))
does not use listener.setuid(0) which is why the removal fails.

This should have no impact on recreated users since the listener module always overwrites existing scripts.
Comment 1 Jan Christoph Ebersbach univentionstaff 2014-02-18 12:07:42 CET
This issue was reported by a customer.  It would be nice if the old scripts were removed to improve the overview.
Comment 2 Tim Petersen univentionstaff 2014-04-23 08:34:53 CEST
Again reported 2014041721010635
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2014-06-10 11:44:29 CEST
*** Bug 35082 has been marked as a duplicate of this bug. ***
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2014-08-15 17:50:38 CEST
The related code path is now enclosed with a
listener.setuid(0)-try-finally-listener.unsetuid() block.

ucs-school-netlogon-user-logonscripts (10.0.3-1) unstable; urgency=low
Comment 5 Florian Best univentionstaff 2014-08-20 09:12:33 CEST
Changelog missing.

Fix: OK, user removal no longer raises the exception.
Code review: OK
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2014-08-20 09:44:12 CEST
(In reply to Florian Best from comment #5)
> Changelog missing.
→ FIXED
Comment 7 Florian Best univentionstaff 2014-08-20 09:48:24 CEST
OK
Comment 8 Sönke Schwardt-Krummrich univentionstaff 2014-08-27 17:01:44 CEST
UCS@school 3.2 R2 v2 has been released:
http://docs.univention.de/release-notes-ucsschool-3.2R2v2-de.html

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