Commit Graph

5895 Commits

Author SHA1 Message Date
Sumit Bose
aa2ed2d3c8 Add support for cmocka C-Unit Test framework
cmocka is a more advanced unit test framework for C-code than the
currently used check framework. This patch adds configure checks and
makefile variables so that new unit tests can use cmocka.

Fixes https://fedorahosted.org/freeipa/ticket/3434
2013-03-28 16:11:24 +01:00
Ana Krivokapic
dae163aa37 Add mkhomedir option to ipa-server-install and ipa-replica-install
Add the option to create home directories for users on their
first login to ipa-server-install and ipa-replica-install.

https://fedorahosted.org/freeipa/ticket/3515
2013-03-28 08:45:37 +01:00
Martin Kosek
a8a77bfb68 Bump selinux-policy requires
The higher version is reported to fix a Fedora 17 to 18 upgrade issue.

https://fedorahosted.org/freeipa/ticket/3399
2013-03-26 15:26:15 +01:00
Tomas Babej
2f0c7d6e23 Add logging to join command
The following is mentioned in the log now:
  - existence of host entry (if it already does exist)
  - missing krbprincipalname and its new value (if there was no
    principal name set)

https://fedorahosted.org/freeipa/ticket/3481
2013-03-25 10:58:23 +01:00
Tomas Babej
a7ccc198a7 Allow host re-enrollment using delegation
A new option --force-join has been added to ipa-client-install.
It forces the host enrollment even if the host entry exists.
Old certificate is revoked, new certificate and ssh key pair
generated. See the relevant design for the re-enrollment part:
http://freeipa.org/page/V3/Forced_client_re-enrollment

https://fedorahosted.org/freeipa/ticket/3482
2013-03-25 10:53:25 +01:00
Martin Kosek
322458b5b2 Fix structured DNS record output
Recent LDAP refactoring replaced entry_attrs regular dict with
normalized keys (i.e. lowercase) with LDAPEntry instance which keys
may not be normalized. This broke CND command output when
--structured and --all options were used.

Force lowercase normalization of the LDAPEntry keys in DNS plugin
structured format postprocessing. Also add a missing test for
DNS record structured output.

https://fedorahosted.org/freeipa/ticket/3526
2013-03-22 15:10:03 +01:00
Ana Krivokapic
c2034805d3 Use default NETBIOS name in unattended ipa-adtrust-install
Unattended ipa-adtrust-install used to fail if --netbios option
was not provided. This patches fixes this, so that instead of
failing the default NETBIOS name is used.

https://fedorahosted.org/freeipa/ticket/3497
2013-03-22 15:05:59 +01:00
Martin Kosek
b5b040e68f Configure ipa_dns DS plugin on install and upgrade
The plugin is configured unconditionally (i.e. does not check if
IPA was configured with DNS) as the plugin is needed on all
replicas to prevent objectclass violations due to missing SOA
serial in idnsZone objectclass. The violation could happen if just
one replica configured DNS and added a new zone.

https://fedorahosted.org/freeipa/ticket/3347
2013-03-22 14:31:22 +01:00
Petr Spacek
952a7ac9f5 Add 389 DS plugin for special idnsSOASerial attribute handling
Default value "1" is added to replicated idnsZone objects
if idnsSOASerial attribute is missing.

https://fedorahosted.org/freeipa/ticket/3347

Signed-off-by: Petr Spacek <pspacek@redhat.com>
2013-03-22 14:31:22 +01:00
Rob Crittenden
797baef1a4 Fix lockout of LDAP bind.
There were several problems:

- A cut-n-paste error where the wrong value was being considered when
  an account was administratively unlocked.
- An off-by-one error where LDAP got one extra bind attempt.
- krbPwdPolicyReference wasn't being retrieved as a virtual attribute so
  only the global_policy was used.
- The lockout duration wasn't examined in the context of too many failed
  logins so wasn't being applied properly.
- Lockout duration wasn't used properly so a user was effectively unlocked
  when the failure interval expired.
- krbLastFailedAuth and krbLoginFailedCount are no longer updated past
  max failures.

https://fedorahosted.org/freeipa/ticket/3433
2013-03-21 15:44:53 -04:00
Alexander Bokovoy
41031fe121 Process exceptions when talking to Dogtag
The problem is the ca_status() uses an HTTP GET operation to check Dogtag's
status. Under some circumstances Dogtag may take a long time to respond, so the
HTTP GET may time out much earlier than 2 minutes. And since the above code
doesn't catch the exception, the whole loop fails immediately, so it doesn't
wait for a full 2 minutes as expected.

https://fedorahosted.org/freeipa/ticket/3492
2013-03-21 17:14:55 +01:00
Martin Kosek
1336b39906 Improve client install LDAP cert retrieval fallback
CA certificate retrieval function did not fallback from LDAP to
HTTP based retrieval in case of an LDAP error, when for example
GSSAPI authentication failed.

https://fedorahosted.org/freeipa/ticket/3512
2013-03-21 16:12:12 +01:00
Martin Kosek
6540eff468 Use temporary CCACHE in ipa-client-install
ipa-client-install failed if user had set his own KRB5CCNAME in his
environment. Use a temporary CCACHE for the installer to avoid these
kind of errors.

https://fedorahosted.org/freeipa/ticket/3512
2013-03-21 16:12:12 +01:00
Brian Cook
3ea8dabeb9 Add DNS Setup Prompt to Install
Currently the only way to setup integrated DNS is by passing --setup-dns
to ipa-server-install. This patch modifies install so that if
--setup-dns is not passed, the user is asked if they want to configure
integrated dns.

http://fedorahosted.org/freeipa/ticket/2575
2013-03-21 09:56:54 +01:00
Petr Vobornik
790a576ad1 Fixed Web UI build error caused by rhino changes in F19
rhino-1.7R4-2.fc19.noarch dropped -main flag which made the build fail in rawhide (F19).

We can't use the same command for rhino-1.7R3-6 (F18) and rhino-1.7R4-2 (F19).
This patch adds check if rhino supports '-require' option. If so it calls rhino with it if not it calls rhino with -main option.

https://fedorahosted.org/freeipa/ticket/3501
2013-03-21 09:30:35 +01:00
Martin Kosek
be54d1deb5 ipa-client discovery with anonymous access off
When RootDSE could be read (nsslapd-allow-anonymous-access set to
"rootdse"), autodiscovery module failed to report success to the
client installer.

Remove faulty "verified_servers" flag from autodiscovery module as
it has no point since we consider both scenarios (IPA server with
anonymous access on and unknown LDAP server with anonymous access
off) as success.

https://fedorahosted.org/freeipa/ticket/3519
2013-03-20 09:22:10 +01:00
Ana Krivokapic
6c85b88874 Realm Domains page
Add support for Realm Domains to web UI.

https://fedorahosted.org/freeipa/ticket/3407
2013-03-18 15:11:26 +01:00
Petr Vobornik
8d36951911 Web UI:Choose different search option for cert-find
This extends certificate search page by search option select. Therefore
the search is not restricted to 'subject'.

It should be replaced by https://fedorahosted.org/freeipa/ticket/191 in a
future.

https://fedorahosted.org/freeipa/ticket/3419
2013-03-18 15:11:18 +01:00
Petr Vobornik
070fc176ae Web UI:Certificate pages
Following pages were added to Web UI:
 * certificated details
 * certificate search

Certificate is not regular object so it gets no metadata. Therefore artificial
metadata were created for it to allow usage of search and details facet.

Search and details facet were modified to allow removing of add/remove/update/
reset buttons - certificates have no mod operation and they are not added by
standard means.

User can revoke and restore certificated in details facet.

https://fedorahosted.org/freeipa/ticket/3419
2013-03-18 15:11:08 +01:00
Ana Krivokapic
5f6310ecc6 Fix internal error for ipa show-mappings
The run() method of the show_mappings command was missing
the **options parameter in its signature, causing the
ipa show-mappings to fail with an internal error.
2013-03-18 14:40:54 +01:00
Ana Krivokapic
8de6c3fa90 Remove check for alphabetic only characters from domain name validation
The .isalpha() check in validate_domain_name() was too strict,
causing some commands like ipa dnsrecord-add to fail.

https://fedorahosted.org/freeipa/ticket/3385
2013-03-15 12:52:34 +01:00
Rob Crittenden
c8846bab25 Improve some error handling in ipa-replica-manage
If you break a replica install after the agreement is created but
before it gets much further you'll be in the situation where an
agreement exists, no cn=masters entry exists, and the RUV may not
be set yet.

This adds some error handling so the broken install can be safely
removed.

https://fedorahosted.org/freeipa/ticket/3444
2013-03-14 13:52:56 -04:00
Ana Krivokapic
66356f0daf Improve error messages for external group members
When adding a duplicate member to a group, an error message is issued,
informing the user that the entry is already a member of the group.
Similarly, when trying to delete an entry which is not a member,
an error message is issued, informing the user that the entry is not
a member of the group. These error messages were missing in case of
external members.

This patch also adds support for using the AD\name or name@ad.domain.com
format in ipa group-remove-member command. This format was supported in
group-add-member, but not in group-remove-member.

Unit test file covering these cases was also added.

https://fedorahosted.org/freeipa/ticket/3254
2013-03-14 11:44:24 -04:00
Martin Kosek
c4ab8dae35 Do not force named connections on upgrades
We used to set connections argument for bind-dyndb-ldap even when
the attribute was not in named.conf. This is not necessary as
the bind-dyndb-ldap plugin chooses a sane default instead of us.
2013-03-14 10:50:24 -04:00
Martin Kosek
7a2d3804af Use tkey-gssapi-keytab in named.conf
Remove obsolete BIND GSSAPI configuration options tkey-gssapi-credential
and tkey-domain and replace them with tkey-gssapi-keytab which avoids
unnecessary Kerberos checks on BIND startup and can cause issues when
KDC is not available.

Both new and current IPA installations are updated.

https://fedorahosted.org/freeipa/ticket/3429
2013-03-14 10:50:24 -04:00
Martin Kosek
ca6f7f2450 Update named.conf parser
Refactor the named.conf parsing and editing functions in bindinstance
so that both "dynamic-db" and "options" sections of named.conf can
be read and updated

https://fedorahosted.org/freeipa/ticket/3429
2013-03-14 10:50:24 -04:00
Tomas Babej
04a17f00b7 Enforce exact SID match when adding or modifying a ID range
SID validation in idrange.py now enforces exact match on SIDs, thus
one can no longer use SID of an object in a trusted domain as a
trusted domain SID.

https://fedorahosted.org/freeipa/ticket/3432
2013-03-14 15:20:30 +01:00
Martin Kosek
354a5db38e Avoid multiple client discovery with fixed server list
In client discovery module, we used to run up to three discovery
processes even though we received a fixed list of servers to connect
to. This could result in up to 3 identical "not an IPA server" error
messages when the passed server is not an IPA server.

Error out immediately when we are discovering against a fixed set
of servers.

Related to fixes in https://fedorahosted.org/freeipa/ticket/3418
2013-03-14 09:35:25 +01:00
Martin Kosek
452ffa143a Preserve order of servers in ipa-client-install
When multiple servers are passed via --server option, ipadiscovery
module changed its order. Make sure that we preserve it.

Also make sure that user is always warned when a tested server is
not available as then the server will be excluded from the fixed
server list. Log messages were made more informative so that user
knows which server is actually failing to be verified.

https://fedorahosted.org/freeipa/ticket/3418
2013-03-14 09:35:17 +01:00
Martin Kosek
158bf45cae Do not hide idrange-add errors when adding trust
We catched all errors that could be raised by idrange-add command and
just raised an uncomprehensible ValidationError. This could hide
a real underlying problem and make the debugging harder.

We should rather just let the command raise the real error (which
will be already a PublicError).

https://fedorahosted.org/freeipa/ticket/3288
2013-03-13 14:38:27 -04:00
Martin Kosek
dcc6f13a58 Use new 389-ds-base cleartext password API
The way how unhashed password is stored in the entry was changed in
389-ds-base-1.3.0, it is now stored in an entry extension rather than
in a magic attribute unhashed#user#password. New API using an entry
extension was introduced. ipa-pwd-extop should take advantage of the
new API as the old one will be removed in 389-ds-base-1.3.1.

https://fedorahosted.org/freeipa/ticket/3439
2013-03-13 14:06:38 -04:00
Tomas Babej
99b62aa66f Remove implicit Str to DN conversion using *-attr
DNs represented as strings and passed via --setattr or --addattr
are no longer implicitly converted to DN type. This solves various
errors associated with this behaviour, see tickets below.

Unit tests added.

https://fedorahosted.org/freeipa/ticket/3348
https://fedorahosted.org/freeipa/ticket/3349
2013-03-13 17:33:51 +01:00
Tomas Babej
ade4aaef9a Make sure uninstall script prompts for reboot as last
Parts of client uninstall logic could be skipped in attended
uninstallation if user agreed to reboot the machine. Particulary,
the uninstall script would not try to remove /etc/ipa/default.conf
and therefore subsequent installation would fail, client being
detected as already configured.

https://fedorahosted.org/freeipa/ticket/3462
https://fedorahosted.org/freeipa/ticket/3463
2013-03-13 16:53:19 +01:00
Rob Crittenden
9005b9bc8a Extend ipa-replica-manage to be able to manage DNA ranges.
Attempt to automatically save DNA ranges when a master is removed.
This is done by trying to find a master that does not yet define
a DNA on-deck range. If one can be found then the range on the deleted
master is added.

If one cannot be found then it is reported as an error.

Some validation of the ranges are done to ensure that they do overlap
an IPA local range and do not overlap existing DNA ranges configured
on other masters.

http://freeipa.org/page/V3/Recover_DNA_Ranges

https://fedorahosted.org/freeipa/ticket/3321
2013-03-13 10:32:36 -04:00
Petr Viktorin
63407ed477 Don't download the schema in ipadiscovery 2013-03-13 12:36:34 +01:00
Petr Viktorin
cf4b52111d Remove unneeded python-ldap imports
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
2013-03-13 12:36:34 +01:00
Petr Viktorin
664248d5b8 Use IPAdmin rather than raw python-ldap in migration.py and ipadiscovery.py
These used ipautil.get_ipa_basedn. Convert that to use the new wrappers.

Beef up the error handling in ipaldap to accomodate the errors we catch
in the server discovery.
Add a DatabaseTimeout exception to errors.py.

These were the last uses of ipautil.convert_ldap_error, remove that.

https://fedorahosted.org/freeipa/ticket/3487
https://fedorahosted.org/freeipa/ticket/3446
2013-03-13 12:36:33 +01:00
Petr Viktorin
a0242334fe Use IPAdmin rather than raw python-ldap in ipa-client-install
Part of the work for: https://fedorahosted.org/freeipa/ticket/3487
2013-03-13 12:36:33 +01:00
Petr Viktorin
91a63cce62 Remove ipaserver/ipaldap.py
In addition to removing the module, fix all places where it was imported.

Preparation for: https://fedorahosted.org/freeipa/ticket/3446
2013-03-13 12:36:33 +01:00
Petr Viktorin
4e6a2a916d Move ipaldap to ipapython
Part of the work for: https://fedorahosted.org/freeipa/ticket/3446
2013-03-13 12:36:33 +01:00
Tomas Babej
a38d93f65f Add support for re-enrolling hosts using keytab
A host that has been recreated  and does not have its
host entry disabled or removed, can be re-enrolled using
a previously backed up keytab file.

A new option --keytab has been added to ipa-client-install. This
can be used to specify path to the keytab and can be used instead
of -p or -w options.

A new option -f has been added to ipa-join. It forces client to
join even if the host entry already exits. A new certificate,
ssh keys are generated, ipaUniqueID stays the same.

Design page: http://freeipa.org/page/V3/Client_install_using_keytab

https://fedorahosted.org/freeipa/ticket/3374
2013-03-12 15:13:09 +01:00
Petr Viktorin
91606e6679 Change DNA magic value to -1 to make UID 999 usable
Change user-add's uid & gid parameters from autofill to optional.
Change the DNA magic value to -1.

For old clients, which will still send 999 when they want DNA
assignment, translate the 999 to -1. This is done via a new
capability, optional_uid_params.

Tests included

https://fedorahosted.org/freeipa/ticket/2886
2013-03-11 17:07:07 +01:00
Tomas Babej
8d432353cc Perform secondary rid range overlap check for local ranges only
Any of the following checks:
  - overlap between primary RID range and secondary RID range
  - overlap between secondary RID range and secondary RID range

is performed now only if both of the ranges involved are local
domain ranges.

https://fedorahosted.org/freeipa/ticket/3391
2013-03-11 13:55:43 +01:00
Petr Viktorin
6ff20ca2d9 Fix installing server with external CA
Reorganize ipa-server-instal so that DS (and NTP server) installation
only happens in step one.

Change CAInstance to behave correctly in two-step install.

Add an `init_info` method to DSInstance that includes common
attribute/sub_dict initialization from create_instance and create_replica.
Use it in ipa-server-install to get a properly configured DSInstance
for later tasks.

https://fedorahosted.org/freeipa/ticket/3459
2013-03-08 15:42:20 +01:00
Jan Cholasta
9955ba0714 Disable schema retrieval and attribute decoding when talking to AD GC. 2013-03-08 14:47:52 +01:00
Jan Cholasta
f423364fa8 Allow disabling attribute decoding in LDAPClient and IPAdmin. 2013-03-08 14:47:52 +01:00
Jan Cholasta
fffd2eb32d Allow disabling LDAP schema retrieval in LDAPClient and IPAdmin. 2013-03-08 14:47:52 +01:00
Jan Cholasta
4152c36bf2 Do not fail if schema cannot be retrieved from LDAP server. 2013-03-08 14:47:52 +01:00
Sumit Bose
331856b13c Allow 'nfs:NONE' in global configuration
This patch adds 'nfs:NONE' as an allowed entry for the global
authorization data type in the CLI and WebUI. This is an ad-hoc solution
to make sure that the new default value for the NFS service is not
removed by chance.

This patch should be removed if a more generic solution is implemented
to modify service:TYPE style values of the authorization data type.

https://fedorahosted.org/freeipa/ticket/2960
2013-03-08 10:46:00 +01:00
Sumit Bose
5f3142c1e9 Mention PAC issue with NFS in service plugin doc
https://fedorahosted.org/freeipa/ticket/2960
2013-03-08 10:46:00 +01:00