summaryrefslogtreecommitdiffstats
path: root/ipa-admintools/ipa-finduser
diff options
context:
space:
mode:
authorrcritten@redhat.com <rcritten@redhat.com>2007-08-06 10:05:53 -0400
committerrcritten@redhat.com <rcritten@redhat.com>2007-08-06 10:05:53 -0400
commit993f76fe6035cf59cceb88f3611fc53680738007 (patch)
tree17bb5afed002709bd322f5fe7e99e473adc1d018 /ipa-admintools/ipa-finduser
parent66ab69d0b23da46b21dbb4bf165011f318ec2da8 (diff)
downloadfreeipa-993f76fe6035cf59cceb88f3611fc53680738007.tar.gz
freeipa-993f76fe6035cf59cceb88f3611fc53680738007.tar.xz
freeipa-993f76fe6035cf59cceb88f3611fc53680738007.zip
- Abstracted client class to work directly or over RPC
- Add mod_auth_kerb and cyrus-sasl-gssapi to Requires - Remove references to admin server in ipa-server-setupssl - Generate a client certificate for the XML-RPC server to connect to LDAP with - Create a keytab for Apache - Create an ldif with a test user - Provide a certmap.conf for doing SSL client authentication - Update tools to use kerberos - Add User class
Diffstat (limited to 'ipa-admintools/ipa-finduser')
-rw-r--r--ipa-admintools/ipa-finduser30
1 files changed, 20 insertions, 10 deletions
diff --git a/ipa-admintools/ipa-finduser b/ipa-admintools/ipa-finduser
index 0892791c4..a54e141e7 100644
--- a/ipa-admintools/ipa-finduser
+++ b/ipa-admintools/ipa-finduser
@@ -20,13 +20,12 @@
import sys
from optparse import OptionParser
-import ipa
-import ipa.rpcclient
+import ipa.ipaclient as ipaclient
import ipa.config
-import base64
import sys
import xmlrpclib
+import kerberos
def usage():
print "ipa-finduser <uid>"
@@ -48,16 +47,27 @@ def main():
usage()
try:
- ent = ipa.rpcclient.get_user(args[1])
- for name, value in ent.items():
- if isinstance(value, str):
- print name + ": " + value
+ client = ipaclient.IPAClient()
+ ent = client.get_user(args[1])
+ attr = ent.attrList()
+
+ print "dn: " + ent.dn
+
+ for a in attr:
+ value = ent.getValues(a)
+ if isinstance(value,str):
+ print a + ": " + value
else:
- print name + ": "
- for x in value:
- print "\t" + x
+ print a + ": "
+ for l in value:
+ print "\t" + l
+
except xmlrpclib.Fault, fault:
print fault.faultString
+ return 1
+ except kerberos.GSSError, e:
+ print "Could not initialize GSSAPI: %s/%s" % (e[0][0][0], e[0][1][0])
+ return 1
return 0