mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fixed broken patches and server spec.
This commit is contained in:
@@ -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()
|
||||
main()
|
||||
|
||||
@@ -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()
|
||||
main()
|
||||
|
||||
0
ipa-python/__init__.py
Normal file
0
ipa-python/__init__.py
Normal file
9
ipa-server/freeipa-server.spec
Normal file → Executable file
9
ipa-server/freeipa-server.spec
Normal file → Executable file
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user