Commit Graph

5651 Commits

Author SHA1 Message Date
Petr Viktorin
f5c404c65d Replace entry.getValue by entry.single_value
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
66eaf1220d Remove special-casing for missing and single-valued attributes in LDAPUpdate._entry_to_entity 2013-03-01 16:59:45 +01:00
Petr Viktorin
6eeb5ecbea Introduce LDAPEntry.single_value for getting single-valued attributes
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
5271eb217c Replace IPAdmin.checkTask by replication.wait_for_task
The method was only used for waiting, not actual checking.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:45 +01:00
Petr Viktorin
b69f6983e4 Remove IPAdmin.get_dns_sorted_by_length
A simple sort(key=len) is simpler both implementation-wise and
semantics-wise.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
607ff478f5 Remove IPAdmin.updateEntry calls from fix_replica_agreements
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
8be8d4ebfd Remove dbdir, binddn, bindpwd from IPAdmin
The dbdir logic was moved to replication.py, the only caller.
The binddn and bindpwd attributes were unused.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
1960945e28 Turn the LDAPError handler into a context manager
This has the advantage that the traceback is left intact if an error
other than LDAPError is raised.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
d11c337541 Remove unused bindcert and bindkey arguments to IPAdmin
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
334ba2e79f Remove unused imports from ipaserver/install
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
abb22806a7 Change {add,update,delete}_entry to take LDAPEntries
These methods currently take (dn, entry_attrs, normalize=True)
(or (dn, normalize=True) for delete).
Change them to also accept just an LDAPEntry.
For add and update, document the old style as deprecated.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
aa6fb75637 Replace add_s and delete_s by their newer equivalents
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
66c7fd1323 Replace entry.setValue/setValues by item assignment
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
c613caab67 Replace entry.getValues() by entry.get()
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
b2dd8d7f05 Use update_entry with a single entry in adtrustinstance
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Petr Viktorin
3dd4b36e1a Replace setValue by keyword arguments when creating entries
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:44 +01:00
Jan Cholasta
6896626baa Remove the Entry class. 2013-03-01 16:59:43 +01:00
Jan Cholasta
c1d6937ea2 Remove the Entity class.
Move Entity functionality to LDAPEntry.
2013-03-01 16:59:43 +01:00
Jan Cholasta
8d92ca851c Add make_entry factory method to LDAPConnection.
Replace all occurences of Entry instantiation with calls to make_entry.
2013-03-01 16:59:43 +01:00
Petr Viktorin
d9b3c91d47 Implement some of IPAdmin's legacy methods in terms of LDAPConnection methods
These will serve as templates for changes in the calling code.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
a7a81238a8 Move entry add, update, remove, rename to LDAPConnection
Also remove _FORCE_REPLACE_ON_UPDATE_ATTRS which was never used.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
603d9ac418 Remove unused proxydn functionality from IPAdmin
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
0c26913309 Move entry finding methods to LDAPConnection
The get_ipa_config method relies on IPA being installed.
Leave the implementation in ldap2, and add stub get_ipa_config that
simply returns an empty dictionary to LDAPConnection.

The get_members method contains an optimization that also relies on
the api object. The optimization is disabled in base LDAPConfig.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
ddee3aa900 Move filter making methods to LDAPConnection
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
6fb115751c Move DN handling methods to LDAPConnection
ldap2 has "DN normalization" functionality, which silently adds the base
DN to DNs that don't already end with it.
This functionality is left in the ldap2 class only.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
44e15206d0 Move schema-related methods to LDAPConnection
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
5476b144f6 Make IPAdmin not inherit from IPASimpleLDAPObject
Instead of inheritance, the LDAPObject is kept in a `conn` attribute,
as the ldap2 class does it.
However, all IPASimpleLDAPObject methods are still available as before
(using __getattr__-based proxying).

Also, remove the IPAEntryLDAPObject class. The methods it overrode
were never called in ways that would make them behave differently than
the superclass.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
df4ed77962 Start LDAPConnection, a common base for ldap2 and IPAdmin
The first method to be extracted is handle_errors

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
9d41ee4b31 Move SchemaCache and IPASimpleLDAPObject to ipaserver.ipaldap
The ldap2 plugin should only contain the actual CRUDBackend plugin.
Common LDAP classes are moved to ipaldap.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
2f84bd694b Move the decision to force schema updates out of IPASimpleLDAPObject
This decision used the api object, which might not be available
in installer code. Move the decision to callers.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
08276c24fe Remove connection-creating code from ShemaCache
The connection code depends on the api object. If we want to use
the cache in installer code, where the api object is not always
available, the dependency must be removed.

Luckily, SchemaCache.get_schema is currently always given a connection.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:43 +01:00
Petr Viktorin
49a0e3ac01 Move LDAPEntry to ipaserver.ipaldap and derive Entry from it
Legacy Entry methods such as setValue are added to LDAPEntry directly,
so that we can use connection classes that return LDAPEntry with
code that expects Entries.

The Entry and its unique __init__ are still kept for compatibility.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:42 +01:00
Petr Viktorin
a8c0bf0c85 Use explicit loggers in ldap2 code
This change makes it easier to see what is going on, in addition
to getting rid of pylint exceptions.

Also, make logging imports use explicit names instead of `import *`.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:42 +01:00
Petr Viktorin
7e1495b404 Derive Entity class from Entry, and move it to ldapupdate
The two classes were nearly identical, and the updater is
the only code that uses Entity.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:42 +01:00
Petr Viktorin
83f99070d6 Remove unused methods from Entry, Entity, and IPAdmin
These classes are deprecated, there's no use keeping unused methods around.

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-01 16:59:42 +01:00
Petr Viktorin
c0a89efd68 Remove some unused imports
Remove all unused LDAP-related imports, plus some other ones.

This should make it easier to quickly check what uses which LDAP wrapper
2013-03-01 16:59:42 +01:00
Jan Cholasta
ef1cd6e247 Add custom mapping object for LDAP entry data. 2013-03-01 16:59:42 +01:00
Martin Kosek
e2120c31c3 Fix includedir directive in krb5.conf template
We did not have the includedir directory with a trailing slash which made
rpm update add a redundant line.

https://fedorahosted.org/freeipa/ticket/3132
2013-02-28 15:25:14 +01:00
Sumit Bose
d10c043e92 ipa-pwd: Unchecked return value ipapwd_chpwop()
Fixes https://fedorahosted.org/freeipa/ticket/3427
2013-02-28 12:33:28 +01:00
Sumit Bose
99ff913b89 ipa-extdom: Double-free in ipa_extdom_common.c
Fixes https://fedorahosted.org/freeipa/ticket/3426
2013-02-28 12:32:43 +01:00
Sumit Bose
11b20bdc82 ipa-lockout: Wrong sizeof argument in ipa_lockout.c
Fixes https://fedorahosted.org/freeipa/ticket/3425
2013-02-28 12:31:54 +01:00
Sumit Bose
29ddcf3bcb ipa-kdb: Dereference after null check in ipa_kdb_mspac.c
A wrong logic was used to check ipactx.

Fixes https://fedorahosted.org/freeipa/ticket/3424
2013-02-28 12:31:02 +01:00
Sumit Bose
caa218b6b8 ipa-sam: Array compared against 0 in ipasam_set_trusted_domain()
ipa_mspac_well_known_sids is a globally defined array so the check was
always true.

Fixes https://fedorahosted.org/freeipa/ticket/3423
2013-02-28 12:27:51 +01:00
Sumit Bose
db1a07b7f2 ipa-kdb: Uninitialized scalar variable in ipadb_reinit_mspac()
There was a code path where ret was used instead of kerr to save a
return value.

Fixes https://fedorahosted.org/freeipa/ticket/3422
2013-02-28 12:27:07 +01:00
Sumit Bose
5582c9ca63 ipa-kdb: remove unused variable 2013-02-28 12:26:28 +01:00
Martin Kosek
4a6f3cac29 Remove ORDERING for IA5 attributeTypes
IA5 string syntax does not have a compatible ORDERING matching rule.
Simply use default ORDERING for these attributeTypes as we already
do in other cases.

https://fedorahosted.org/freeipa/ticket/3398
2013-02-27 12:47:04 +01:00
Petr Viktorin
8b8859ed7d cli: Do interactive prompting after a context is created
Some commands require a connection for interactive prompting.
Prompt after the connection is created.

Option parsing is still done before connecting so that help
can be printed out without a Kerberos ticket.

https://fedorahosted.org/freeipa/ticket/3453
2013-02-26 18:19:16 +01:00
Tomas Babej
68ffb4af2f Add trusted domain range objectclass when using idrange-mod
When modifing the idrange, one was able to add ipa NT trusted
AD domain sid without objectclass ipatrustedaddomainrange being
added. This patch fixes the issue.
2013-02-26 09:32:30 +01:00
Tomas Babej
4ba2700de4 Make options checks in idrange-add/mod consistent
Both now enforce the following checks:
  - dom_sid and secondary_rid_base cannot be used together
  - rid_base must be used together if dom_rid is set
  - secondary_rid_base and rid_base must be used together
    if dom_rid is not set

Unit test for third check has been added.

http://fedorahosted.org/freeipa/ticket/3170
2013-02-26 09:32:30 +01:00
Martin Kosek
54a53bca48 Bump FreeIPA version for development branch
Current master branch represents future release of FreeIPA (3.2).
Bump VERSION so that current development packages are not being
updated with freeipa-3.1.x packages already released in downstream
repositories.
2013-02-25 13:42:05 +01:00