Bug 27729 - Offener Filedeskriptor für Passwort-Datei
Offener Filedeskriptor für Passwort-Datei
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 3.0
Other Linux
: P5 minor (vote)
: UCS 3.1
Assigned To: Philipp Hahn
Stefan Gohmann
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-22 23:15 CEST by Sönke Schwardt-Krummrich
Modified: 2012-12-12 21:08 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): Cleanup
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
Close file descriptor (1.08 KB, patch)
2012-06-25 08:22 CEST, Philipp Hahn
Details | Diff
[v2] Close file descriptor (1.06 KB, patch)
2012-06-25 09:30 CEST, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2012-06-22 23:15:47 CEST
In univention-directory-listener/src/main.c 
static char* read_pwd_from_file(char *filename)
wird der file descriptor für die Passwort-Datei nicht wieder geschlossen, nachdem das Passwort eingelesen wurde. Da das PW nur 1x eingelesen wird, sind die Auswirkungen nur klein.
Comment 1 Philipp Hahn univentionstaff 2012-06-25 08:22:14 CEST
Created attachment 4475 [details]
Close file descriptor

The listener kept a file descriptor open to the password file, which leaks resources.

Close the file after reading the machine secret.
Also better handle empty files and read errors.
Comment 2 Philipp Hahn univentionstaff 2012-06-25 08:24:24 CEST
git --git-dir=/home/phahn/GIT/.git log -22 -p ucs-3.0/listener
Comment 3 Philipp Hahn univentionstaff 2012-06-25 09:30:57 CEST
Created attachment 4476 [details]
[v2] Close file descriptor

Fix patch which always returned NULL.
Comment 4 Philipp Hahn univentionstaff 2012-08-03 23:34:25 CEST
Patch wurde eingespielt.
svnr34620, univention-directory-listener_7.0.0-1.154.201208032330
Comment 5 Stefan Gohmann univentionstaff 2012-09-11 09:22:40 CEST
Der Patch aus 3.0 wurde wieder entfernt.

Auf einem UCS 3.0-2:
# lsof | grep -i secret | grep ^univen
univentio 22773   listener    3r      REG      254,2         6     700488 /etc/ldap.secret

Auf einem UCS 3.1 ist das nicht mehr zu sehen.

Replikation funktioniert.

Changelog: OK
Comment 6 Stefan Gohmann univentionstaff 2012-12-12 21:08:41 CET
UCS 3.1-0 has been released: 
 http://forum.univention.de/viewtopic.php?f=54&t=2125

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