Commit Graph

76 Commits

Author SHA1 Message Date
Rich Megginson
068ed81195 Do not add enabled user to activated group - clean up parse_acct_disable
If a user needs to be enabled, just delete the user from the inactivated group,
but do not add to the activated group.  If a user is in no group, the user is
active by default.  IPA uses the activated group for override purposes.

parse_acct_disable is only used when the config changes, but I cleaned it
up anyway to make the code clearer.
2008-10-13 14:09:10 -04:00
Rich Megginson
69180c2dcc Adds winsync account disable and force sync 2008-10-13 14:09:08 -04:00
Rich Megginson
e8bebebc23 fix issues brought up by initial review of ipa winsync enhancements 2008-10-13 14:09:08 -04:00
Rich Megginson
5a5bfa2c70 Added support to IPA server install to install the winsync plugin configuration entry Added support to ipa-replica-manage to add winsync agreements. I mostly used the existing code for setting up replication agreements since replication and winsync are quite similar in their configuration. I just had to add some extra attributes to the sync agreement configuration. The tricky part was importing the Windows CA cert. 2008-10-13 14:09:07 -04:00
Rich Megginson
434f9aca6a Use dirsrv/file.h with includes by default - only use the other style if we are debugging within the directory server 2008-10-13 14:09:05 -04:00
Rich Megginson
4bc89c427e fix some memory leaks 2008-10-13 14:09:04 -04:00
Rich Megginson
c80ecc8c2a Added ipa-winsync-config.c - this handles dynamic configuration via the DSE callbacks, and gets default values from various configuration entries in the IPA tree 2008-10-13 14:09:04 -04:00
Rich Megginson
61b5a95dd1 Added support for posixAccount -lookup attribute containing the homeDirectory prefix and use that to construct the homeDirectory attribute -lookup attribute containing the default gidNumber and use that to add the gidNumber to new users -construct the gecos field from the cn attribute 2008-10-13 14:09:03 -04:00
Rich Megginson
6454956d51 Added the new IPA WinSync Plug-in Work done so far * added the new plugin to makefiles, spec file * added stubs for the api, including begin update, end update, and destroy callbacks * added config code to allow dynamic dse config changes and auto-discovery of realm and new user objectclass list 2008-10-13 14:09:03 -04:00
Rich Megginson
0951496593 Initial addition of ipa-winsync plugin 2008-10-13 14:09:02 -04:00
Simo Sorce
86afc680cd Retrieve the kerberos configuration every time a new, it will be a bit slower
but will allow for changing configurations without having to restart DS.
Password operations are slow and rare enough this is an acceptable compromise.
2008-09-10 15:07:17 -04:00
Simo Sorce
0c6aeee6f1 Fix segfault cause by empty target entry 2008-08-19 11:14:27 -04:00
Simo Sorce
c5b44f77a1 Comment out code that generates keys with a random salt, apparently this does not work as expected and generates faulty keys 2008-08-15 08:54:44 +02:00
Simo Sorce
0d6b6fa084 Implement password operation checks and key material generation for the
ldap add and modify operation performed on the userPassword attribute.

Add helper functions to reduce code duplication.

Do not enforce encrypted connections on ldap add/ldap mod for compatibility
reasons. (We cannot enforce people not to send the password in the clear
anyway, we can only refuse to accept it at the most which does not gain
you much if someone then re-send you the same password previously exposed)
2008-08-12 14:48:41 -04:00
Simo Sorce
1b613fafa6 Treat Jan 1 1970 in krbPrincipalExpiration as a special date that means
the account Never Expires
2008-08-07 11:50:33 -04:00
Simo Sorce
4d88900c22 Fix a stupidty introduced recently in a fix to a segfault. 2008-07-24 11:35:04 -04:00
Nathan Kinder
72a3114a01 Cleaned up comments that were mangled by vim 2008-07-18 13:11:21 -04:00
Nathan Kinder
2301f60652 Re-base memberOf plug-in off of current FDS memberOf plug-in. Resolves: 452537, 453011, 443241, 439628 2008-07-18 13:11:19 -04:00
Simo Sorce
aead1f652e If krbPasswordExpiration or krbLastPwdChange are not present on the entry
we might segfault trying a direct strcmp(), check they are not NULL.
Also fix a couple of memleaks.
2008-07-07 10:01:29 -04:00
Martin Nagy
6cce2f45e8 Fix some small issues that caused compiler warnings, like uninitialized or unused variables or missing krb5 prototypes. 2008-06-30 14:17:10 -04:00
Simo Sorce
f5d9dd647f slapi_pw_find_sv() expects an array, make sure we have a NULL terminated
one to avoid potential segfaults
Avoid leaking memory too.
2008-06-30 14:13:25 -04:00
Simo Sorce
b3ca8359ee Fix cut&paste error 2008-06-11 11:36:21 -04:00
Simo Sorce
3f4b182bc4 Let DS encode the password, this will allow IPA -> AD password
synchronization to work again.
2008-06-11 09:18:38 -04:00
Rich Megginson
2d588a8254 Fedora DS 1.1.1 exposes a public task api. In order for ipa-1-0 to build against this, ipa-memberof.c needs to be able to use the public api or the private one. 2008-05-30 13:49:46 -04:00
Simo Sorce
f32f8d6d82 Use a value that is explicitly 64bit on all architectures 2008-05-23 15:07:49 -04:00
Jim Meyering
0d2212fe2f remove useless if-before-free tests
I've been on a crusade (;-) to remove useless if-before-free tests,
so ran a script that spotted some here.  I think I removed the first
batch (without braces) automatically, then manually removed the ones
with curly braces around the free statements.

You may well have doubts about the portability of removing those
tests, but as long as you don't care about SunOS4 or earlier, you'll
be fine.  I've done similar things for e.g., coreutils, glibc, and git,
and have had no problems.
2008-05-15 12:59:28 -04:00
Jim Meyering
3256365277 * ipa_pwd_extop.c (encrypt_encode_key): Handle malloc failure. 2008-05-15 12:59:28 -04:00
Simo Sorce
d0f0d97be6 If there is an error we need to send back a reply ourselves.
Return also an intelligible error message.
2008-05-15 12:59:28 -04:00
Simo Sorce
fb3555c483 For some unknown reason the sort control returns values sorted in reverse.
Ask for inverse order to get them straight ...
2008-05-15 12:59:28 -04:00
Simo Sorce
10f0881dba Implement checks to make sure we are not assigning a number that is in use.
Change config to support a maximum value so that ranges can be defined.
Add stubs to reach out and ask to swap in new ranges and notify that new
chuncks are needed/used.
2008-05-15 12:59:28 -04:00
Simo Sorce
6f4d71d2cc Indent the plugin accordingly to our style guidelines.
Used indent -kr -nut dna.c for most of the changes
2008-05-07 14:45:46 -04:00
W. Michael Petullo
29ddbc610c This patch begins the process of replacing OpenLDAP with mozldap.
FreeIPA relies on RedHat's Directory Server, which uses mozldap.
A FreeIPA build using mozldap would reduce the project's dependencies and
redundant code. In addition, mozldap uses NSS instead of OpenSSL.
This is beneficial for the reasons listed in [1].

[1] http://fedoraproject.org/wiki/FedoraCryptoConsolidation
2008-05-01 09:59:43 -04:00
Nathan Kinder
d854d25483 Fixed various memory leaks in memberOf plug-in.
440474
2008-04-22 16:55:50 -04:00
Simo Sorce
f16d2d6e2d Password policy checks fixes.
- don't let a user set a password identical to the current one.
- don't check more then the policy defined number of passwords in history
- don't set an history longer than policy defined
2008-04-07 09:26:18 -04:00
Simo Sorce
e666bfbca7 Some more function name errors due to merge from DS own memberof plugin that
has different function names. This was a runtime linker crash bug :/
2008-03-31 17:22:37 -04:00
Simo Sorce
1737dbb174 Fix typo 2008-03-31 12:53:45 -04:00
Nathan Kinder
6340de3fb8 Avoid listing a group as a memberOf itself when a circular grouping
is created.

We basically just need to add a check to see if we're to use a group
DN as the memberOf value when performing an operation on itself for
all operation types.

439450
2008-03-28 14:18:18 -07:00
Nathan Kinder
80149d9f11 Fixed handling of modify operations that delete all present member
values without specifying the values to delete in the memberOf
plug-in.  Member entries were not being updated because the code
used the values in the mod to find the member entries to update.

The fix is to detect when a delete modify has no values specified
and just use the replace code since it compares the pre-op and
post-op copies of the group to figure out what member entries to
update.

439097
2008-03-28 08:56:06 -07:00
Nathan Kinder
07059a5ef2 Handle MODRDN operations properly for indirect group members.
Without this, an entry's memberOf attribute is not updated with
the new group DN when an indirect group is renamed.

This is in bugzilla for FDS as bz 438891.
2008-03-26 15:03:01 -07:00
Simo Sorce
f87db10a07 Purely indentiation, trailing spaces, cosmetic fixes 2008-02-21 09:36:35 -05:00
Nathan Kinder
71c21b5293 Fix bugs in handling of circular groupings in memberOf plug-in.
Resolves 432140
2008-02-14 16:27:34 -08:00
Simo Sorce
8de5f477d1 Support getting in a principal with out the REALM part 2007-12-21 15:18:43 -05:00
Simo Sorce
ed50c663e8 Big changeset that includes the work around keytab management.
Following the changelog history from my dev tree, some comments are useful imo

------------------------------------------------------

user:        Simo Sorce <ssorce@redhat.com>
date:        Fri Dec 21 03:05:36 2007 -0500
files:       ipa-server/ipa-slapi-plugins/ipa-pwd-extop/test-get-keytab.c
description:
Remove remnants of the initial test tool

changeset:   563:4fe574b7bdf1
user:        Simo Sorce <ssorce@redhat.com>
date:        Fri Dec 21 02:58:37 2007 -0500
files:       ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
description:
Maybe actually encrypting the keys will help :-)

changeset:   562:488ded41242a
user:        Simo Sorce <ssorce@redhat.com>
date:        Thu Dec 20 23:53:50 2007 -0500
files:       ipa-server/ipa-install/share/Makefile.am ipa-server/ipa-install/share/default-aci.ldif
description:
Fixes

changeset:   561:4518f6f5ecaf
user:        Simo Sorce <ssorce@redhat.com>
date:        Thu Dec 20 23:53:32 2007 -0500
files:       ipa-admintools/Makefile ipa-admintools/ipa-addservice
description:
transform the old ipa-getkeytab in a tool to add services as the new
ipa-getkeytab won't do it (and IMO it makes more sense to keep the
two functions separate anyway).

changeset:   559:25a7f8ee973d
user:        Simo Sorce <ssorce@redhat.com>
date:        Thu Dec 20 23:48:59 2007 -0500
files:       ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
description:
Bugfixes

changeset:   558:28fcabe4aeba
user:        Simo Sorce <ssorce@redhat.com>
date:        Thu Dec 20 23:48:29 2007 -0500
files:       ipa-client/configure.ac ipa-client/ipa-client.spec ipa-client/ipa-client.spec.in ipa-client/ipa-getkeytab.c
description:
Configure fixes
Add ipa-getkeytab to spec
Client fixes

changeset:   557:e92a4ffdcda4
user:        Simo Sorce <ssorce@redhat.com>
date:        Thu Dec 20 20:57:10 2007 -0500
files:       ipa-client/Makefile.am ipa-client/configure.ac
description:
Try to make ipa-getkeytab build via autotools

changeset:   556:224894175d6b
user:        Simo Sorce <ssorce@redhat.com>
date:        Thu Dec 20 20:35:56 2007 -0500
files:       ipa-admintools/ipa-getkeytab ipa-client/ipa-getkeytab.c
description:
Messed a bit with hg commands.
To make it short:
- Remove the python ipa-getkeytab program
- Rename the keytab plugin test program to ipa-getkeytab
- Put the program in ipa-client as it should be distributed with the client
  tools

changeset:   555:5e1a068f2e90
user:        Simo Sorce <ssorce@redhat.com>
date:        Thu Dec 20 20:20:40 2007 -0500
files:       ipa-server/ipa-slapi-plugins/ipa-pwd-extop/test-get-keytab.c
description:
Polish the client program

changeset:   554:0a5b19a167cf
user:        Simo Sorce <ssorce@redhat.com>
date:        Thu Dec 20 18:53:49 2007 -0500
files:       ipa-server/ipa-install/share/default-aci.ldif ipa-server/ipa-install/share/default-keytypes.ldif ipa-server/ipa-install/share/kdc.conf.template ipa-server/ipa-install/share/kerberos.ldif ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c ipa-server/ipa-slapi-plugins/ipa-pwd-extop/test-get-keytab.c ipa-server/ipaserver/krbinstance.py
description:
Support retrieving enctypes from LDAP
Filter enctypes
Update test program

changeset:   553:f75d7886cb91
user:        Simo Sorce <ssorce@redhat.com>
date:        Thu Dec 20 00:17:40 2007 -0500
files:       ipa-server/ipa-slapi-plugins/ipa-pwd-extop/test-get-keytab.c
description:
Fix ber generation and remove redundant keys

changeset:   552:0769cafe6dcd
user:        Simo Sorce <ssorce@redhat.com>
date:        Wed Dec 19 19:31:37 2007 -0500
files:       ipa-server/ipa-slapi-plugins/ipa-pwd-extop/test-get-keytab.c
description:
Avoid stupid segfault

changeset:   551:1acd5fdb5788
user:        Simo Sorce <ssorce@redhat.com>
date:        Wed Dec 19 18:39:12 2007 -0500
files:       ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
description:
If ber_peek_tag() returns LBER_ERROR it may just be that we are at the
end of the buffer. Unfortunately ber_scanf is broken in the sense that
it doesn't actually really consider sequence endings (due probably to the fact
they are just representation and do not reflect in the underlieing DER
encoding.)

changeset:   550:e974fb2726a4
user:        Simo Sorce <ssorce@redhat.com>
date:        Wed Dec 19 18:35:07 2007 -0500
files:       ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c ipa-server/ipa-slapi-plugins/ipa-pwd-extop/test-get-keytab.c
description:
First shot at the new method
2007-12-21 11:37:19 -05:00
Simo Sorce
441e9206b5 We need the OpenSSL Crypto lib for the DES and MD4 functions to generate NT
and LM hashes.
2007-12-07 19:59:27 -05:00
Simo Sorce
b04bed4e82 Min Pwd Change Time Check after Password reset and other minor fixes 2007-11-30 16:57:19 -05:00
Simo Sorce
3580d0affb Use groupOfNames and member, not groupOfUniqueNames and uniqueMember 2007-11-20 10:22:43 -05:00
Simo Sorce
56d67b86e1 Fix bad segfault when pwvals is null 2007-11-19 19:34:27 -05:00
Karl MacMillan
27b93a6944 Small fix from Rob to pwd-extop-plugin 0001-01-01 00:00:00 +00:00
Simo Sorce
f35ec78d56 - Store Master Key in Ldap (Makes it easier to set up replicas)
- Does not require dirsrv access to stash file
- Finalize password history support
- Fix strict password length default in pwd_extop (fix install sctript too)
- fix plugin configuration

- Introduce 3 kind of password change: normal, admin, and ds manager
   - normal require adherence to policies
   - admin does not but password is immediately expired
   - ds manager can just change the password any way he likes.

Initial code to read the Kerberos Master Key from the Directory
2007-11-16 20:16:11 -05:00
Simo Sorce
7502ebe479 Initial implementation of policies support.
This patch uses the kerberos schema policy, this is the same policy used by
kadmin.
While this patch allows for krbPwdPolicy objects anywhere the kldap module
will make the kdc fail to provide tickets if the "krbPwdPolicyReference"
points to any object that is not a child of cn=<REALM>,cn=kerberos,dc=....
To let us set policies anywhere in the tree I enabled the code to actually
look at parent entries and the user entry itself and specify policies directly
on these objects by adding the krbPwdPolicy objectclass to them (I know its
structural but DS seem to allow multiple Structural classes on the same
entry).
The only side effect is that kadmin will not understand this, but we don't
want to use kadmin anyway as it does not understand way too many things about the
directory.

I've tested a few scenarios and all seem working as expected, but further
testing is welcome of course.
2007-11-13 16:21:03 -05:00