summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipa-admintools/ipa-adduser7
-rw-r--r--ipa-admintools/ipa-finduser14
-rw-r--r--ipa-python/__init__.py0
-rwxr-xr-x[-rw-r--r--]ipa-server/freeipa-server.spec9
-rw-r--r--ipa-server/freeipa-server.spec.in9
-rw-r--r--ipa-server/ipaserver/ipaldap.py14
-rw-r--r--ipa-server/xmlrpc-server/funcs.py2
-rw-r--r--ipa-server/xmlrpc-server/ipa.conf2
-rw-r--r--ipa-server/xmlrpc-server/ipaxmlrpc.py9
9 files changed, 37 insertions, 29 deletions
diff --git a/ipa-admintools/ipa-adduser b/ipa-admintools/ipa-adduser
index 94a19dba4..29946dd10 100644
--- a/ipa-admintools/ipa-adduser
+++ b/ipa-admintools/ipa-adduser
@@ -53,6 +53,7 @@ def parse_options():
def main():
user={}
(options, args) = parse_options()
+ print args
if len(args) != 1:
usage()
@@ -66,15 +67,15 @@ def main():
user['homedirectory'] = options.directory
if options.shell:
user['loginshell'] = options.shell
- else
+ else:
user['loginshell'] = "/bin/bash"
try:
ipa.rpcclient.add_user(user)
- print args[0] "successfully added"
+ print args[0] + " successfully added"
except xmlrpclib.Fault, f:
print f.faultString
return 0
-main() \ No newline at end of file
+main()
diff --git a/ipa-admintools/ipa-finduser b/ipa-admintools/ipa-finduser
index 928eff753..205b47ce9 100644
--- a/ipa-admintools/ipa-finduser
+++ b/ipa-admintools/ipa-finduser
@@ -21,7 +21,6 @@
from optparse import OptionParser
import ipa
import ipa.rpcclient
-import ipa.ipaldap
import base64
import sys
import xmlrpclib
@@ -46,13 +45,16 @@ def main():
try:
ent = ipa.rpcclient.get_user(args[0])
- entry = ipa.ipaldap.Entry(ent['dn'])
- for e in ent:
- entry.setValues(e, ent[e])
- print entry
+ for name, value in ent.items():
+ if isinstance(value, str):
+ print name + ": " + value
+ else:
+ print name + ": "
+ for x in value:
+ print "\t" + x
except xmlrpclib.Fault, fault:
print fault.faultString
return 0
-main() \ No newline at end of file
+main()
diff --git a/ipa-python/__init__.py b/ipa-python/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ipa-python/__init__.py
diff --git a/ipa-server/freeipa-server.spec b/ipa-server/freeipa-server.spec
index 74c058af6..444488d56 100644..100755
--- a/ipa-server/freeipa-server.spec
+++ b/ipa-server/freeipa-server.spec
@@ -10,11 +10,9 @@ Source0: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-Requires: python fedora-ds-base krb5-server krb5-server-ldap nss-tools openldap-clients
+Requires: python fedora-ds-base krb5-server krb5-server-ldap nss-tools openldap-clients httpd mod_python
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-
-%define pkgpythondir %{python_sitelib}/%{name}
+%define httpd_conf /etc/httpd/conf.d
%description
FreeIPA is a server for identity, policy, and audit.
@@ -25,6 +23,7 @@ FreeIPA is a server for identity, policy, and audit.
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_sbindir}
+mkdir -p %{buildroot}%{httpd_conf}
make install DESTDIR=%{buildroot}
@@ -41,6 +40,8 @@ rm -rf %{buildroot}
%dir %{_usr}/share/ipa
%{_usr}/share/ipa/*
+%{httpd_conf}/ipa.conf
+
%changelog
* Fri Jul 27 2007 Karl MacMillan <kmacmill@localhost.localdomain> - 0.1.0-1
diff --git a/ipa-server/freeipa-server.spec.in b/ipa-server/freeipa-server.spec.in
index dc6c83bb1..41a475440 100644
--- a/ipa-server/freeipa-server.spec.in
+++ b/ipa-server/freeipa-server.spec.in
@@ -10,11 +10,9 @@ Source0: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-Requires: python fedora-ds-base krb5-server krb5-server-ldap nss-tools openldap-clients
+Requires: python fedora-ds-base krb5-server krb5-server-ldap nss-tools openldap-clients httpd mod_python python-ldap
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-
-%define pkgpythondir %{python_sitelib}/%{name}
+%define httpd_conf /etc/httpd/conf.d
%description
FreeIPA is a server for identity, policy, and audit.
@@ -25,6 +23,7 @@ FreeIPA is a server for identity, policy, and audit.
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_sbindir}
+mkdir -p %{buildroot}%{httpd_conf}
make install DESTDIR=%{buildroot}
@@ -41,6 +40,8 @@ rm -rf %{buildroot}
%dir %{_usr}/share/ipa
%{_usr}/share/ipa/*
+%{httpd_conf}/ipa.conf
+
%changelog
* Fri Jul 27 2007 Karl MacMillan <kmacmill@localhost.localdomain> - 0.1.0-1
diff --git a/ipa-server/ipaserver/ipaldap.py b/ipa-server/ipaserver/ipaldap.py
index 50f88520c..f440ae4bb 100644
--- a/ipa-server/ipaserver/ipaldap.py
+++ b/ipa-server/ipaserver/ipaldap.py
@@ -187,7 +187,7 @@ class IPAdmin(SimpleLDAPObject):
ent = self.getEntry('cn=config', ldap.SCOPE_BASE, '(objectclass=*)',
[ 'nsslapd-instancedir', 'nsslapd-errorlog' ])
instdir = ent.getValue('nsslapd-instancedir')
- self.sroot, self.inst = re.match(r'(.*)[\/]slapd-(\w)$', instdir).groups()
+ self.sroot, self.inst = re.match(r'(.*)[\/]slapd-(\w+)$', instdir).groups()
self.errlog = ent.getValue('nsslapd-errorlog')
except (ldap.INSUFFICIENT_ACCESS, ldap.CONNECT_ERROR, NoSuchEntryError):
pass # usually means
@@ -230,7 +230,7 @@ class IPAdmin(SimpleLDAPObject):
self.__localinit__()
def __str__(self):
- return self.host ":" str(self.port)
+ return self.host + ":" + str(self.port)
def toLDAPURL(self):
return "ldap://%s:%d/" % (self.host,self.port)
@@ -240,7 +240,7 @@ class IPAdmin(SimpleLDAPObject):
res = self.search(*args)
type, obj = self.result(res)
if not obj:
- raise NoSuchEntryError("no such entry for " str(args))
+ raise NoSuchEntryError("no such entry for " + str(args))
elif isinstance(obj,Entry):
return obj
else: # assume list/tuple
@@ -268,7 +268,7 @@ class IPAdmin(SimpleLDAPObject):
setattr(self, name, wrapper(attr, name))
def exportLDIF(self, file, suffix, forrepl=False, verbose=False):
- cn = "export" str(int(time.time()))
+ cn = "export" + str(int(time.time()))
dn = "cn=%s, cn=export, cn=tasks, cn=config" % cn
entry = Entry(dn)
entry.setValues('objectclass', 'top', 'extensibleObject')
@@ -295,7 +295,7 @@ class IPAdmin(SimpleLDAPObject):
if attr:
filter = "(%s=*)" % attr
attrlist.append(attr)
- timeout = int(time.time())
+ timeout += int(time.time())
if isinstance(dn,Entry):
dn = dn.dn
@@ -356,7 +356,7 @@ class IPAdmin(SimpleLDAPObject):
fqdn = IPAdmin.getfqdn(name)
index = fqdn.find('.')
if index >= 0:
- return fqdn[index1:]
+ return fqdn[index+1:]
else:
return fqdn
getdomainname = staticmethod(getdomainname)
@@ -364,7 +364,7 @@ class IPAdmin(SimpleLDAPObject):
def getdefaultsuffix(name=''):
dm = IPAdmin.getdomainname(name)
if dm:
- return "dc=" dm.replace('.', ', dc=')
+ return "dc=" + dm.replace('.', ', dc=')
else:
return 'dc=localdomain'
getdefaultsuffix = staticmethod(getdefaultsuffix)
diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py
index 78180a491..d6473f9a7 100644
--- a/ipa-server/xmlrpc-server/funcs.py
+++ b/ipa-server/xmlrpc-server/funcs.py
@@ -44,7 +44,7 @@ def get_user (username):
ent=""
# FIXME: Is this the filter we want or should it be more specific?
- filter = "(uid=" username ")"
+ filter = "(uid=" + username + ")"
try:
m1 = ipaserver.ipaldap.IPAdmin(host,port,binddn,bindpw)
ent = m1.getEntry(basedn, scope, filter, None)
diff --git a/ipa-server/xmlrpc-server/ipa.conf b/ipa-server/xmlrpc-server/ipa.conf
index 5a1304188..1880268cf 100644
--- a/ipa-server/xmlrpc-server/ipa.conf
+++ b/ipa-server/xmlrpc-server/ipa.conf
@@ -2,7 +2,7 @@
Alias /ipa "/usr/share/ipa/ipaserver/XMLRPC"
-<Directory "/usr/share/ipaserver">
+<Directory "/usr/share/ipa/ipaserver">
# AuthType Kerberos
# AuthName "Kerberos Login"
# KrbMethodNegotiate on
diff --git a/ipa-server/xmlrpc-server/ipaxmlrpc.py b/ipa-server/xmlrpc-server/ipaxmlrpc.py
index 1dc15956a..ad5e30683 100644
--- a/ipa-server/xmlrpc-server/ipaxmlrpc.py
+++ b/ipa-server/xmlrpc-server/ipaxmlrpc.py
@@ -24,6 +24,9 @@
# Rob Crittenden <rcritten@redhat.com>
import sys
+sys.path.append("/usr/share/ipa")
+
+
import time
import traceback
import pprint
@@ -201,7 +204,7 @@ class ModXMLRPCRequestHandler(object):
if x == 0 and func.func_code.co_varnames[x] == "self":
continue
if func.func_defaults and func.func_code.co_argcount - x <= len(func.func_defaults):
- args.append((func.func_code.co_varnames[x], func.func_defaults[x - func.func_code.co_argcount len(func.func_defaults)]))
+ args.append((func.func_code.co_varnames[x], func.func_defaults[x - func.func_code.co_argcount + len(func.func_defaults)]))
else:
args.append(func.func_code.co_varnames[x])
return args
@@ -225,7 +228,7 @@ class ModXMLRPCRequestHandler(object):
arglist.append('%s=%s' % (arg[0], arg[1]))
ret = '%s(%s)' % (method, ", ".join(arglist))
if func.__doc__:
- ret = "\ndescription: %s" % func.__doc__
+ ret += "\ndescription: %s" % func.__doc__
return ret
def handle_request(self,req):
@@ -259,7 +262,7 @@ def handler(req, profiling=False):
sys.stdout = strstream
stats.sort_stats("time")
stats.print_stats()
- req.write("<pre>" strstream.getvalue() "</pre>")
+ req.write("<pre>" + strstream.getvalue() + "</pre>")
_profiling_req = None
else:
opts = req.get_options()