Commit Graph

9273 Commits

Author SHA1 Message Date
Abhijeet Kasurde
3d07c889ce Added fix for notifying user about locked user account in WebUI
User in now notified about "Locked User account" message instead of
"The password or username you entered is incorrect" or any generic error
message

Fixes : https://fedorahosted.org/freeipa/ticket/5076

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-04-28 17:04:37 +02:00
Petr Viktorin
05cb4ba4e9 sysrestore: Iterate over a list of dict keys
In Python 3, dict.keys() returns a key view. It is not safe to delete
dict keys when iterating over this view.

Convert the keys to list first.

Part of the work for https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-04-28 16:22:07 +02:00
Petr Viktorin
28b0bfaefe dns plugin: Fix zone normalization under Python 3
In Python 3, str.encode('ascii') converts to bytes, and str()
(nicknamed unicode() in IPA) returns the string representation
of an object, which is b'...' for bytes.

So, unicode('...'.encode('ascii')) results in "b'...'".

Change the code to only call encode() for the error.

Part of the work for https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-04-28 16:22:07 +02:00
Petr Spacek
8689e6be51 Makefile: replace perl with sed
Perl was missing in BuildRequires anyway and it is used only on one place,
all other places are using sed.

Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
2016-04-28 14:39:31 +02:00
Abhijeet Kasurde
f61910084d Added warning to user for Internet Explorer
As Internet Explorer is not a supported browser anymore, browser Kerberos
configuration page shows warning to user about the same.

Fixes : https://fedorahosted.org/freeipa/ticket/5656

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2016-04-28 14:28:11 +02:00
Martin Basti
813aab1b8e Tasks: raise NotImplementedError for not implemented methods
Is safer to raise error than trying to find what is wrong with method
that is not correctly overriden

The new method set_hostname has been added which should be overriden on other
platforms.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-04-26 14:01:42 +02:00
Martin Basti
5e10b2eed2 Log errors from backup_and_replace hostname to logger
Without logging errors to logger  is hard to debug issue from logfile.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-04-26 14:01:42 +02:00
Martin Basti
d3ac5125ce Remove unused hostname variables
https://fedorahosted.org/freeipa/ticket/5794

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-04-26 14:01:42 +02:00
Martin Basti
30f3d198d0 Remove deprecated hostname restoration from Fedora18
This is not needed on new Fedora, because restore will not be effective.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-04-26 14:01:42 +02:00
Martin Basti
c5686295f1 Always set hostname
This prevents cases when hostname on system is set inconsistently
(transient and static hostname differs) and may cause IPA errors.

This commit ensures that all hostnames are set properly.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-04-26 14:01:42 +02:00
Martin Basti
14ee02dcbd Do not do extra search for ipasshpubkey to generate fingerprints
Host, user and idview commands do unnnecessary extra search for
ipasshpubkey attribute to generate fingerprints.

Note: Host and user plugins shows ipasshpubkey only when the attribute
is changed, idviews show ipasshpubkey always. This behavior has been
kept by this commit.

common_pre/post_callbacks were fixed in [base|stage]user modules.
common_callbacks requires the same arguments as pre/post_callbacks now
(except baseuser_find.post_common_callback)

Note2: in *-add commands there is no need for managing ipasshpubkey as
this attribute should be shown always there.

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

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2016-04-26 13:37:23 +02:00
Martin Basti
fe2ce02a6f Performace: don't download password attributes in host/user-find
For each entry in user/host-find was executed an extra search for password
attributes what has significant impact on performance (for 2000 users
there were 2000 additional searches)

http://www.freeipa.org/page/V4/Performance_Improvements

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-04-22 13:28:57 +02:00
Lukas Slebodnik
dbc3a75110 BUILD: Remove detection of libcheck
The unit test framework check has not been used in freeipa for long time
(if ever) but there was still conditional check for this framework.
It just produced confusing warning:
    Without the 'CHECK' library, you will be unable
    to run all tests in the 'make check' suite

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-22 13:21:26 +02:00
Martin Basti
586fee293f Configure httpd service from installer instead of directly from RPM
File httpd.service was created by RPM, what causes that httpd service may
fail due IPA specific configuration even if IPA wasn't installed or was
uninstalled (without erasing RPMs).

With this patch httpd service is configured by httpd.d/ipa.conf during
IPA installation and this config is removed by uninstaller, so no
residual http configuration related to IPA should stay there.

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

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2016-04-22 10:19:25 +02:00
Pavel Vomacka
822186b271 Add 'skip overlap check' checkbox to the add dns forward zone dialog
https://fedorahosted.org/freeipa/ticket/5773

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-04-22 10:11:48 +02:00
Pavel Vomacka
f446792353 Add 'skip overlap check' checkbox into add zone dialog
https://fedorahosted.org/freeipa/ticket/5773

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-04-22 10:11:48 +02:00
Petr Vobornik
a023dcbc5c ipa-client-install: fix typo in nslcd service name
related but does not implement https://fedorahosted.org/freeipa/ticket/5806

Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2016-04-22 08:02:56 +02:00
Milan Kubík
0472300dff ipatests: Add test case for requesting a certificate with full principal.
https://fedorahosted.org/freeipa/ticket/5733

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-21 17:06:54 +02:00
Milan Kubík
b0b9972213 ipatests: fix for change_principal context manager
The context manager was leaving API object disconnected when
an exception was raised inside of it. This led to resource leak
in the tests.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-21 17:06:54 +02:00
Fraser Tweedale
c2b92b5735 caacl: correctly handle full user principal name
The caacl HBAC request is correct when just the username is given,
but the full 'user@REALM' form was not handled correctly.

Fixes: https://fedorahosted.org/freeipa/ticket/5733
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2016-04-20 18:07:19 +02:00
Oleg Fayans
1c79c1ea2d Bugfixes in managed topology tests
Fixed a false negative related to replication taking some time: added
wait_for_replication call before checking for new object in replicas.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-20 17:59:11 +02:00
Oleg Fayans
1974f20aec Improve reporting of failed tests in topology test suite
https://fedorahosted.org/freeipa/ticket/5772

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-20 17:59:11 +02:00
Abhijeet Kasurde
5b81435ae2 Added description related to 'status' in ipactl man page
Fixes : https://fedorahosted.org/freeipa/ticket/5768

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-20 17:51:14 +02:00
Martin Basti
3dc3d7a610 Increase API version for 'ipamaxusernamelength' attribute change
https://fedorahosted.org/freeipa/ticket/5774

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-04-20 13:29:56 +02:00
Martin Babinsky
6baed5be75 replica-prepare: do not add PTR records if there is no IPA managed reverse zone
ipa-replica-prepare could crash during addition of replica's PTR records if
there was no reverse zone managed by IPA and 'bindinstance.find_reverse_zone'
returns an unhandled None. The code will now issue a warning and skip the PTR
record addition in this case.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-04-19 17:07:12 +02:00
Filip Skola
5dfaeca7ce Refactor test_automember_plugin, create AutomemberTracker
Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2016-04-19 10:35:13 +02:00
Abhijeet Kasurde
2a20c74633 Added fix for notifying user about Kerberos principal expiration in WebUI
- User is now notified about "Kerberos Principal expiration" message instead of
  "Wrong username or password" message.
- User is also notified about "Invalid password" message instead of
  generic error message.

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2016-04-15 17:58:04 +02:00
Pavel Vomacka
d01f7e8556 Add activate option to stage user details page
Add activate option to the action menu on stage user details page.

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

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2016-04-15 16:41:55 +02:00
Pavel Vomacka
6eb174c5e7 Add X-Frame-Options and frame-ancestors options
These two options allow preventing clickjacking attacks. They don't allow
open FreeIPA in frame, iframe or object element.

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

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2016-04-15 15:44:44 +02:00
Oleg Fayans
c061172792 Add test if replica is working after domain upgrade
Corresponds to the testcase described in
http://www.freeipa.org/page/V4/Replica_Promotion/Test_plan#Test_case:
_Replica_created_using_old_workflow_is_functional_after_domain_upgrade

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-15 15:44:09 +02:00
Martin Basti
93871bf017 Limit max username length to 255 in config-mod
This value is same as is used in user and stageuser commands.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-04-15 13:24:34 +02:00
Lenka Doudova
6468a39850 WebUI: Test creating user without private group
Test for option to create a user without private group in web UI.

Covers ticket https://fedorahosted.org/freeipa/ticket/5804

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-04-15 10:17:20 +02:00
Martin Basti
70fd78928c Use netifaces module instead of 'ip' command
Netifaces allows to get addresses from local interfaces of the host in
safer way than parsing output of the ip command.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-04-14 13:53:27 +02:00
Martin Babinsky
62bb478e11 specify type of exceeded limit when warning about truncated search results
API commands inheriting from LDAPSearch should mention which limit was
exceeded in the warning message sent with truncated results.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-13 17:52:22 +02:00
Martin Babinsky
1f0959735f differentiate between limit types when LDAP search exceeds configured limits
When LDAP search fails on exceeded limits, we should raise an specific
exception for the type of limit raised (size, time, administrative) so that
the consumer can distinguish between e.g. searches returning too many entries
and those timing out.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-13 17:52:22 +02:00
Martin Basti
b23ad42269 host-del --updatedns: print warnings instead of error
When DNS records do not exist, print warnings instead of hard error

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-13 17:47:53 +02:00
Martin Basti
54e3859595 host_del: update help for --updatedns option
Clarify that dns removes only A, AAAA, PTR, SSHFP records of the host(s) managed by IPA DNS.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-13 17:44:56 +02:00
Martin Basti
e8c8134eee host_del: remove only A, AAAA, SSHFP, PTR records
only A, AAAA, SSHPF and PTR records are managed by IPA. The other
records should be removed by user.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-13 17:44:56 +02:00
Martin Basti
1e70d6b914 host_del: split removing A/AAAA and PTR records to separate functions
This change is needed because A/AAAA and PTR record will be handled
separately.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-13 17:44:56 +02:00
Martin Basti
bea066c336 host_del: remove unneeded dnszone-show command call
This command has no effect in that block of code, dnsrecord_show is
enough for detection if records exists.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-13 17:44:56 +02:00
Martin Basti
9a0f92be0d host_del: replace dns-record find command with show
Due the configuration of dnsrecord_find, it works as dnsrecord-show,
thus it can be replaced.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-13 17:44:56 +02:00
Martin Basti
40e3a0bf63 host_del: fix removal of host records
Originally only the first A/AAAA record is removed, and one other record. This commit fixes it
and all records are removed.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-04-13 17:44:56 +02:00
Oleg Fayans
280f1ed85f Fixed a failure in legacy_client tests
https://fedorahosted.org/freeipa/ticket/5800

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-13 16:05:12 +02:00
Martin Basti
d9fe502e83 Add missing pre_common_callback to stageuser_add
This pre_callback contains method to preprocessing usercertificate that
was not called during stageuser-add. This commit adds missing
pre_common_callback call to stageuser_add.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-12 10:09:12 +02:00
Oleg Fayans
ab3b4a92a8 Added 5 more tests to Replica Promotion testsuite
The following testcases were automated:
1. Test one command replica installation
2. Test csreplica-manage-(del, connect, disconnect) are disabled in domain
level 1
3. Client enrollment and replica promotion by an unprivileged user are
prohibited
4. Replica uninstallation is prohibited if it disconnects a part of existing
topology (is possible only with --ignore-topology-disconnect option)
https://fedorahosted.org/freeipa/ticket/5723

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-04-06 16:02:55 +02:00
Oleg Fayans
f836ee7b9c Added a kdestroy call to clean ccache at master/client uninstallation
https://fedorahosted.org/freeipa/ticket/5741

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2016-04-06 15:59:22 +02:00
Filip Skola
49c015b2ed Refactor test_hostgroup_plugin
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-03-24 14:38:22 +01:00
Filip Skola
ab3f652dc1 Refactor test_nesting, create HostGroupTracker
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-03-24 14:36:55 +01:00
Martin Babinsky
7febe569ce otptoken-add: improve the robustness of QR code printing
The python-qrcode print_ascii() method does not work in terminals with
non-UTF-8 encoding. When this is the case do not render QR code but print a
warning instead. Also print a warning when the QR code size is greater that
terminal width if the output is a tty.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-03-24 14:35:19 +01:00
Oleg Fayans
2fa0952603 Fixed a bug with prepare_host failing upon existing ipatests folder
https://fedorahosted.org/freeipa/ticket/5748

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-03-23 17:19:21 +01:00