Bug 19978 - Bind-Passwort aus einer Datei lesen
Bind-Passwort aus einer Datei lesen
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - CLI
UCS 2.4
Other Linux
: P5 enhancement (vote)
: UCS 3.1
Assigned To: Lukas Walter
Stefan Gohmann
: interim-2
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-14 14:42 CEST by Janis Meybohm
Modified: 2012-12-12 21:07 CET (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
add --bindpwdfile which read password from file (4.10 KB, patch)
2011-07-01 10:41 CEST, Martin Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Meybohm univentionstaff 2010-09-14 14:42:34 CEST
2010091010028256

Eine solche Option (--bindpwfile) für dem UDM-Cli wäre schön.

-> Passwörter die in der commandline history gespeichert werden sind 
nicht schön

-> während dem der udm befehl läuft, ist das Passwort öffentlich (ps 
ax) sichtbar

-> wenn der udm Befehl aus einem Skript ausgeführt werden soll, ist es 
immer unnötig aufwändig (und immer derselbe Code), wenn das Passwort 
zuerst abgefragt werden muss.
Comment 1 Martin Müller 2011-07-01 10:41:08 CEST
Created attachment 3374 [details]
add --bindpwdfile which read password from file
Comment 2 Stefan Gohmann univentionstaff 2012-07-17 17:09:31 CEST
UCS 3.1 will be the next release.
Comment 3 Lukas Walter univentionstaff 2012-09-03 12:21:23 CEST
Option "--bindpwdfile" wurde hinzugefügt.


univention-directory-manager-modules (8.0.14-1) unstable; urgency=low

  * added cli option for reading bindpwd from file (Bug #19978)


svn35143
Comment 4 Arvid Requate univentionstaff 2012-09-04 19:04:37 CEST
univention-join bricht zur Zeit mit einem Traceback ab, ich nehme an dass das mnit dieser Änderung zusammenhängt?

==============================================================================
root@slave12:~# univention-join 
univention-join: joins a computer to an ucs domain
copyright (c) 2001-2012 Univention GmbH, Germany

Enter DC Master Account : Administrator
Enter DC Master Password: 

Search DC Master:                                          done
Check DC Master:                                           done
Stop LDAP Server:                                          done
Stop Samba 4 Server:                                       done
Search ldap/base                                           done
Start LDAP Server:                                         done
Search LDAP binddn                                         done
Sync time                                                  done
Join Computer Account: 

**************************************************************************
* Join failed!                                                           *
* Contact your system administrator                                      *
**************************************************************************
* Message:  failed to create DC Slave (1) [option --bindpw not a unique prefix]
**************************************************************************
==============================================================================

Wenn man sich das Anschaut, dann scheint der univention-server-join eine falsche Option an udm zu übergeben (warum auch immer das früher funktioniert hat)...

root@master10:~# /usr/share/univention-join/univention-server-join -bindpwfile /tmp/123 -binddn uid=Administrator,cn=users,dc=arucs3i8,dc=qa -ip 10.200.8.12 -netmask 255.255.255.0 -mac 52:54:00:e6:aa:27 -role domaincontroller_slave -hostname slave12 -domainname arucs3i8.qa
univention-server-join: joins a server to an univention domain
copyright (c) 2001-2012 Univention GmbH, Germany

E: failed to create DC Slave (1) [option --bindpw not a unique prefix]


root@master10:~# univention-directory-manager computers/domaincontroller_slave create --position cn=dc,cn=computers,dc=arucs3i8,dc=qa --set name=slave12 --set domain=arucs3i8.qa --set password=6WFYG1TB --set unixhome=/dev/null --set shell=/bin/sh --set 'primaryGroup=cn=DC Slave Hosts,cn=groups,dc=arucs3i8,dc=qa' --set ip=10.200.8.12 --set mac=52:54:00:e6:aa:27 --binddn uid=Administrator,cn=users,dc=arucs3i8,dc=qa --bindpw univention
option --bindpw not a unique prefix



Wenn man das behoben hat, bekommt man als nächtes den folgenden traceback beim joinen (wenn man univention-join um set -x erweitert):


Join result = [univention-server-join: joins a server to an univention domain
copyright (c) 2001-2012 Univention GmbH, Germany

E: failed to create DC Slave (1) [Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 233, in doit
    output = univention.admincli.admin.doit(arglist)
  File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 388, in doit
    out=_doit(arglist)
  File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 550, in _doit
    fp = open('\''/var/debug2.txt'\'', '\''w'\'')
IOError: [Errno 13] Permission denied: '\''/var/debug2.txt'\''
Comment 5 Lukas Walter univentionstaff 2012-09-05 09:56:10 CEST
Der vergessene Debugcode wurde entfernt.

univention-directory-manager-modules (8.0.18-1) unstable; urgency=low

  * removed obsolete debug code (Bug #19978)


Der Fehler im Joinvorgang kommt tatsächlich dadurch zu Stande, dass das univention-server-join script "--bindpw" statt "--bindpwd" an einen UDM übergibt (Die verwendete Schreibweise ist bereits seit r78 "--bindpwd"). Das ist im Zuge von Bug #19430 enstanden und wird unter dem Bug wieder behoben.
Comment 6 Philipp Hahn univentionstaff 2012-09-05 11:27:52 CEST
(In reply to comment #4)
> Wenn man sich das Anschaut, dann scheint der univention-server-join eine
> falsche Option an udm zu übergeben (warum auch immer das früher funktioniert
> hat)...

univention-server-join benutzt nur "-bindpw" (ohne 'd').
Bei Long-Options ist es üblich, daß man die Options nicht vollständig ausschreiben muß, sondern es genügt soviel von der Option anzugeben, bis die Option eindeutig ist.
<http://docs.python.org/library/getopt.html#getopt.getopt>
> Long options on the command line can be recognized so long as they provide a prefix of the option name that matches exactly one of the accepted options.

Da nun --bindpwfile hinzugefügt wurde, ist --bindpw nicht länger eindeutig, was ja auch in der Fehlermeldung steht:

> E: failed to create DC Slave (1) [option --bindpw not a unique prefix]

univention-server-join wurde angepasst.
In univention-directory-manager-modules wurden mehrere -bindpw durch -bindpwd in Fehlermeldungen ersetzt.

svn35240
univention-directory-manager-modules_8.0.19-1.875.201209051125
univention-join_5.0.4-1.382.201209051121

ChangeLog: ±0
Comment 7 Stefan Gohmann univentionstaff 2012-10-19 08:07:35 CEST
Das funktioniert.

Changelog leicht angepasst.
Comment 8 Stefan Gohmann univentionstaff 2012-12-12 21:07:42 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".