Commit Graph

8848 Commits

Author SHA1 Message Date
Petr Vobornik
fc4b33d050 webui: split facet header into two classes
So that facet.simple_facet_header could be used even in pages without
entity structure - e.g. future topology graph.

prerequisite for: https://fedorahosted.org/freeipa/ticket/4286

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-27 15:50:56 +01:00
Petr Vobornik
148083f26a webui: add Deferred/Promise API to rpc.command
so that commands could be easily chained

prerequisite for: https://fedorahosted.org/freeipa/ticket/4286

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-27 15:50:56 +01:00
Martin Babinsky
7978c21473 replica promotion: modify default.conf even if DS configuration fails
When we promote an IPA client to replica, we need to write master-like
default.conf once we start configuring directory server instance. This way
even if DS configuration fails for some reason the server uninstall code can
work properly and clean up partially configured replica.

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

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-11-27 10:32:04 +01:00
Christian Heimes
b6c893aae6 mod_auth_gssapi: Remove ntlmssp support and restrict mechanism to krb5
By default mod_auth_gssapi allows all locally available mechanisms. If
the gssntlmssp package is installed, it also offers ntlmssp.  This has
the annoying side effect that some browser will pop up a
username/password request dialog if no Krb5 credentials are available.

The patch restricts the mechanism to krb5 and removes ntlmssp and
iakerb support from Apache's ipa.conf.

The new feature was added to mod_auth_gssapi 1.3.0.

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

Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-11-26 15:20:19 +01:00
Tomas Babej
8403bd9d15 ipa-client-automount: Leverage IPAChangeConf to configure the domain for idmapd
Simple regexp substitution caused that the domain directive fell under
an inapprorpiate section, if the domain directive was not present. Hence
the idmapd.conf file was not properly parsed.

Use IPAChangeConf to put the directive in its correct place even if it
the domain directive is missing.

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

Reviewed-By: Gabe Alford <redhatrises@gmail.com>
2015-11-26 12:18:08 +01:00
Tomas Babej
304c8694c4 ipachangeconf: Add ability to preserve section case
The IPAChangeConf normallizes section names to lower case. There are
cases where this behaviour might not be desirable, so provide a way to
opt out.

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

Reviewed-By: Gabe Alford <redhatrises@gmail.com>
2015-11-26 12:18:08 +01:00
Martin Babinsky
b543c9a137 fix a typo in replica DS creation code
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-26 11:05:22 +01:00
Martin Basti
5d9a5997a1 KRA: do not stop certmonger during standalone uninstall
https://fedorahosted.org/freeipa/ticket/5477

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-26 11:00:54 +01:00
Martin Basti
6bbde3e0f7 Compare objectclasses as case insensitive in baseuser.py
Objectclasses must be handled as case insensitive.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-25 14:56:30 +01:00
Martin Basti
d43c3becbd ipa-getkeytab: do not return error when translations cannot be loaded
Only warning is shown

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-25 14:31:36 +01:00
Martin Basti
800c702324 Use absolute domain in detection of A/AAAA records
Python dns resolver append configured domain to queries which may lead
to false positive answer.

Exmaple: resolving "ipa.example.com" may return records for
"ipa.example.com.example.com" if domain is configured as "example.com"

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-11-25 14:13:26 +01:00
Simo Sorce
0f52eddd1d Return default TL_DATA is krbExtraData is missing
Signed-off-by: Simo Sorce <simo@redhat.com>

Ticket: https://fedorahosted.org/freeipa/ticket/937
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-25 14:12:11 +01:00
Martin Basti
7acfaee8ab Call directly function is_host_resolvable instead do call via framework
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-11-25 14:11:13 +01:00
Martin Basti
749dfc3917 Make command dns-resolve deprecated.
To debug DNS issues other commands should be used like 'dig', 'host',
'nslookup' instead of command 'ipa dns-resolve'.

This command is executed on server side, what may not be helpful with
debugging clients.

'ipa dns-resolve' command is worse copy of host command, users should use
'host' command instead.

dns-resolve is removed from CLI

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-11-25 14:09:02 +01:00
Martin Basti
801672cc66 Remove invalid error messages from topology upgrade
Return False does not mean that update failed, it mean that nothing has
been updated, respectively ldap is up to date.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-25 13:58:05 +01:00
Tomas Babej
1904d7cc3a private_ccache: Harden the removal of KRB5CCNAME env variable
If the code within the private_ccache contextmanager does not
set/removes the KRB5CCNAME, the pop method will raise KeyError, which
will cause unnecessary termination of the code flow.

Make sure the KRB5CCNAME is popped out of os.environ only if present.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-25 13:51:10 +01:00
Martin Basti
6eeb4e4f2a Fix upgrade of forwardzones when zone is in realmdomains
https://fedorahosted.org/freeipa/ticket/5472

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-11-25 13:39:45 +01:00
Jan Cholasta
aeffe2da42 install: drop support for Dogtag 9
Dogtag 9 CA and CA DS install and uninstall code was removed. Existing
Dogtag 9 CA and CA DS instances are disabled on upgrade.

Creating a replica of a Dogtag 9 IPA master is still supported.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-11-25 09:12:25 +01:00
Martin Basti
5427e7a8c7 Install: Force service add during replica promotion
Replica does not need to have A/AAAA records during install, so we
cannot enforce it and service must be added with --force option.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-24 18:37:15 +01:00
Martin Babinsky
ed830af693 do not disconnect when using existing connection to check default CA ACLs
https://fedorahosted.org/freeipa/ticket/5459

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-24 17:37:57 +01:00
Martin Babinsky
341406d165 disconnect ldap2 backend after adding default CA ACL profiles
ensure_default_caacl() was leaking open api.Backend.ldap2 connection which
could crash server/replica installation at later stages. This patch ensures
that after checking default CA ACL profiles the backend is disconnected.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-24 15:37:06 +01:00
Fraser Tweedale
620036d26e Add profiles and default CA ACL on migration
Profiles and the default CA ACL were not being added during replica
install from pre-4.2 servers.  Update ipa-replica-install to add
these if they are missing.

Also update the caacl plugin to prevent deletion of the default CA
ACL and instruct the administrator to disable it instead.

To ensure that the cainstance installation can add profiles, supply
the RA certificate as part of the instance configuration.
Certmonger renewal setup is avoided at this point because the NSSDB
gets reinitialised later in installation procedure.

Also move the addition of the default CA ACL from dsinstance
installation to cainstance installation.

Fixes: https://fedorahosted.org/freeipa/ticket/5459
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-24 10:12:24 +01:00
Fraser Tweedale
6fe0a89807 Do not erroneously reinit NSS in Dogtag interface
The Dogtag interface always attempts to (re)init NSS, which can fail
with SEC_ERROR_BUSY.  Do not reinitialise NSS when it has already
been initialised with the given dbdir.

Part of: https://fedorahosted.org/freeipa/ticket/5459

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-24 10:12:24 +01:00
David Kupka
2ef1eb0ae7 ipa-otptoken-import: Fix connection to ldap.
https://fedorahosted.org/freeipa/ticket/5475

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-23 15:50:16 +01:00
David Kupka
5f2cfb5aa2 ipa-cacert-renew: Fix connection to ldap.
https://fedorahosted.org/freeipa/ticket/5468

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-23 15:50:16 +01:00
Sumit Bose
657cf958c6 ipasam: fix a use-after-free issue
Since endptr points to a location inside of dummy, dummy should be freed
only after dereferencing endptr.

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-11-23 14:45:54 +01:00
Sumit Bose
99cfc979d5 ipasam: use more restrictive search filter for group lookup
Since we are interested in looking up the SID of a group it makes sense
to include the objectclass which contains the SID attribute in the
search filter. This makes sure the group is not accidentally found a
second time in the compat tree.

Related to https://fedorahosted.org/freeipa/ticket/5457

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-11-23 14:45:54 +01:00
Sumit Bose
3d6fdab904 ipasam: fix wrong usage of talloc_new()
Fixes https://fedorahosted.org/freeipa/ticket/5457

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-11-23 14:45:54 +01:00
Gabe
84e479edaa Check if IPA is configured before attempting a winsync migration
https://fedorahosted.org/freeipa/ticket/5470

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-23 13:47:36 +01:00
Martin Babinsky
8909506a88 update idrange tests to reflect disabled modification of local ID ranges
Fix for https://fedorahosted.org/freeipa/ticket/4826 temporarily disallowed
modification of local ID ranges via API calls The corresponding XMLRPC tests
were updated to reflect this change.

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2015-11-23 12:45:03 +01:00
Martin Basti
bf654aee1c remove forgotten print in DNS plugin
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-11-23 12:38:33 +01:00
Fraser Tweedale
5136cd6e4b Avoid race condition caused by profile delete and recreate
When importing IPA-managed certificate profiles into Dogtag,
profiles with the same name (usually caIPAserviceCert) are removed,
then immediately recreated with the new profile data.  This causes a
race condition - Dogtag's LDAPProfileSystem profileChangeMonitor
thread could observe and process the deletion after the profile was
recreated, disappearing it again.

Update the profile instead of deleting and recreating it to avoid
this race condition.

Fixes: https://fedorahosted.org/freeipa/ticket/5269
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-23 11:05:49 +01:00
Fraser Tweedale
2be8d2d068 TLS and Dogtag HTTPS request logging improvements
Pretty printing the TLS peer certificate to logs on every request
introduces a lot of noise; do not log it (subject name, key usage
and validity are still logged).

Fix and tidy up some HTTP logging messages for Dogtag requests.

Part of: https://fedorahosted.org/freeipa/ticket/5269

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-23 11:05:49 +01:00
Martin Basti
72b03a5d79 upgrade: fix migration of old dns forward zones
Plugins should call self.api not the global one during upgrade

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-11-20 16:44:27 +01:00
Martin Basti
457c974670 Allow multiple managers per user - CLI part
Added commands:
* user-add-manager
* user-remove-manager
* stageuser-add-manager
* stageuser-remove-manager

Commit contains override of convert_attribute_members method in baseuser
class that ensures the managers will be returned in 'manager' attribute
due to backward compatibility instead of 'manager_user' as would be
expected.

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

This patch also fixes: https://fedorahosted.org/freeipa/ticket/5387

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-20 15:35:14 +01:00
Martin Basti
c56d45bc38 Move common code of user and stageuser to baseuser postcallback
usser-add and stageuser-add contains common code that can be exported to
baseuser common postcallback

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-11-20 15:32:34 +01:00
Jan Cholasta
2d041daf17 client install: do not corrupt OpenSSH config with Match sections
https://fedorahosted.org/freeipa/ticket/5461

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-20 12:29:04 +01:00
Martin Basti
7f0d018c66 fix caching in get_ipa_config
Different opbject types were compared thus always result of comparation
was False and caching does not work.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-19 16:43:52 +01:00
Martin Babinsky
4d59a711af suppress errors arising from adding existing LDAP entries during KRA install
https://fedorahosted.org/freeipa/ticket/5346

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-19 15:04:12 +01:00
Jan Cholasta
f3076c6ab3 cert renewal: make renewal of ipaCert atomic
This prevents errors when renewing other certificates during the renewal of
ipaCert.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-11-19 13:06:12 +01:00
Jan Cholasta
164fb7b1d1 install: export KRA agent PEM file in ipa-kra-install
https://fedorahosted.org/freeipa/ticket/5462

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-19 11:17:49 +01:00
Martin Basti
e56a1535b0 CI test: Fix installation of KRA on a replica
With domain level 1 installation of KRA has been changed on replica.

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

Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2015-11-18 12:58:09 +01:00
Martin Basti
79f7c71e61 Fix CI tests domain_level env config
Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2015-11-18 12:57:09 +01:00
Lukas Slebodnik
73058af717 ipa_kdb_tests: Fix test with default krb5.conf
Default krb5.conf needn't have defined default_realm.
Unit tests should not rely on existing default value.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-18 12:55:42 +01:00
Lukas Slebodnik
75c26f9ec8 cmocka_tests: Do not use deprecated cmocka interface
The cmocka-1.0 introduced new interface for tests
which is not compatible with the old one.
And the old interface is deprecated which caused compiled warnings.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-18 12:54:43 +01:00
Lukas Slebodnik
2d39acf626 BUILD: provide check target in custom Makefiles
The automake generated makefiles have already a target check.
We need to provide this target also to non-generated
Makefiles so we can recursively call make check from
top level Makefile

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-18 12:53:26 +01:00
Lukas Slebodnik
5594205628 SPEC: Run cmocka based unit test in %check phase
This patch also consolidate build dependencies for
c based unit tests

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-18 12:52:20 +01:00
Lukas Slebodnik
be6ecac220 ipa-extdom-extop: Fix warning Wformat
In file included from ipa_extdom_extop.c:41:0:
ipa_extdom_extop.c: In function ‘ipa_extdom_init_ctx’:
ipa_extdom_extop.c:203:9: warning: format ‘%d’ expects argument of type ‘int’,
                          but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
     LOG("Maximal nss buffer size set to [%d]!\n", ctx->max_nss_buf_size);
         ^
../common/util.h:53:21: note: in definition of macro ‘LOG_PLUGIN_NAME’
                     fmt, ##__VA_ARGS__)
                     ^
ipa_extdom_extop.c:203:5: note: in expansion of macro ‘LOG’

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-13 18:37:23 +01:00
Lukas Slebodnik
08d65f54e7 topology: Fix warning Wshadow
topology_pre.c: In function ‘ipa_topo_pre_add’:
topology_pre.c:509:15: warning: declaration of ‘errtxt’ shadows a previous local [-Wshadow]
         char *errtxt;
               ^
topology_pre.c:494:11: note: shadowed declaration is here
     char *errtxt  = NULL;
           ^

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-13 18:37:23 +01:00
Lukas Slebodnik
2735db0d0e ipa_kdb_tests: Fix warning Wmissing-braces
tests/ipa_kdb_tests.c:254:9: warning: missing braces around initializer [-Wmissing-braces]
         {3, {BLACKLIST_SID"-1000", BLACKLIST_SID"-1001", BLACKLIST_SID"-1002"},
         ^
tests/ipa_kdb_tests.c:254:9: note: (near initialization for ‘test_data[6]’)
tests/ipa_kdb_tests.c:256:9: warning: missing braces around initializer [-Wmissing-braces]
         {0, NULL, 0 , NULL}
         ^
tests/ipa_kdb_tests.c:256:9: note: (near initialization for ‘test_data[7]’)
tests/ipa_kdb_tests.c:234:21: warning: missing braces around initializer [-Wmissing-braces]
     } test_data[] = {
                     ^

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-13 18:37:23 +01:00