Commit Graph

4890 Commits

Author SHA1 Message Date
Rob Crittenden
98a99cbca8 Normalize the primary key value to lowercase during migration.
https://bugzilla.redhat.com/show_bug.cgi?id=804609
2012-03-22 21:47:01 +01:00
Rob Crittenden
b9c3eb79a9 Fix attributes that contain DNs when migrating.
Some attributes, like secretary and manager, may point to other LDAP
entries. We need to fix these during migration.

https://fedorahosted.org/freeipa/ticket/2562
2012-03-22 21:46:27 +01:00
Martin Kosek
5b8e1e8c62 Harden raw record processing in DNS plugin
There were cases where DNS plugin was too tolerant in a raw DNS
record option (--<rrtype-rec) processing. It let people specify
DNS record parts options in dnsrecord-mod operations for some
record without specifying the record that should be updated. It
also ignored DNS record parts in dnsrecord-add operation when the
raw DNS record value was already set via --<rrtype>-rec option.

This patch hardens the processing and returns error in both
described cases to make the processes clearer and more robust.

All these use cases were also covered by new unit tests.

https://fedorahosted.org/freeipa/ticket/2551
2012-03-22 19:30:13 +01:00
Simo Sorce
735618a1c6 Fix memleak and silence Coverity defects
Some of these are not real defects, because we are guaranteed to have valid
context in some functions, and checks are not necessary.
I added the checks anyway in order to silence Coverity on these issues.

One meleak on error condition was fixed in
daemons/ipa-kdb/ipa_kdb_pwdpolicy.c

Silence errors in ipa-client/ipa-getkeytab.c, the code looks wrong, but it is
actually fine as we count before hand so we never actually use the wrong value
that is computed on the last pass when p == 0

Fixes: https://fedorahosted.org/freeipa/ticket/2488
2012-03-22 17:33:13 +01:00
Martin Kosek
19b2af8e52 Fix precallback validators in DNS plugin
DNS plugin contains several RR type record validators run in
pre_callback which cannot be used as standard param validator
as it needs more data and resources that standard validators
provide. However, the precallback validators are not run for
DNS records created by new structured options and thus an invalid
value may slip in.

This patch moves the execution of these precallback validators
_after_ the processing of structured DNS options. It also cleans
them up a little and makes them more robust.

https://fedorahosted.org/freeipa/ticket/2550
2012-03-22 17:27:09 +01:00
Ondrej Hamada
a58cbb985e Search allowed attributes in superior objectclasses
get_allowed_attributes function was improved to look for allowed
attributes also in the superior objectclasses of specified objectclass.

This fixes the regression caused by patch for ticket #2293. Test-case
for unit-test was also created.

https://fedorahosted.org/freeipa/ticket/2293
2012-03-22 17:13:39 +01:00
Rob Crittenden
d14438405a Fix test failure testing rename with an invalid hostname.
Validation is going to catch the invalid hostname before the mod is tried.
2012-03-21 17:48:59 -04:00
Petr Viktorin
dddebe2350 Only split CSV in the client, quote instead of escaping
Splitting on commas is not an idempotent operation:
'a,b\,c' -> ('a', 'b,c') -> ('a', 'b', 'c')

That means we can't do it when the call is forwarded, so this is only
done on the CLI. The UI already sends values as a tuple.

Replace escaping in the csv parser with quoting. Quoted strings can have
embedded commas instead of having to escape them. This prevents the csv
parser from eating all escape characters.

Also, document Param's csv arguments, and update tests.

https://fedorahosted.org/freeipa/ticket/2417
https://fedorahosted.org/freeipa/ticket/2227
2012-03-20 20:03:54 -04:00
Rob Crittenden
8f71f42ef7 No longer shell escape the DM password when calling pkisilent.
pkisilent was modified to handle escaping characters itself in
BZ https://bugzilla.redhat.com/show_bug.cgi?id=769388

This removes the workaround from ticket 1636.

https://fedorahosted.org/freeipa/ticket/2529
2012-03-21 10:08:43 +01:00
Petr Vobornik
4a2f812eb4 Added mac address to host page
Part of support for ether maps.

https://fedorahosted.org/freeipa/ticket/2548
2012-03-20 17:32:23 +01:00
Petr Vobornik
661d82ad75 DNS forwarder validator
DNS forwarder's value can consist of IP address and a port.

The syntax is '<IP ADDRESS> port <PORT>'. A new validator was created for this purpose. It is based on IP address validator.

https://fedorahosted.org/freeipa/ticket/2490
2012-03-20 17:32:18 +01:00
Petr Vobornik
1b0ede0776 Add support of new options in dnsconfig
dnsconfig was extended of new attributes, so reflecting it in UI.

New attributes:
  * idnsForwardPolicy
  * idnsAllowSyncPTR
  * idnsZoneRefresh

 https://fedorahosted.org/freeipa/ticket/2489
2012-03-20 17:32:16 +01:00
Martin Kosek
9b562f7377 Add missing global options in dnsconfig
Add a support for new global options in bind-dyndb-ldap, that is:
 * idnsforwardpolicy: Default policy for conditional forwarding
 * idnsallowsyncptr: Allow globaly PTR synchronization for dynamic
   updates
 * idnszonerefresh: Default interval between regular polls of the
   name server for new DNS zones

https://fedorahosted.org/freeipa/ticket/2439
2012-03-20 15:40:08 +01:00
Martin Kosek
9d0ef96c67 Allow port numbers for idnsForwarders
Let user enter custom ports for zone conditional forwarders or
global forwarders in dnsconfig. Ports can be specified in
a standard BIND format: IP_ADDRESS [port PORT]

https://fedorahosted.org/freeipa/ticket/2462
2012-03-20 15:37:53 +01:00
Rob Crittenden
f18cfd7de8 Use a consistent parameter name in errors, defaulting to cli_name.
For general command-line errors we want to use the cli_name on output.
The exception is when using *attr, we want to return that attribute name
in the exception.

https://fedorahosted.org/freeipa/ticket/1418
2012-03-20 09:06:52 +01:00
Petr Vobornik
2449b4d827 Fixed rpm build warning - extension.js listed twice
Building the ipa rpms returns this:
warning: File listed twice: /usr/share/ipa/ui/extension.js

This is because of a glob:
%{_usr}/share/ipa/ui/*.js

and then more specifically:
%config(noreplace) %{_usr}/share/ipa/ui/extension.js

https://fedorahosted.org/freeipa/ticket/2253
2012-03-19 18:38:46 +01:00
Petr Vobornik
66692127c6 Show_content on refresh success
If an error content is displayed a successfull refresh doesn't show properly populated facet content. This patch adds show_content call to refresh success handlers which solves the problem.

https://fedorahosted.org/freeipa/ticket/2449
2012-03-19 18:37:39 +01:00
Petr Vobornik
646a4ccde3 Content is no more overwritten by error message
When an error which caused calling of report_error occurt, the content of a facet got replaced by error message. There was no way how to force the facet to recreate its content and the facet became unusable.

This patch creates a containter for an error message. On error,  report_error writes its content to error container, content container is hidden and error container is shown. Older comment in a code suggested to move the error message to facet's footer. A message in a footer could be missed by the user and on top of that a footer is sometimes used by various facet and we would have to solve the same problem again.

From experience the cause of an error is usually a missing pkey in a path. Therefore error information suggests user to navigate to top level. It causes to load default facets with default values so errors in navigation state shouldn't happen.

Facet content is displayed back on facet_show. If user tries to display same object as before facet's need_update() would return false, therefore need_update was modified to always return true if error is displayed.

Reproduction:
 1) display any nested entity - ie DNS record
 2) delete its parent pkey from path - &dnszone-pkey=example.com
 3) reload the page with this path

https://fedorahosted.org/freeipa/ticket/2449
2012-03-19 18:37:19 +01:00
Petr Viktorin
c14a2d8245 Use nose tools to check for exceptions
Some of our tests checked for exceptions using an error-prone
try block: they allowed the expected exception to pass, but sometimes
forgot an else block, so the test passed when an exception wasn't
thrown.

This changes the tests to use the appropriate nose tools (raises,
assert_raises).
For consistency, tests that had a correct else block are also changed.

Also fix some test problems that were hidden by the above:
- in some sudorule and HBAC tests, change the *_add_user argument name
  from `users` to `user`
- don't remove HBAC testing data while it was still used
2012-03-19 16:33:35 +01:00
Rob Crittenden
35521ad6bb Don't allow hosts and services of IPA masters to be disabled.
https://fedorahosted.org/freeipa/ticket/2487
2012-03-19 16:09:09 +01:00
Rob Crittenden
95df146346 Import the ipaserver plugins based on context, not env.in_server.
in_server controls how a method is dispatched, it should not also control
what plugins are imported.

This suppresses the error message "session memcached servers not running."

https://fedorahosted.org/freeipa/ticket/2499
2012-03-19 15:37:36 +01:00
Petr Viktorin
7a5ca16c74 Remove ipausers' gidnumber from tests
The ipausers group is no longer a POSIX group by default.
Reflect that in the tests.
2012-03-14 23:59:54 -04:00
Lars Sjostrom
96390ca3e5 Add disovery domain if client domain is different from server domain
https://fedorahosted.org/freeipa/ticket/2209
2012-03-14 22:06:26 -04:00
Rob Crittenden
14975cdcdd Configure a basic ldap.conf for OpenLDAP in /etc/openldap/ldap.conf
Set URI, BASE and TLS_CACERT

Also update the man page to include a list of files that the client
changes.

https://fedorahosted.org/freeipa/ticket/1810
2012-03-14 21:28:52 -04:00
Petr Vobornik
97e440bf4b Better hbactest validation message
HBAC Test validation message contains all missing values in form of list of links instead of general 'missing values' message and redirection to first missing value's facet.

When a link is clicked user is redirected to value's facet.

https://fedorahosted.org/freeipa/ticket/2182
2012-03-15 16:08:16 +01:00
Petr Vobornik
3ca0f6aee5 Fixed evaluating checkbox dirty status
Problem:
When value in checkbox is modified twice in a row (so it is at its original value) an 'undo' button is still visible even when it shouldn't be.

Cause:
IPA server sends boolean values as 'TRUE' or 'FALSE' (strings). Checkbox_widget converts them to JavaScript? boolean (true, false). Save method in checkbox_widget is returning array with a boolean. So test_dirty method always evaluates to dirty because 'FALSE' != false.

This patch is fixing the problem.

https://fedorahosted.org/freeipa/ticket/2494
2012-03-15 16:08:02 +01:00
Martin Kosek
51601ac794 Treat UPGs correctly in winsync replication
IPA winsync plugin failed to replicate users when default user group
was non-posix even though User Private Groups (UPG) were enabled
on the server. Both their uidNumber and gidNumber were empty and
they missed essential object classes. When the default user group
was made posix and UPG was disabled it did not set gidNumber to
the default group gidNumber.

This patch improves this behavior to set gidNumber correctly
according to UPG configuration and the default group status
(posix/non-posix). 4 situations can occur, the following list
specifies what value is assigned to user gidNumber:
 1) Default group posix, UPG enabled: gidNumber = UPG gidNumber
 2) Default group posix, UPG disabled: gidNumber = default
    group gidNumber
 3) Default group non-posix, UPG enabled: gidNumber = UPG gidNumber
 4) Default group non-posix, UPG disabled: an error is printed to
    the dirsrv log as the gidNumber cannot be retrieved. User
    is replicated in the same way as before this patch, i.e.
    without essential object classes.

https://fedorahosted.org/freeipa/ticket/2436
2012-03-15 09:57:37 +01:00
Rob Crittenden
1584807e02 Add subject key identifier to the dogtag server cert profile.
This will add it on upgrades too and any new certs issued will have
a subject key identifier set.

If the user has customized the profile themselves then this won't be
applied.

https://fedorahosted.org/freeipa/ticket/2446
2012-03-15 09:55:03 +01:00
Petr Vobornik
d082b64b7b Certificate serial number in hex format - ui testing data
Updated UI static content to contain value and label for certificate serial_number_hex.

https://fedorahosted.org/freeipa/ticket/1991
2012-03-14 04:40:35 -04:00
Rob Crittenden
d4a80dbe52 Display serial number as HEX (DECIMAL) when showing certificates.
https://fedorahosted.org/freeipa/ticket/1991
2012-03-14 04:40:35 -04:00
Petr Viktorin
e9d68a7b00 Don't crash when searching with empty relationship options
Empty sequences (and sequences of empty strings) are normalized
to None, but the member filter code expected a list.
This patch extends a test for missing options to also catch
false values.
The functional change is from `if param_name in options:` to
`if options.get(param_name):`; the rest of the patch is code
de-duplication and tests.

These are CSV params with csv_skipspace set, so on the CLI, empty
set is given as a string with just spaces and commas (including
the empty string).

https://fedorahosted.org/freeipa/ticket/2479
2012-03-13 23:28:53 -04:00
Rob Crittenden
17ba58aa4b Don't set dbdir in the connection until after the connection is created.
We were comparing the current connection with itself so were never
going to call nss_shutdown(). dbdir needs to be set after the connection
has been made.

This worked on single server installs because we don't do a ping so
NSS would never be pre-initialized. If multiple servers are available we
call ping() to find one that is up before submitting the request, this is
what would have pre-initialized NSS.

This was tripping up request-cert because it will intialize NSS with no DB
if it hasn't been initialized. We need to initialize it to validate the
CSR.

A non-working client was doing this when calling cert-request:
 - call load_certificate_request()
 - nss.nss_nodb_init()
 - load the CSR
 - create a connection, dbdir=/etc/pki/nssdb
 - the dbdir matches within the same connection, don't call nss_shutdown()
 - connect to remote server
 - fail, untrusted CA because we are still using db from nss_nodb_init.

Instead if we set dbdir afterward then this will properly be shutdown
and NSS re-initialized with correct dbdir.

https://fedorahosted.org/freeipa/ticket/2498
2012-03-13 22:42:12 -04:00
Rob Crittenden
0425d09fac Set SELinux boolean httpd_manage_ipa so ipa_memcached will work.
This is being done in the HTTP instance so we can set both
booleans in one step and save a bit of time (it is still slow).

https://fedorahosted.org/freeipa/ticket/2432
2012-03-13 18:04:34 -04:00
Petr Vobornik
4385816dbb Fixed checkbox value in table without pkey
When a table is displaying a record set without entity's pkey attribute. A checkbox value isn't properly prepared. This patch adds the preparation (converts value to string).

https://fedorahosted.org/freeipa/ticket/2404
2012-03-14 09:08:01 +01:00
Petr Vobornik
6066432f0d Fixed mask validation in network_validator
Network validator allowed invalid mask format:
 * leading zeros: 192.168.0.1/0024
 * trailing chars: 192.168.0.1/24abcd

It was fixed.

https://fedorahosted.org/freeipa/ticket/2493
2012-03-14 09:07:58 +01:00
Martin Kosek
75b3755648 Fix ipa-replica-manage TLS connection error
New version of openldap (openldap-2.4.26-6.fc16.x86_64) changed its
ABI and broke our TLS connection in ipa-replica-manage. This makes
it impossible to connect for example to Active Directory to set up
a winsync replication. We always receive a connection error stating
that Peer's certificate is not recognized even though we pass
a correct certificate.

This patch fixes the way we set up TLS. The change is backwards
compatible with older versions of openldap.

https://fedorahosted.org/freeipa/ticket/2500
2012-03-14 08:30:51 +01:00
Rob Crittenden
f5e5bf8f82 Fix nsslapd-anonlimitsdn dn in cn=config
The dn value needs to be quoted otherwise it is interpreted to be a
multi-value.

This will replace whatever value is currently set.

https://fedorahosted.org/freeipa/ticket/2452
2012-03-13 08:34:07 +01:00
Martin Kosek
0cb9882be9 Fix migration plugin compat check
Ticket #2274 implements a check for compat plugin and warns user if
it is enabled. However, there are 2 issues connected with the plugin:
1) The check is performed against the remote (migrated) LDAP server
   and not the local LDAP server, which does not make much sense
2) When the compat plugin is missing in cn=plugins,cn=config, it
   raises an error and thus breaks the migration
This patch fixes both issues.

https://fedorahosted.org/freeipa/ticket/2508
2012-03-11 23:50:06 -04:00
Rob Crittenden
8b2090fae6 Set minimum version of selinux-policy to pick up memcached fix
This package version adds a boolean, httpd_manage_ipa, that enables
the ipa_memcached service to work.

https://fedorahosted.org/freeipa/ticket/2433
2012-03-11 22:36:44 -04:00
Martin Kosek
c956b3cd2b Refresh resolvers after DNS install
Server framework calls acutil.res_send() to send DNS queries used
for various DNS tests. However, once acutil is imported it does
not change its list of configured resolvers even when
/etc/resolv.conf is changed. This may lead to unexpected
resolution issues.

We should at least reload httpd when we change /etc/resolv.conf to
point to FreeIPA nameserver to force a new import of acutil and
thus workaround this bug until it is resolved in authconfig.

https://fedorahosted.org/freeipa/ticket/2481
2012-03-11 22:11:41 -04:00
Petr Viktorin
79d4a34cc9 Mark most config options as required
IPA assumes most config options are present, but allowed the user
to delete them. This patch marks them as required.

https://fedorahosted.org/freeipa/ticket/2159
2012-03-12 17:16:57 +01:00
Petr Viktorin
7cfc16ca58 Enforce that required attributes can't be set to None in CRUD Update
The `required` parameter attribute didn't distinguish between cases
where the parameter is not given and all, and where the parameter is
given but empty. The case of updating a required attribute couldn't
be validated properly, because when it is given but empty, validators
don't run.
This patch introduces a new flag, 'nonempty', that specifies the
parameter can be missing (if not required), but it can't be None.
This flag gets added automatically to required parameters in CRUD
Update.
2012-03-12 17:16:14 +01:00
Petr Viktorin
1dc11a01d7 Allow removing sudo commands with special characters from command groups
Previously the commands were compared as serialized strings.
Differences in serializations meant commands with special characters
weren't found in the checked list.
Use the DN class to compare DNs correctly.

https://fedorahosted.org/freeipa/ticket/2483
2012-03-12 16:02:29 +01:00
Ondrej Hamada
71d134dfa0 More exception handlers in ipa-client-install
Added exception handler to certutil operation of adding CA to the
default NSS database. If operation fails, installation is aborted and
changes are rolled back.

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

If obtaining host TGT fails, the installation is aborted and changes are
rolled back.

https://fedorahosted.org/freeipa/ticket/1995
2012-03-09 15:48:27 +01:00
Martin Kosek
480e1a098a Ignore case in yes/no prompts
We did not accept answers like "Yes", "YES", "No", etc. as valid
answers to yes/no prompts (used for example in dnsrecord-del
interactive mode). This could confuse users. This patch changes
the behavior to ignore the answer case.

https://fedorahosted.org/freeipa/ticket/2484
2012-03-07 18:53:01 +01:00
Rob Crittenden
536bcd2666 Fix NSS no_init in the NSSHTTPS class 2012-03-04 20:03:21 -05:00
Rob Crittenden
10478ac8a1 Only warn if ipa-getkeytab doesn't get all requested enctypes.
Older client machines may request DES keys not supported in newer
KDCs. Thsi was causing the entire request to fail as well as client
enrollment.

https://fedorahosted.org/freeipa/ticket/2424
2012-03-04 17:42:18 -05:00
Rob Crittenden
55f89dc689 Do kinit in client before connecting to backend
The client installer was failing because a backend connection could be
created before a kinit was done.

Allow multiple simultaneous connections. This could fail with an NSS
shutdown error when the second connection was created (objects still
in use). If all connections currently use the same database then there
is no need to initialize, let it be skipped.

Add additional logging to client installer.

https://fedorahosted.org/freeipa/ticket/2478
2012-03-04 17:23:01 -05:00
Rob Crittenden
356823d270 Add --noac option to ipa-client-install man page
https://fedorahosted.org/freeipa/ticket/2369
2012-03-04 17:17:01 -05:00
Ondrej Hamada
111ca8a482 ipa-client-install not calling authconfig
Option '--noac' was added. If set, the ipa-client-install will not call
authconfig for setting nsswitch.conf and PAM configuration.

https://fedorahosted.org/freeipa/ticket/2369
2012-03-05 09:46:14 -05:00