Bug 27723 - Filedescriptor für /etc/machine.secret wird in pam_univentionmailcyrus.so nicht wieder geschlossen
Filedescriptor für /etc/machine.secret wird in pam_univentionmailcyrus.so nic...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: PAM
UCS 3.0
Other Linux
: P1 critical (vote)
: UCS 3.0-1-errata
Assigned To: Sönke Schwardt-Krummrich
Felix Botner
:
Depends on:
Blocks: 27724
  Show dependency treegraph
 
Reported: 2012-06-22 13:41 CEST by Sönke Schwardt-Krummrich
Modified: 2012-11-09 16:14 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 Sönke Schwardt-Krummrich univentionstaff 2012-06-22 13:41:43 CEST
Der Filedescriptor für /etc/machine.secret wird in pam_univentionmailcyrus.so nicht wieder geschlossen, was dann im saslauthd nach einiger Zeit zu zu vielen offenen Filehandles führt und der saslauthd damit nicht mehr benutzbar ist:

   /* read password from file */
   if ((fp = fopen(pwfile, "r")) != NULL) {
     if (fgets(bindpw, 1024, fp) == NULL) {
       len = strlen(bindpw);
       if (bindpw[len-1] == '\n')
         bindpw[len-1] = '\0';
     }
   }
   return ctrl;
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2012-06-22 15:11:57 CEST
Sofern das fopen erfolgreich war und nicht NULL zurückgegeben hat, wird jetzt
ein fclose(fp) aufgerufen. Zusätzlich wird im fgets() jetzt nicht die feste
Größe 1024 sondern wie in der Variablendefinition von bindpw die Größe BUFSIZ
verwendet.

Wurde im 3.0-2 und errata3.0-1-Scope neu gebaut.
3.0-0 → libpam-univentionmailcyrus_4.0.2-1.30.201111081031_i386.deb
3.0-2 → pam-univentionmailcyrus (4.0.3-1) unstable; urgency=low
errata-3.0-1 → libpam-univentionmailcyrus_4.0.2-1.32.201206221446_i386.deb
               libpam-univentionmailcyrus_4.0.2-1.32.201206221446_amd64.deb

2012-06-22-pam-univentionmailcyrus.yaml wurde eingecheckt

Next step:
https://hutten.knut.univention.de/mediawiki/index.php/Errata-Updates#QA_-_Funktionale_QA_des_Errata-Updates
Comment 2 Felix Botner univentionstaff 2012-06-22 15:45:44 CEST
In 3.0-1 nachgestellt:

-> lsof| grep machine

-> cyradm --user felix 10.200.7.101 
-> cyradm --user felix1 10.200.7.101
-> cyradm --user felix3 10.200.7.101

-> lsof| grep machine

saslauthd 23841       root    9r      REG              253,0         8      67904 /etc/machine.secret
saslauthd 23842       root    9r      REG              253,0         8      67904 /etc/machine.secret
saslauthd 23843       root    9r      REG              253,0         8      67904 /etc/machine.secret

Mit libpam-univentionmailcyrus 4.0.2-1.32.201206221446 aus ucs_3.0-0-errata3.0-1 (i386 und amd64):

-> lsof| grep machine

-> cyradm --user felix 10.200.7.101  (Anmeldung OK)
-> cyradm --user felix1 10.200.7.101 (Anmeldung OK)
-> cyradm --user felix3 10.200.7.101 (Anmeldung OK)

-> lsof| grep machine

YAML Datei OK
Comment 3 Janek Walkenhorst univentionstaff 2012-11-09 16:14:56 CET
http://errata.univention.de/errata86.html