Commit Graph

9031 Commits

Author SHA1 Message Date
Martin Basti
7baa675947 Fix: uninstall does not stop named-pkcs11 and ipa-ods-exporter
ipactl is not aware of new services installed later, if ipactl restart
or start has not been executed.

This commit is workaround, proper fix may need to improve ipactl.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-01-18 12:46:03 +01:00
Jan Cholasta
7e56b4bbd7 ipapython: remove default_encoding_utf8
Replace the "import default_encoding_utf8" in ipalib/cli.py with equivalent
Python code.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2016-01-15 13:39:52 +01:00
Martin Basti
58c42ddac0 Warn about potential loss of CA, KRA, DNSSEC during uninstall
If connection do LDAP failed (or LDAP server is down) we cannot verify
if there is any additonal instance of CA, KRA, DNSSEC master.
In this case a user is warned and promted to confirm uninstallation.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-01-14 14:34:57 +01:00
Martin Basti
26899c91af CI test: fix regression in task.install_kra
ipa-kra-install needs directory manager password

Regression caused by c4b9b295d8

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-14 13:19:57 +01:00
Martin Basti
2320be18a3 Enable pylint unbalanced-tuple-unpacking check
Enables check and fixes one issue.
get_entries can be replaced by get_entry, filter is not needed because
check of 'originfilter' attribute is done later.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-14 13:15:26 +01:00
Martin Basti
267bad10a8 Enable pylint unpacking-non-sequence check
Enables check and marks occurences of runtime error in dcerpc.py as
false positive.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-14 13:13:42 +01:00
Simo Sorce
2144b1eeb7 Always verify we have a valid ldap context.
LDAP calls just assert if an invalid (NULL) context is passed in,
so we need to be sure we have a valid connection context before
calling into LDAP APIs and fail outright if a context can't be obtained.

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

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-13 16:09:38 +01:00
Simo Sorce
58ab032f1a Use only AES enctypes by default
Remove des3 and arcfour from the defaults for new installs.

NOTE: the ipasam/dcerpc code sill uses arcfour

Signed-off-by: Simo Sorce <simo@redhat.com>

Ticket: https://fedorahosted.org/freeipa/ticket/4740
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2016-01-13 15:24:53 +01:00
Milan Kubík
c0133778ae ipatests: Make the A record for hosts in topology conditional
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-13 10:07:46 +01:00
Martin Babinsky
a81e69a796 ipa-csreplica-manage: remove extraneous ldap2 connection
https://fedorahosted.org/freeipa/ticket/5583

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-13 09:58:23 +01:00
Tomas Babej
50627004b8 py3: Remove py3 incompatible exception handling
https://fedorahosted.org/freeipa/ticket/5585

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-13 09:54:03 +01:00
Martin Babinsky
00c13fd340 fix Py3 incompatible exception instantiation in replica install code
https://fedorahosted.org/freeipa/ticket/5585

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2016-01-13 09:51:08 +01:00
Fraser Tweedale
fe94222873 Do not decode HTTP reason phrase from Dogtag
The HTTP reason phrase sent by Dogtag is assumed to be encoded in
UTF-8, but the encoding used by Tomcat is dependent on system
locale, causing decode errors in some locales.

The reason phrase is optional and will not be sent in a future
version of Tomcat[1], so do not bother decoding and returning it.

[1] 707ab1c77f

Fixes: https://fedorahosted.org/freeipa/ticket/5578
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-01-13 08:12:30 +01:00
Jan Cholasta
6b2b173a4d ipalib: assume version 2.0 when skip_version_check is enabled
https://fedorahosted.org/freeipa/ticket/5601

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-12 16:37:29 +01:00
Martin Babinsky
ac76644ff6 tests for package version comparison
These tests will ensure that our package version handling code can correctly
decide when to upgrade IPA master.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-01-12 15:33:22 +01:00
Nathaniel McCallum
563bddce6d Don't error when find_base() fails if a base is not required
We always have to call find_base() in order to force libldap to open
the socket. However, if no base is actually required then there is
no reason to error out if find_base() fails. This condition can arise
when anonymous binds are disabled.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-12 12:28:44 +01:00
Martin Basti
34b197afa4 DNSSEC CI: add missing ldns-utils dependency
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-12 10:45:00 +01:00
Martin Basti
c611174987 DNSSEC test: fix adding zones with --skip-overlap-check
In DNSSEC tests the root zone has to be created, this requires to use
--skip-overlap-check to work properly.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-12 10:45:00 +01:00
Martin Babinsky
7cd99e8520 use FFI call to rpmvercmp function for version comparison
Stop using rpm-python to compare package versions since the implicit NSS
initialization upon  the module import breaks NSS handling in IPA code. Call
rpm-libs C-API function via CFFI instead.

Big thanks to Martin Kosek <mkosek@redhat.com> for sharing the code snippet
that spurred this patch.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-01-11 17:54:36 +01:00
David Kupka
bc6543efae Fix: Use unattended parameter instead of options.unattended
Attribute 'unattended' is not always present in 'options' so function
parameter 'unattended' should be used.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-11 16:34:31 +01:00
David Kupka
da1b119663 installer: Change reverse zones question to better reflect reality.
https://fedorahosted.org/freeipa/ticket/5563

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-11 16:34:31 +01:00
David Kupka
f05bea5a12 ipa-replica-prepare: Add '--auto-reverse' and '--allow-zone-overlap' options
Opiton should be added to ipa-replica-prepare when it was added to
ipa-{server,replica,dns}-install but was forgotten.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-11 16:34:31 +01:00
Milan Kubík
1995997071 ipatests: Fix configuration problems in dns tests
revzone2 changed to unresolvable reverse zone
test for root zone now supresses the overlap check

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-11 14:48:08 +01:00
Martin Basti
1d56665fd2 Upgrade: Fix upgrade of NIS Server configuration
Former upgrade file always created the NIS Server container, that caused
the ipa-nis-manage did not set all required NIS maps. Default creation
of container has been removed.

Updating of NIS Server configuration and
NIS maps is done only if the NIS Server container exists.

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

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2016-01-11 09:45:54 +01:00
Martin Babinsky
bef0f4c5c3 prevent crash of CA-less server upgrade due to absent certmonger
ipa-server-upgrade tests whether certmonger service is running before
attempting to upgrade IPA master. This causes the upgrader to always fail when
there is no CA installer and certmonger is not needed, effectively preventing
CA-less IPA master to upgrade succefuly.

This test is now skipped if CA is not enabled.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-01-11 09:08:26 +01:00
Martin Basti
129d97c10b Allow to used mixed case for sysrestore
This commit allows to use mixed case of keys for sysrestore, before this
commit all keys were saved in lowercase what prevents to accesing them.

Original usage of mixed case for sysretore key in opendssecinstance had
to be changed to lowercase to prevent issues on already installed
systems.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-08 18:21:26 +01:00
Petr Spacek
3d1a8d3134 Fix DNS zone overlap check to allow ipa-replica-install to work
https://fedorahosted.org/freeipa/ticket/5564

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-01-08 10:14:51 +01:00
Petr Spacek
17a4a29c25 Fix dns_is_enabled() API command to throw exceptions as appropriate
Previously the command returned False whenever an exception occured
which caused installed to continue even when there was a problem with
LDAP connection.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-01-08 10:14:51 +01:00
Petr Spacek
aab190cc5d Fix --auto-reverse option in --unattended mode.
Now the option correctly adds missing reverse zones even in unattended
mode.

Still, this is not sufficient in all cases because 'automatic empty zones'
created by BIND (as specified in RFC 6303) can shadow the reverse zones
hosted on other servers. This needs to be solved in a separate patch.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-01-08 10:13:23 +01:00
Petr Vobornik
af0e0e5153 webui: pwpolicy cospriority field was marked as required
https://fedorahosted.org/freeipa/ticket/5553

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-08 10:06:41 +01:00
Petr Vobornik
a291ca8780 webui: add examples to network address validator error message
https://fedorahosted.org/freeipa/ticket/5532

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Gabe Alford <redhatrises@gmail.com>
2016-01-08 09:57:42 +01:00
Oleg Fayans
3b39d8b6de Fixed install_ca and install_kra under domain level 0
Also added ipa_backup, ipa_restore and replica_uninstall functions

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 18:27:57 +01:00
Martin Basti
8f09499ee0 update_uniqueness plugin: fix referenced before assigment error
This error may potentially happen when plugin migration is skipped due
an error. In that case variable 'update' was undefined.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-07 16:36:22 +01:00
Petr Spacek
ae2462738b DNSSEC: Log debug messages at log level DEBUG
https://fedorahosted.org/freeipa/ticket/5348

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Petr Spacek
fe263f764b DNSSEC: ipa-dnskeysyncd: call ods-signer ldap-cleanup on zone removal
Command "ldap-cleanup <zone name>" is called to remove all key metadata from
LDAP. This command is now called when disabling DNSSEC on a DNS zone. The stale
metadata were causing problems when re-enabling DNSSEC on the same zone.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Petr Spacek
9fbbe3e574 DNSSEC: ipa-ods-exporter: add ldap-cleanup command
Command "ldap-cleanup <zone name>" will remove all key metadata from
LDAP. This can be used manually in sequence like:
ldap-cleanup <zone name>
update <zone name>
to delete all key metadata from LDAP and re-export them from OpenDNSSEC.

ldap-cleanup command should be called when disabling DNSSEC on a DNS
zone to remove stale key metadata from LDAP.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Petr Spacek
43acb994f6 DNSSEC: ipa-dnskeysyncd: Skip zones with old DNSSEC metadata in LDAP
This filtering is useful in cases where LDAP contains DNS zones which
have old metadata objects and DNSSEC disabled. Such zones must be
ignored to prevent errors while calling dnssec-keyfromlabel or rndc.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Petr Spacek
ddf7397a4b DNSSEC: remove keys purged by OpenDNSSEC from master HSM from LDAP
Key purging has to be only only after key metadata purging so
ipa-dnskeysyncd on replices does not fail while dereferencing
non-existing keys.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Petr Spacek
6bdc18d0c5 DNSSEC: logging improvements in ipa-ods-exporter
https://fedorahosted.org/freeipa/ticket/5348

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Petr Spacek
3c9c37cec1 DNSSEC: add debug mode to ldapkeydb.py
ldapkeydb.py can be executed directly now. In that case it will print
out key metadata as obtained using IPA LDAP API.

Kerberos credential cache has to be filled with principal posessing
appropriate access rights before the script is execured.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Petr Spacek
e9cdaa1992 DNSSEC: remove obsolete TODO note
https://fedorahosted.org/freeipa/ticket/5348

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Petr Spacek
21e6cc6863 DNSSEC: Make sure that current key state in LDAP matches key state in BIND
We have to explicitly specify "none" value to prevent dnssec-keyfromlabel
utility from using current time for keys without "publish" and "activate"
timestamps.

Previously this lead to situation where key was in (intermediate) state
"generated" in OpenDNSSEC but BIND started to use this key for signing.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Petr Spacek
9ff1c0ac29 DNSSEC: Make sure that current state in OpenDNSSEC matches key state in LDAP
Previously we published timestamps of planned state changes in LDAP.
This led to situations where state transition in OpenDNSSEC was blocked
by an additional condition (or unavailability of OpenDNSSEC) but BIND
actually did the transition as planned.

Additionally key state mapping was incorrect for KSK so sometimes KSK
was not used for signing when it should.

Example (for code without this fix):
- Add a zone and let OpenDNSSEC to generate keys.
- Wait until keys are in state "published" and next state is "inactive".
- Shutdown OpenDNSSEC or break replication from DNSSEC key master.
- See that keys on DNS replicas will transition to state "inactive" even
  though it should not happen because OpenDNSSEC is not available
  (i.e. new keys may not be available).
- End result is that affected zone will not be signed anymore, even
  though it should stay signed with the old keys.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Petr Spacek
9bcb9887ea DNSSEC: Improve error reporting from ipa-ods-exporter
https://fedorahosted.org/freeipa/ticket/5348

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-07 14:13:23 +01:00
Christian Heimes
6ac3553dde Require Dogtag 10.2.6-13 to fix KRA uninstall
The combination of a bug in Dogtag's sslget command and a new feature
in mod_nss causes an incomplete uninstallation of KRA. The bug has been
fixed in Dogtag 10.2.6-13.

https://fedorahosted.org/freeipa/ticket/5469
https://fedorahosted.org/pki/ticket/1704

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-06 20:35:52 +01:00
Martin Babinsky
2fad223dbe ipalib/x509.py: revert deletion of ipalib api import
This import statement has been removed in commit
e4075b1fe2. This caused requests for service
certs to fail, since the validation functions from x509 module crashed with
NameError.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-04 17:41:59 +01:00
Martin Basti
00fd28e026 Enable pylint unnecessary-pass check
Enables check and removes extra pass statement from code.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
ded70b6c6e Enable pylint empty-docstring check
Enables check and fixes:
************* Module ipalib.session
ipalib/session.py:671: [C0112(empty-docstring), SessionAuthManager]
Empty class docstring)
ipalib/session.py:705: [C0112(empty-docstring),
SessionAuthManager.logout] Empty method docstring)
************* Module ipalib.cli
ipalib/cli.py:364: [C0112(empty-docstring), textui.print_entry] Empty
method docstring)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
78254a9fdd Enable pylint expression-not-assigned check
Enables check and fixes:
************* Module ipa-replica-conncheck
install/tools/ipa-replica-conncheck:150:
[W0106(expression-not-assigned), parse_options] Expression
"(replica_group.add_option('-w', '--password', dest='password',
sensitive=True, help='Password for the principal'), )" is assigned to
nothing)
************* Module ipatests.test_xmlrpc.test_automount_plugin
ipatests/test_xmlrpc/test_automount_plugin.py:437:
[W0106(expression-not-assigned),
test_automount_indirect.test_1a_automountmap_add_indirect] Expression
"api.Command['automountmap_add_indirect'](self.locname, self.mapname,
**self.map_kw)['result']" is assigned to nothing)
************* Module ipatests.test_ipaserver.test_otptoken_import
ipatests/test_ipaserver/test_otptoken_import.py:128:
[W0106(expression-not-assigned), test_otptoken_import.test_mini]
Expression "[(t.id, t.options) for t in doc.getKeyPackages()]" is
assigned to nothing)
************* Module ipatests.test_ipaserver.test_ldap
ipatests/test_ipaserver/test_ldap.py:221:
[W0106(expression-not-assigned), test_LDAPEntry.test_popitem] Expression
"list(e) == []" is assigned to nothing)
************* Module ipa-client-install
ipa-client/ipa-install/ipa-client-install:114:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-p', '--principal', dest='principal',
help='principal to use to join the IPA realm'), )" is assigned to
nothing)
ipa-client/ipa-install/ipa-client-install:116:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-w', '--password', dest='password',
sensitive=True, help='password to join the IPA realm (assumes bulk
password unless principal is also set)'), )" is assigned to nothing)
ipa-client/ipa-install/ipa-client-install:118:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-k', '--keytab', dest='keytab', help='path to
backed up keytab from previous enrollment'), )" is assigned to nothing)
ipa-client/ipa-install/ipa-client-install:120:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-W', dest='prompt_password',
action='store_true', default=False, help='Prompt for a password to join
the IPA realm'), )" is assigned to nothing)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
9f49246476 Enable pylint unused-format-string-key check
Enables check and fixes:
ipatests/test_xmlrpc/test_permission_plugin.py:534:
[W1301(unused-format-string-key), test_permission] Unused key 'tdn' in
format string dictionary)
ipatests/test_xmlrpc/test_permission_plugin.py:652:
[W1301(unused-format-string-key), test_permission] Unused key 'tdn' in
format string dictionary)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00