http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&feed=atom&action=history
Patch: MLDonkey und LDAP Authentifizierung - Versionsgeschichte
2024-03-28T22:40:55Z
Versionsgeschichte dieser Seite in NOBAQ
MediaWiki 1.35.13
http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&diff=723&oldid=prev
Niki am 2. Mai 2009 um 20:45 Uhr
2009-05-02T20:45:26Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de-AT">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 2. Mai 2009, 20:45 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l13" >Zeile 13:</td>
<td colspan="2" class="diff-lineno">Zeile 13:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Deswegen gliedert sich meine Lösung in zwei Teile, die leider nicht sehr elegant ist: Ein Teil ist ein Script das vor dem Starten von MLdonkey aufgerufen wird, alle User und Gruppen aus dem LDAP Server abfrägt und daraus eine users2.ini bzw. eine users.ini erzeugt. Der zweite Teil ist ein Patch für MLdonkey, der es erlaubt, für die Authentifizierung ein externes Programm aufzurufen. Dieses ruft dann ein Shellscript auf das wiederum ldapwhoami aufruft und dementsprechend Erfolgreich/Nicht-erfolgreich zurückliefert.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Deswegen gliedert sich meine Lösung in zwei Teile, die leider nicht sehr elegant ist: Ein Teil ist ein Script das vor dem Starten von MLdonkey aufgerufen wird, alle User und Gruppen aus dem LDAP Server abfrägt und daraus eine users2.ini bzw. eine users.ini erzeugt. Der zweite Teil ist ein Patch für MLdonkey, der es erlaubt, für die Authentifizierung ein externes Programm aufzurufen. Dieses ruft dann ein Shellscript auf das wiederum ldapwhoami aufruft und dementsprechend Erfolgreich/Nicht-erfolgreich zurückliefert.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">=</del>= Vorbereitung: der LDAP Server, das Schema <del class="diffchange diffchange-inline">=</del>=</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>= Vorbereitung: der LDAP Server, das Schema =</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Natürlich kann auch eine vorhandene Infrastruktur genommen werden, dann braucht nur das Script verändert werden, ich habe jedoch meinen LDAP-Server um Schemas für MLDonkey erweitert. Am besten erstellt man eine /etc/ldap/schema/mldonkey.schema Datei:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Natürlich kann auch eine vorhandene Infrastruktur genommen werden, dann braucht nur das Script verändert werden, ich habe jedoch meinen LDAP-Server um Schemas für MLDonkey erweitert. Am besten erstellt man eine /etc/ldap/schema/mldonkey.schema Datei:</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l56" >Zeile 56:</td>
<td colspan="2" class="diff-lineno">Zeile 56:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die ganze Datei kann hier heruntergeladen werden: [[Media:mldonkeyschema.txt]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die ganze Datei kann hier heruntergeladen werden: [[Media:mldonkeyschema.txt]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">=</del>= Das Synchronisationsscript <del class="diffchange diffchange-inline">=</del>=</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>= Das Synchronisationsscript =</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Es kann hier heruntergeladen werden: [[Media:donkey_ldappl.txt]] (Ich veröffentliche es hier unter der GNU GPL!)</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Es kann hier heruntergeladen werden: [[Media:donkey_ldappl.txt]] (Ich veröffentliche es hier unter der GNU GPL!)</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l187" >Zeile 187:</td>
<td colspan="2" class="diff-lineno">Zeile 187:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Nun fügt man den Aufruf nur mehr in das init-Script von mldonkey ein, sodass das Script jedesmal gestartet wird, wenn MLDonkey gestartet wird.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Nun fügt man den Aufruf nur mehr in das init-Script von mldonkey ein, sodass das Script jedesmal gestartet wird, wenn MLDonkey gestartet wird.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">=</del>= Der MLDonkey Patch <del class="diffchange diffchange-inline">=</del>=</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>= Der MLDonkey Patch =</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Der Patch für MLDonkey kann hier bezogen werden: [[Media:auth_cmdpatch.txt]]. Achtung, ich stelle ihn ebenfalls unter die GNU GPL!!</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Der Patch für MLDonkey kann hier bezogen werden: [[Media:auth_cmdpatch.txt]]. Achtung, ich stelle ihn ebenfalls unter die GNU GPL!!</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l295" >Zeile 295:</td>
<td colspan="2" class="diff-lineno">Zeile 295:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Feedback ist willkommen!</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Feedback ist willkommen!</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">= Kommentare =</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><comments />{{:{{TALKSPACE}}:{{PAGENAME}}}}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Kategorie:Weblog]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Kategorie:Weblog]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Kategorie:Linux]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Kategorie:Linux]]</div></td></tr>
</table>
Niki
http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&diff=359&oldid=prev
Niki am 31. Jänner 2008 um 15:41 Uhr
2008-01-31T15:41:27Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de-AT">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 31. Jänner 2008, 15:41 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l297" >Zeile 297:</td>
<td colspan="2" class="diff-lineno">Zeile 297:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Kategorie:Weblog]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Kategorie:Weblog]]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Kategorie:Linux]]</ins></div></td></tr>
</table>
Niki
http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&diff=291&oldid=prev
Niki am 31. Jänner 2008 um 13:36 Uhr
2008-01-31T13:36:17Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de-AT">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 31. Jänner 2008, 13:36 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Zeile 1:</td>
<td colspan="2" class="diff-lineno">Zeile 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><section begin="head"/></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Openldap-logo.png|left]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Openldap-logo.png|left]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Mldonkey.PNG|right]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Mldonkey.PNG|right]]</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l6" >Zeile 6:</td>
<td colspan="2" class="diff-lineno">Zeile 7:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Leider bin ich mir mit dem MLDonkey Entwickler nicht über die Implementierungsdetails einig, sodass der Patch wahrscheinlich nicht Einzug in den offiziellen CVS-Branch finden wird.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Leider bin ich mir mit dem MLDonkey Entwickler nicht über die Implementierungsdetails einig, sodass der Patch wahrscheinlich nicht Einzug in den offiziellen CVS-Branch finden wird.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Wer dennoch eine Möglichkeit sucht, MLDonkey gegen LDAP (oder auch mySQL, SQL, PAM, RADIUS, …) zu authentifizieren, dem hilft vielleicht der Patch, den ich hier beschreibe.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Wer dennoch eine Möglichkeit sucht, MLDonkey gegen LDAP (oder auch mySQL, SQL, PAM, RADIUS, …) zu authentifizieren, dem hilft vielleicht der Patch, den ich hier beschreibe.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><section end="head"/></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Ich spreche leider OCaml nicht besonders gut, weshalb mir eine ordentliche Codeänderung sehr schwer fiel. Ausserdem würde man mit einer C-Anbindung arbeiten müssen, denn OCaml selbst kann keinen LDAP Zugriff.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Ich spreche leider OCaml nicht besonders gut, weshalb mir eine ordentliche Codeänderung sehr schwer fiel. Ausserdem würde man mit einer C-Anbindung arbeiten müssen, denn OCaml selbst kann keinen LDAP Zugriff.</div></td></tr>
</table>
Niki
http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&diff=30&oldid=prev
Niki am 21. Jänner 2008 um 10:59 Uhr
2008-01-21T10:59:21Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de-AT">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 21. Jänner 2008, 10:59 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l293" >Zeile 293:</td>
<td colspan="2" class="diff-lineno">Zeile 293:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Feedback ist willkommen!</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Feedback ist willkommen!</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Kategorie:Weblog]]</ins></div></td></tr>
</table>
Niki
http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&diff=26&oldid=prev
Niki am 21. Jänner 2008 um 10:29 Uhr
2008-01-21T10:29:03Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de-AT">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 21. Jänner 2008, 10:29 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l56" >Zeile 56:</td>
<td colspan="2" class="diff-lineno">Zeile 56:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Das Synchronisationsscript ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Das Synchronisationsscript ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Es kann hier heruntergeladen werden: donkey_ldappl.txt (Ich veröffentliche es hier unter der GNU GPL!)</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Es kann hier heruntergeladen werden<ins class="diffchange diffchange-inline">: [[Media</ins>:donkey_ldappl.txt<ins class="diffchange diffchange-inline">]] </ins>(Ich veröffentliche es hier unter der GNU GPL!)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><source lang="perl"></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><source lang="perl"></div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l187" >Zeile 187:</td>
<td colspan="2" class="diff-lineno">Zeile 187:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Der MLDonkey Patch ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Der MLDonkey Patch ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Der Patch für MLDonkey kann hier bezogen werden: auth_cmdpatch.txt. Achtung, ich stelle ihn ebenfalls unter die GNU GPL!!</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Der Patch für MLDonkey kann hier bezogen werden<ins class="diffchange diffchange-inline">: [[Media</ins>:auth_cmdpatch.txt<ins class="diffchange diffchange-inline">]]</ins>. Achtung, ich stelle ihn ebenfalls unter die GNU GPL!!</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><source lang="diff"></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><source lang="diff"></div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l260" >Zeile 260:</td>
<td colspan="2" class="diff-lineno">Zeile 260:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></source></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></source></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Der Patch fügt eine neue Konfigurationsdirektive <del class="diffchange diffchange-inline">“auth_cmd” </del>an. Setzt man diese auf ein externes Script, so wird Usernamen und Passwort als Environmentvariable übergeben (Parameter wären usicher). Das Script kann nun die Berechtigung überprüfungen und gibt den Status anhand des return-Codes zurück. 0 bedeutet: Die Authentifikation ist sofort erfolgreich, aber nur wenn der Benutzer in MLdonkey existiert. 1: Die Authentifikation schlägt sofort fehl. 2: MLDonkey soll zusätzlich wie gewöhnlich das Passwort überprüfen. Nähere Details im Sourcecode.</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Der Patch fügt eine neue Konfigurationsdirektive <ins class="diffchange diffchange-inline">"auth_cmd" </ins>an. Setzt man diese auf ein externes Script, so wird Usernamen und Passwort als Environmentvariable übergeben (Parameter wären usicher). Das Script kann nun die Berechtigung überprüfungen und gibt den Status anhand des return-Codes zurück. 0 bedeutet: Die Authentifikation ist sofort erfolgreich, aber nur wenn der Benutzer in MLdonkey existiert. 1: Die Authentifikation schlägt sofort fehl. 2: MLDonkey soll zusätzlich wie gewöhnlich das Passwort überprüfen. Nähere Details im Sourcecode.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Nun fehlt nur mehr das Authentifikationsscript (bei mir: auth_ldap.sh). Da ich den Esel in eine chroot-Umgebung eingesperrt habe, habe ich ein statisches busybox erstellt:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Nun fehlt nur mehr das Authentifikationsscript (bei mir: auth_ldap.sh). Da ich den Esel in eine chroot-Umgebung eingesperrt habe, habe ich ein statisches busybox erstellt:</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l286" >Zeile 286:</td>
<td colspan="2" class="diff-lineno">Zeile 286:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Man sieht, dass der Administrator immer über MLDonkey authentifiziert wird (aus Sicherheitsgründen).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Man sieht, dass der Administrator immer über MLDonkey authentifiziert wird (aus Sicherheitsgründen).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Nun muss nur noch ldapwhoami in das chroot kopiert werden und mit ihm alle benötigten Bibliotheken. Diese findet man mit dem Programm <del class="diffchange diffchange-inline">“ldd”</del>.</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Nun muss nur noch ldapwhoami in das chroot kopiert werden und mit ihm alle benötigten Bibliotheken. Diese findet man mit dem Programm <ins class="diffchange diffchange-inline">"ldd"</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Nun sollte MLDonkey (nicht elegant aber doch) gegen den LDAP Server authentifizieren. Diese Konstellation läuft bei uns nun seit ein paar Monaten problemlos.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Nun sollte MLDonkey (nicht elegant aber doch) gegen den LDAP Server authentifizieren. Diese Konstellation läuft bei uns nun seit ein paar Monaten problemlos.</div></td></tr>
</table>
Niki
http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&diff=24&oldid=prev
Niki am 21. Jänner 2008 um 10:25 Uhr
2008-01-21T10:25:33Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de-AT">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 21. Jänner 2008, 10:25 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l52" >Zeile 52:</td>
<td colspan="2" class="diff-lineno">Zeile 52:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></source></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></source></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Die ganze Datei kann hier heruntergeladen werden: mldonkeyschema.txt</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Die ganze Datei kann hier heruntergeladen werden<ins class="diffchange diffchange-inline">: [[Media</ins>:mldonkeyschema.txt<ins class="diffchange diffchange-inline">]]</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Das Synchronisationsscript ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Das Synchronisationsscript ==</div></td></tr>
</table>
Niki
http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&diff=23&oldid=prev
Niki am 21. Jänner 2008 um 10:25 Uhr
2008-01-21T10:25:06Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de-AT">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 21. Jänner 2008, 10:25 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Zeile 1:</td>
<td colspan="2" class="diff-lineno">Zeile 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Openldap-logo.png|<del class="diffchange diffchange-inline">thumb</del>]]</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Openldap-logo.png|<ins class="diffchange diffchange-inline">left</ins>]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Mldonkey.PNG|<del class="diffchange diffchange-inline">thumb</del>]]</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Mldonkey.PNG|<ins class="diffchange diffchange-inline">right</ins>]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Seit kurzem hat MLDonkey ein User- und Gruppensystem, wobei man Downloads Gruppen und Benutzer zuordnen kann die dann auch nur von diesen gesehen werden. Da in unserem WLAN (stiftingtal.net) bereits ein LDAP-Server mit allen Usern existiert wäre es nett, wenn auch MLDonkey gegen diesen LDAP Server authentifizieren könnte.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Seit kurzem hat MLDonkey ein User- und Gruppensystem, wobei man Downloads Gruppen und Benutzer zuordnen kann die dann auch nur von diesen gesehen werden. Da in unserem WLAN (stiftingtal.net) bereits ein LDAP-Server mit allen Usern existiert wäre es nett, wenn auch MLDonkey gegen diesen LDAP Server authentifizieren könnte.</div></td></tr>
</table>
Niki
http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&diff=22&oldid=prev
Niki am 21. Jänner 2008 um 10:22 Uhr
2008-01-21T10:22:44Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de-AT">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 21. Jänner 2008, 10:22 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Zeile 1:</td>
<td colspan="2" class="diff-lineno">Zeile 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Openldap-logo.png]]</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Openldap-logo.png<ins class="diffchange diffchange-inline">|thumb</ins>]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Mldonkey.PNG]]</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Bild:Mldonkey.PNG<ins class="diffchange diffchange-inline">|thumb</ins>]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Seit kurzem hat MLDonkey ein User- und Gruppensystem, wobei man Downloads Gruppen und Benutzer zuordnen kann die dann auch nur von diesen gesehen werden. Da in unserem WLAN (stiftingtal.net) bereits ein LDAP-Server mit allen Usern existiert wäre es nett, wenn auch MLDonkey gegen diesen LDAP Server authentifizieren könnte.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Seit kurzem hat MLDonkey ein User- und Gruppensystem, wobei man Downloads Gruppen und Benutzer zuordnen kann die dann auch nur von diesen gesehen werden. Da in unserem WLAN (stiftingtal.net) bereits ein LDAP-Server mit allen Usern existiert wäre es nett, wenn auch MLDonkey gegen diesen LDAP Server authentifizieren könnte.</div></td></tr>
</table>
Niki
http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&diff=21&oldid=prev
Niki am 21. Jänner 2008 um 10:22 Uhr
2008-01-21T10:22:27Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de-AT">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 21. Jänner 2008, 10:22 Uhr</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Zeile 1:</td>
<td colspan="2" class="diff-lineno">Zeile 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Bild:Openldap-logo.png]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Bild:Mldonkey.PNG]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Seit kurzem hat MLDonkey ein User- und Gruppensystem, wobei man Downloads Gruppen und Benutzer zuordnen kann die dann auch nur von diesen gesehen werden. Da in unserem WLAN (stiftingtal.net) bereits ein LDAP-Server mit allen Usern existiert wäre es nett, wenn auch MLDonkey gegen diesen LDAP Server authentifizieren könnte.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Seit kurzem hat MLDonkey ein User- und Gruppensystem, wobei man Downloads Gruppen und Benutzer zuordnen kann die dann auch nur von diesen gesehen werden. Da in unserem WLAN (stiftingtal.net) bereits ein LDAP-Server mit allen Usern existiert wäre es nett, wenn auch MLDonkey gegen diesen LDAP Server authentifizieren könnte.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Nachdem ich bis jetzt keine Lösung dafür gefunden habe, habe ich vor einiger Zeit einen Patch geschrieben, der es über einen Umweg erlaubt, MLdonkey gegen LDAP zu authentifizieren: Ein Script das bei der Authentifizierung aufgerufen wird.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Nachdem ich bis jetzt keine Lösung dafür gefunden habe, habe ich vor einiger Zeit einen Patch geschrieben, der es über einen Umweg erlaubt, MLdonkey gegen LDAP zu authentifizieren: Ein Script das bei der Authentifizierung aufgerufen wird.</div></td></tr>
</table>
Niki
http://niki.hammler.net/w/index.php?title=Patch:_MLDonkey_und_LDAP_Authentifizierung&diff=18&oldid=prev
Niki: Die Seite wurde neu angelegt: Seit kurzem hat MLDonkey ein User- und Gruppensystem, wobei man Downloads Gruppen und Benutzer zuordnen kann die dann auch nur von diesen gesehen werden. Da in unserem ...
2007-06-23T10:19:38Z
<p>Die Seite wurde neu angelegt: Seit kurzem hat MLDonkey ein User- und Gruppensystem, wobei man Downloads Gruppen und Benutzer zuordnen kann die dann auch nur von diesen gesehen werden. Da in unserem ...</p>
<p><b>Neue Seite</b></p><div>Seit kurzem hat MLDonkey ein User- und Gruppensystem, wobei man Downloads Gruppen und Benutzer zuordnen kann die dann auch nur von diesen gesehen werden. Da in unserem WLAN (stiftingtal.net) bereits ein LDAP-Server mit allen Usern existiert wäre es nett, wenn auch MLDonkey gegen diesen LDAP Server authentifizieren könnte.<br />
Nachdem ich bis jetzt keine Lösung dafür gefunden habe, habe ich vor einiger Zeit einen Patch geschrieben, der es über einen Umweg erlaubt, MLdonkey gegen LDAP zu authentifizieren: Ein Script das bei der Authentifizierung aufgerufen wird.<br />
Leider bin ich mir mit dem MLDonkey Entwickler nicht über die Implementierungsdetails einig, sodass der Patch wahrscheinlich nicht Einzug in den offiziellen CVS-Branch finden wird.<br />
Wer dennoch eine Möglichkeit sucht, MLDonkey gegen LDAP (oder auch mySQL, SQL, PAM, RADIUS, …) zu authentifizieren, dem hilft vielleicht der Patch, den ich hier beschreibe.<br />
<br />
Ich spreche leider OCaml nicht besonders gut, weshalb mir eine ordentliche Codeänderung sehr schwer fiel. Ausserdem würde man mit einer C-Anbindung arbeiten müssen, denn OCaml selbst kann keinen LDAP Zugriff.<br />
<br />
Deswegen gliedert sich meine Lösung in zwei Teile, die leider nicht sehr elegant ist: Ein Teil ist ein Script das vor dem Starten von MLdonkey aufgerufen wird, alle User und Gruppen aus dem LDAP Server abfrägt und daraus eine users2.ini bzw. eine users.ini erzeugt. Der zweite Teil ist ein Patch für MLdonkey, der es erlaubt, für die Authentifizierung ein externes Programm aufzurufen. Dieses ruft dann ein Shellscript auf das wiederum ldapwhoami aufruft und dementsprechend Erfolgreich/Nicht-erfolgreich zurückliefert.<br />
<br />
== Vorbereitung: der LDAP Server, das Schema ==<br />
<br />
Natürlich kann auch eine vorhandene Infrastruktur genommen werden, dann braucht nur das Script verändert werden, ich habe jedoch meinen LDAP-Server um Schemas für MLDonkey erweitert. Am besten erstellt man eine /etc/ldap/schema/mldonkey.schema Datei:<br />
<br />
<source lang="mysql"><br />
##########################<br />
##<br />
## MLdonkey<br />
##<br />
##########################<br />
<br />
attributetype ( 1.1.2.1.1 NAME 'donkeyCommit'<br />
DESC 'Commit-Directory fuer MLdonkey'<br />
EQUALITY caseExactIA5Match<br />
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )<br />
<br />
attributetype ( 1.1.2.1.2 NAME 'donkeyPrimaryGroup'<br />
DESC 'Standardgruppe fuer MLdonkey'<br />
EQUALITY caseExactIA5Match<br />
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )<br />
<br />
attributetype ( 1.1.2.1.3 NAME 'donkeyOtherGroups'<br />
DESC 'Benutzergruppen fuer MLdonkey'<br />
EQUALITY caseExactIA5Match<br />
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} )<br />
<br />
attributetype ( 1.1.2.1.4 NAME 'donkeyGroupAdmin'<br />
DESC 'Ist diese Gruppe eine Administratorgruppe'<br />
EQUALITY caseExactIA5Match<br />
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )<br />
<br />
objectclass ( 1.1.2.2.2 NAME 'stiftingtalDonkey' SUP top AUXILIARY<br />
DESC 'Benutzer die MLdonkey verwenden duerfen'<br />
MUST ( uid $ donkeyPrimaryGroup $ userPassword )<br />
MAY ( donkeyOtherGroups $ donkeyCommit ) )<br />
<br />
objectClass ( 1.1.2.2.5 NAME 'stiftingtalDonkeyGroup' SUP top STRUCTURAL<br />
DESC 'Gruppen fuer MLdonkey'<br />
MUST ( donkeyGroupAdmin ) )<br />
</source><br />
<br />
Die ganze Datei kann hier heruntergeladen werden: mldonkeyschema.txt<br />
<br />
== Das Synchronisationsscript ==<br />
<br />
Es kann hier heruntergeladen werden: donkey_ldappl.txt (Ich veröffentliche es hier unter der GNU GPL!)<br />
<br />
<source lang="perl"><br />
#!/usr/bin/perl<br />
<br />
# (c) 2007 by Nikolaus Hammler <niki.hammler@nobaq.net><br />
# Please note that this piece of code is licensed under the GNU GPL!!<br />
<br />
use Net::LDAPS;<br />
use strict;<br />
<br />
my $USERS_INI = "/home/donkey/root/.mldonkey/users.ini";<br />
<br />
my $ADMIN_PASS = '(MD4-crypted secret for admin user)';<br />
<br />
my $LDAP_SERVER = "ianus.intern.stiftingtal.net";<br />
my $BINDDN = "uid=reader,dc=intern,dc=stiftingtal,dc=net";<br />
my $BINDPW = "secret";<br />
<br />
my $ldap = Net::LDAPS->new($LDAP_SERVER) or die "$@";<br />
<br />
my $mesg = $ldap->bind($BINDDN, password => $BINDPW, version => 3) or die "$@";<br />
<br />
$mesg->code && die $mesg->error;<br />
<br />
$mesg = $ldap->search(base => "ou=users,dc=intern,dc=stiftingtal,dc=net", scope => "one", filter => "(objectClass=stiftingtalDonkey)", attrs => ['uid', 'mail', 'donkeyPrimaryGroup', 'donkeyOtherGroups', 'donkeyCommit', 'donkeyCommit']);<br />
<br />
$mesg->code && die $mesg->error;<br />
<br />
<br />
my @entries = $mesg->entries;<br />
<br />
my $users = " (admin, \"$ADMIN_PASS\");";<br />
<br />
my $users2 = "";<br />
<br />
my @groups = ();<br />
<br />
<br />
foreach my $entr (@entries)<br />
{<br />
my $uid = $entr->get_value('uid');<br />
my $mail = $entr->get_value('mail');<br />
my $dgroup = $entr->get_value('donkeyPrimaryGroup');<br />
my $commit = $entr->get_value('donkeyCommit');<br />
<br />
my $othergroups = "";<br />
foreach ($entr->get_value('donkeyOtherGroups'))<br />
{<br />
$othergroups .= "\n $_;";<br />
push(@groups, $_);<br />
}<br />
<br />
if(!$commit)<br />
{<br />
$commit = $uid;<br />
}<br />
<br />
push(@groups, $dgroup); <br />
<br />
$users .= "\n ($uid, \"11111111111111111111111111111111\");";<br />
<br />
$users2 .= "\n";<br />
$users2 .= " { user_name = $uid\n";<br />
#$users2 .= " user_pass = \"00000000000000000000000000000000\"\n";<br />
$users2 .= " user_pass = \"11111111111111111111111111111111\"\n";<br />
$users2 .= " user_groups = [\n";<br />
$users2 .= " $dgroup;";<br />
$users2 .= $othergroups;<br />
$users2 .= "]\n";<br />
$users2 .= " user_default_group = $dgroup\n";<br />
$users2 .= " user_mail = \"$mail\"\n";<br />
$users2 .= " user_commit_dir = $commit\n";<br />
$users2 .= " user_max_concurrent_downloads = 0\n";<br />
$users2 .= "};";<br />
}<br />
<br />
system("savelog -m 600 -c 30 $USERS_INI");<br />
open(USERS, ">$USERS_INI") || die("Could not write to $USERS_INI");<br />
<br />
print USERS "\n groups = [\n";<br />
print USERS " { group_name = mldonkey\n";<br />
print USERS " group_admin = true\n";<br />
print USERS "};";<br />
my %temp;<br />
@temp{@groups} = ();<br />
foreach my $group (keys %temp)<br />
{<br />
print USERS "\n";<br />
print USERS " { group_name = $group\n";<br />
<br />
## URGS!<br />
if($group eq "admins")<br />
{<br />
print USERS " group_admin = true\n";<br />
}<br />
else<br />
{<br />
print USERS " group_admin = false\n";<br />
}<br />
print USERS "};";<br />
}<br />
print USERS "]\n\n\n";<br />
<br />
<br />
print USERS " users2 = [\n";<br />
print USERS " { user_name = admin\n";<br />
print USERS " user_pass = \"$ADMIN_PASS\"\n";<br />
print USERS " user_groups = [\n";<br />
print USERS " mldonkey;]\n";<br />
print USERS " user_default_group = mldonkey\n";<br />
print USERS " user_mail = \"\"\n";<br />
print USERS " user_commit_dir = \"\"\n";<br />
print USERS " user_max_concurrent_downloads = 0\n";<br />
print USERS "};";<br />
print USERS $users2;<br />
print USERS "]\n\n\n";<br />
<br />
print USERS " users = [\n$users]\n\n\n";<br />
close(USERS);<br />
<br />
system("chown donkey.donkey $USERS_INI");<br />
system("chmod 600 $USERS_INI");<br />
</source><br />
<br />
Das Perl-Script verbindet sich zum LDAP Server und schreibt die users.ini aus den Daten des LDAP Servers. Das Script muss vermutlich an die jeweiligen Gegebenheiten angepasst werden. ACHTUNG! MLDonkey ist ist sehr störrisch wenn Kleinigkeiten in der ini-Datei nicht passen!<br />
<br />
Nun fügt man den Aufruf nur mehr in das init-Script von mldonkey ein, sodass das Script jedesmal gestartet wird, wenn MLDonkey gestartet wird.<br />
<br />
== Der MLDonkey Patch ==<br />
<br />
Der Patch für MLDonkey kann hier bezogen werden: auth_cmdpatch.txt. Achtung, ich stelle ihn ebenfalls unter die GNU GPL!!<br />
<br />
<source lang="diff"><br />
diff -urN mldonkey/src/daemon/common/commonOptions.ml mldonkey_with_authpatch/src/daemon/common/commonOptions.ml<br />
--- mldonkey/src/daemon/common/commonOptions.ml 2007-04-23 00:31:53.000000000 +0200<br />
+++ mldonkey_with_authpatch/src/daemon/common/commonOptions.ml 2007-04-26 18:56:37.000000000 +0200<br />
@@ -1363,7 +1358,26 @@<br />
"Regexp of comments to filter out, example: string1|string2|string3"<br />
string_option "http://|https://|www\\."<br />
<br />
+let auth_cmd = define_option current_section ["auth_cmd"]<br />
+ "A command that is called when authorizing a user (i.e. on startup and<br />
+ on auth command. The following environment variables are set:<br />
+ $USERNAME - the username<br />
+ $PASSWORD - the users password<br />
+ <br />
+ The command should return a value indicating if the authentication<br />
+ is successful:<br />
+ 0 - The authentication is immidiately accepted IF the user exists<br />
+ 1 - The authentication is immidiately rejected<br />
+ 2 - An addition check against the MD4 has is performed.<br />
+ <br />
+ If the user does not exist in the internal database, the authentication<br />
+ will fail, also when the program returns 0.<br />
+ <br />
+ If this value is not set, a normal authentication against the internal<br />
+ database is performed.<br />
+ If this option is set and there is an error running the command the<br />
+ authentication will fail."<br />
+ string_option ""<br />
<br />
<br />
(*************************************************************************)<br />
diff -urN mldonkey/src/daemon/common/commonUserDb.ml mldonkey_with_authpatch/src/daemon/common/commonUserDb.ml<br />
--- mldonkey/src/daemon/common/commonUserDb.ml 2006-11-09 22:32:26.000000000 +0100<br />
+++ mldonkey_with_authpatch/src/daemon/common/commonUserDb.ml 2007-04-26 19:04:41.177275304 +0200<br />
@@ -313,9 +313,32 @@<br />
let user2_user_set_password user pass_string =<br />
user.user_pass <- Md4.string pass_string<br />
<br />
-let valid_password user pass =<br />
+let valid_password user pass = <br />
try<br />
- user2_user_password user = Md4.string pass<br />
+ if !!auth_cmd <> "" && user2_user_exists user<br />
+ then<br />
+ try<br />
+ let pid = Unix.create_process_env !!auth_cmd<br />
+ [|""|]<br />
+ (Array.of_list (Printf.sprintf "USERNAME=%s" user :: Printf.sprintf "PASSWORD=%s" pass :: []))<br />
+ Unix.stdin Unix.stdout Unix.stderr in<br />
+<br />
+ let _pid, status = Unix.waitpid [] pid in<br />
+ match status with<br />
+ | Unix.WEXITED exitcode -> <br />
+ (match exitcode with<br />
+ | 0 -> true<br />
+ | 1 -> false<br />
+ | _ -> user2_user_password user = Md4.string pass<br />
+ )<br />
+ | Unix.WSIGNALED signal -> false<br />
+ | Unix.WSTOPPED signal -> false<br />
+ with Unix.Unix_error (code, f, arg) -> false<br />
+ (*<br />
+ Printf.sprintf "%s failed%s: %s" f (if arg = "" then "" else " on " ^ arg) (Unix.error_message code)<br />
+ *)<br />
+ else<br />
+ user2_user_password user = Md4.string pass<br />
with Not_found -> false<br />
<br />
let has_empty_password user =<br />
</source><br />
<br />
Der Patch fügt eine neue Konfigurationsdirektive “auth_cmd” an. Setzt man diese auf ein externes Script, so wird Usernamen und Passwort als Environmentvariable übergeben (Parameter wären usicher). Das Script kann nun die Berechtigung überprüfungen und gibt den Status anhand des return-Codes zurück. 0 bedeutet: Die Authentifikation ist sofort erfolgreich, aber nur wenn der Benutzer in MLdonkey existiert. 1: Die Authentifikation schlägt sofort fehl. 2: MLDonkey soll zusätzlich wie gewöhnlich das Passwort überprüfen. Nähere Details im Sourcecode.<br />
<br />
Nun fehlt nur mehr das Authentifikationsscript (bei mir: auth_ldap.sh). Da ich den Esel in eine chroot-Umgebung eingesperrt habe, habe ich ein statisches busybox erstellt:<br />
<br />
<source lang="bash"><br />
#!/bin/busybox sh<br />
LDAP_HOST="ianus.intern.stiftingtal.net"<br />
echo -n "Authenticating user $USERNAME..."<br />
if [ "$USERNAME" = "admin" ]<br />
then<br />
echo "passing to MLdonkey"<br />
exit 2<br />
fi<br />
echo /bin/ldapwhoami -ZZ -x -h $LDAP_HOST -D "uid=$USERNAME,ou=users,dc=intern,dc=stiftingtal,dc=net" -w "$PASSWORD"<br />
if /bin/ldapwhoami -ZZ -x -h $LDAP_HOST -D "uid=$USERNAME,ou=users,dc=intern,dc=stiftingtal,dc=net" -w "$PASSWORD"<br />
then<br />
echo "successful!"<br />
exit 0<br />
fi<br />
echo "failed"<br />
exit 1<br />
</source><br />
<br />
<br />
Man sieht, dass der Administrator immer über MLDonkey authentifiziert wird (aus Sicherheitsgründen).<br />
<br />
Nun muss nur noch ldapwhoami in das chroot kopiert werden und mit ihm alle benötigten Bibliotheken. Diese findet man mit dem Programm “ldd”.<br />
<br />
Nun sollte MLDonkey (nicht elegant aber doch) gegen den LDAP Server authentifizieren. Diese Konstellation läuft bei uns nun seit ein paar Monaten problemlos.<br />
<br />
Natürlich kann man den Patch wie oben gesagt auch verwenden um gegen RADIUS, mySQL, PAM, Kerberos und Co zu authentifizieren!<br />
<br />
Feedback ist willkommen!</div>
Niki