ee164913f9c12a557044eb469f4498b9be9a8f50 |
|
28-Aug-2017 |
Fabiano Fidêncio <fidencio@redhat.com> |
IPA_RULES_COMMON: Introduce ipa_common_get_hostgroupname()
By moving the get_ipa_hostgroupname() method from ipa_hbac_hosts.[ch] to
ipa_rules_common.[ch] it can be used by both HBAC and, in the future,
for new backend modules.
The method got renamed to ipa_common_get_hostgroupname() and some coding
style changes have been made in order to match with what SSSD follows.
Related:
https://pagure.io/SSSD/sssd/issue/2995
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
e17e37cd0e2109e7f1bd4ae48edfc8cca85b3f93 |
|
28-Aug-2017 |
Fabiano Fidêncio <fidencio@redhat.com> |
IPA_ACCESS: Make hbac_get_cache_rules() more generic
This method can also be reused in the future for new backend modules.
In order to make it more generic, let's just move it to
ipa_rules_common.[ch], rename it to ipa_common_get_cached_rules() and
make the rule, subtree name and the attributes to be searched new
parameters of this method.
In order to not be declaring the enourmous list of attributes HBAC uses
when calling this method, a new hbac_get_attrs_to_get_cached_rules()
method has been introduced.
Related:
https://pagure.io/SSSD/sssd/issue/2995
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
21909d3b620d97e81dd946b959a47efe88d2b7d8 |
|
28-Aug-2017 |
Fabiano Fidêncio <fidencio@redhat.com> |
IPA: Leave only HBAC specific defines in ipa_hbac_private.h
The defines that were moved can and will be used by another backend
module that will be introduced in the near future.
Related:
https://pagure.io/SSSD/sssd/issue/2995
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
9a18f78f38e274f4906af6ef8e1a82d844fde4cc |
|
28-Aug-2017 |
Fabiano Fidêncio <fidencio@redhat.com> |
IPA: Make ipa_hbac_sysdb_save() more generic
Although there's no change in the ipa_hbac_sysdb_save() itself, its name
has been changed to ipa_common_entries_and_groups_sysdb_save() and its
been split out from HBAC related files and moved to the newly created
ipa_rules_common.[ch] files, which will also be used in the future for
new backend modules.
ipa_rules_common.[ch] is not exactly the best name for those files, IMO,
but I really cannot come up with something better.
Related:
https://pagure.io/SSSD/sssd/issue/2995
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
c92e49144978ad3b6c9fffa8803ebdad8f6f5b18 |
|
26-May-2017 |
Jakub Hrozek <jhrozek@redhat.com> |
HBAC: Do not rely on originalMemberOf, use the sysdb memberof links instead
The IPA HBAC code used to read the group members from the
originalMemberOf attribute value for performance reasons. However,
especially on IPA clients trusting an AD domain, the originalMemberOf
attribute value is often not synchronized correctly.
Instead of going through the work of maintaining both member/memberOf
and originalMemberOf, let's just do an ASQ search for the group names of
the groups the user is a member of in the cache and read their
SYSBD_NAME attribute.
To avoid clashing between similarly-named groups in IPA and in AD, we
look at the container of the group.
Resolves:
https://pagure.io/SSSD/sssd/issue/3382
Reviewed-by: Sumit Bose <sbose@redhat.com> |
0ad1bcec60a2ec67a602e0ad1888f859d6009d54 |
|
07-Jul-2016 |
Sumit Bose <sbose@redhat.com> |
IPA: make get_object_from_cache() aware of UPN searches
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
dea636af4d1902a081ee891f1b19ee2f8729d759 |
|
20-Jun-2016 |
Pavel Březina <pbrezina@redhat.com> |
DP: Switch to new interface
Reviewed-by: Sumit Bose <sbose@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
e0c86d21388bffe2e3919e780780c40d96186abb |
|
12-Mar-2016 |
Jakub Hrozek <jhrozek@redhat.com> |
libipa_hbac: Move the library to src/lib/ipa_hbac
Moving the library to the lib directory will force maintainers to think
twice about changes, because it would be obvious this is a library.
Also don't use includes from sssd source tree paths, but add the util
path to Makefile's CFLAGS so that other projects can copy the
hbac_evaluator.c file verbatim.
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
6dff95bdfe437afc0b62b5270d0d84140981c786 |
|
24-Mar-2015 |
Jakub Hrozek <jhrozek@redhat.com> |
IPA: Remove the ipa_hbac_treat_deny_as option
https://fedorahosted.org/sssd/ticket/2603
Since deny rules are no longer supported on the server, the client
should no longer support them either. Remove the option.
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
c41ae115bfa808d04e729dcbd759d8aae8387ce7 |
|
24-Mar-2015 |
Jakub Hrozek <jhrozek@redhat.com> |
IPA: Only treat malformed HBAC rules as fatal if deny rules are enabled
https://fedorahosted.org/sssd/ticket/2603
If deny rules are not in effect, we can skip malformed HBAC rules
because at worst we will deny access. If deny rules are in effect, we
need to error out to be on the safe side and avoid skipping a deny rule.
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
64d8e2df816323a004bf6e7e9d05ba373b9e033d |
|
24-Mar-2015 |
Jakub Hrozek <jhrozek@redhat.com> |
IPA: Drop useless sysdb parameter
https://fedorahosted.org/sssd/ticket/2603
It's better to dereference the domain structure.
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
1243e093fd31c5660adf1bb3dd477d6935a755be |
|
24-Mar-2015 |
Jakub Hrozek <jhrozek@redhat.com> |
IPA: Use custom error codes when validating HBAC rules
https://fedorahosted.org/sssd/ticket/2603
Instead of reusing EINVAL/ENOENT, use more descriptive error codes. This
will be useful in the next patch where we act on certain codes.
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
db18dda869bc6c52a41797b2066cf121cf10f49c |
|
22-Jul-2014 |
Pavel Reichl <preichl@redhat.com> |
UTIL: rename find_subdomain_by_name
The function was named "find_subdomain" yet it could find both main
domain and subdomain.
sed 's/find_subdomain_by_name/find_domain_by_name/' -i `find . -name "*.[ch]"`
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
83bf46f4066e3d5e838a32357c201de9bd6ecdfd |
|
12-Feb-2014 |
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> |
Update DEBUG* invocations to use new levels
Use a script to update DEBUG* macro invocations, which use literal
numbers for levels, to use bitmask macros instead:
grep -rl --include '*.[hc]' DEBUG . |
while read f; do
mv "$f"{,.orig}
perl -e 'use strict;
use File::Slurp;
my @map=qw"
SSSDBG_FATAL_FAILURE
SSSDBG_CRIT_FAILURE
SSSDBG_OP_FAILURE
SSSDBG_MINOR_FAILURE
SSSDBG_CONF_SETTINGS
SSSDBG_FUNC_DATA
SSSDBG_TRACE_FUNC
SSSDBG_TRACE_LIBS
SSSDBG_TRACE_INTERNAL
SSSDBG_TRACE_ALL
";
my $text=read_file(\*STDIN);
my $repl;
$text=~s/
^
(
.*
\b
(DEBUG|DEBUG_PAM_DATA|DEBUG_GR_MEM)
\s*
\(\s*
)(
[0-9]
)(
\s*,
)
(
\s*
)
(
.*
)
$
/
$repl = $1.$map[$3].$4.$5.$6,
length($repl) <= 80
? $repl
: $1.$map[$3].$4."\n".(" " x length($1)).$6
/xmge;
print $text;
' < "$f.orig" > "$f"
rm "$f.orig"
done
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
a3c8390d19593b1e5277d95bfb4ab206d4785150 |
|
12-Feb-2014 |
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> |
Make DEBUG macro invocations variadic
Use a script to update DEBUG macro invocations to use it as a variadic
macro, supplying format string and its arguments directly, instead of
wrapping them in parens.
This script was used to update the code:
grep -rwl --include '*.[hc]' DEBUG . |
while read f; do
mv "$f"{,.orig}
perl -e \
'use strict;
use File::Slurp;
my $text=read_file(\*STDIN);
$text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs;
print $text;' < "$f.orig" > "$f"
rm "$f.orig"
done
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
e2ac9be4f293b96f3c8992f1171e44bc1da5cfca |
|
15-Nov-2013 |
Michal Zidek <mzidek@redhat.com> |
SYSDB: Drop redundant sysdb_ctx parameter from sysdb.c |
d115f40c7a3999e3cbe705a2ff9cf0fd493f80fb |
|
15-Nov-2013 |
Michal Zidek <mzidek@redhat.com> |
SYSDB: Drop the sysdb_ctx parameter - module sysdb_ops (part 2) |
4c08db0fb0dda3d27b1184248ca5c800d7ce23f0 |
|
15-Nov-2013 |
Michal Zidek <mzidek@redhat.com> |
SYSDB: Drop the sysdb_ctx parameter - module sysdb_ops (part 1) |
b8d703cf3aba81800cf1b8ccca64bb00ef0b30f7 |
|
28-Jun-2013 |
Sumit Bose <sbose@redhat.com> |
Replace new_subdomain() with find_subdomain_by_name()
new_subdomain() will create a new domain object and should not be used
anymore in the priovder code directly. Instead a reference to the domain
from the common domain object should be used. |
9f37bb2012faa136ef7c1f9fe93689ce2be85637 |
|
13-Mar-2013 |
Ondrej Kos <okos@redhat.com> |
Fix initialization of multiple variables |
b8dcd1216e5ea7065213c750a92dabfe01fa3b70 |
|
10-Feb-2013 |
Simo Sorce <simo@redhat.com> |
Add realm info to sss_domain_info |
03abdaa21ecf562b714f204ca42379ff08626f75 |
|
21-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Add be_req_get_be_ctx() helper.
In preparation for making be_req opaque |
ccc2af010bbbe6d8a7496fb717216135bc4c1993 |
|
21-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Remove domain from be_req structure |
f67c42ad2b6b23bda8232d3adb51ed75b9f30f38 |
|
21-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Remove hbac_ctx_be() |
b860f8b6b6b03982c80268e9f6fd35f6455b6b37 |
|
21-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Remove hbac_ctx_sysdb() |
e0404de84c31d2387bb244d018a5cac8d01f8b19 |
|
21-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Remove sysdb arg from [ipa_]hbac_sysdb_save()
Also make ipa_hbac_save_list() static |
18cb0d6489d01a61a2f7bf53815f53a58e9ade0d |
|
21-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Remove sysdb arg from hbac_*host_attrs_to_rule() |
0700185377ad23885cc2ddae20abe0dc36a3abca |
|
21-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Remove sysdb arg from hbac_service_attrs_to_rule() |
8a81628d58dd2991d53398a213916671e14592d8 |
|
21-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Remove sysdb argument from hbac_user_attrs_to_rule() |
044868b388b4e47499f12a9105310b247bbe1ce2 |
|
15-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Add domain arg to sysdb_search_users() |
770896b194b7b66b09c2a30545b4d091fd86b1f4 |
|
15-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Add domain argument to sysdb_search_custom()
Also changes sysdb_search_custom_by_name() |
dd7192379e5fc5bb852863e60ad4b6a20c5da183 |
|
15-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Add domain argument to sysdb_store_custom() |
2ce00e0d3896bb42db169d1e79553a81ca837a22 |
|
15-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Add domain to sysdb_search_user_by_name()
Also remove unused sysdb_search_domuser_by_name() |
9675bccabff4e79d224f64611ad9ff3e073b488e |
|
15-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Make sysdb_custom_subtree_dn() require a domain. |
de526c8425886ca3bed8f07a0f092ba5ac325654 |
|
15-Jan-2013 |
Simo Sorce <simo@redhat.com> |
Make sysdb_custom_dn() require a domain. |
94a66f84bd3c28fcabffeb84c682dccf89d89c2b |
|
19-Nov-2012 |
Sumit Bose <sbose@redhat.com> |
Do not save HBAC rules in subdomain subtree
Currently the sysdb context is pointed to the subdomain subtree
containing user the user to be checked at the beginning of a HBAC
request. As a result all HBAC rules and related data is save in the
subdomain tree as well. But since the HBAC rules of the configured
domain apply to all users it is sufficient to save them once in the
subtree of the configured domain.
Since most of the sysdb operations during a HBAC request are related to
the HBAC rules and related data this patch does not change the default
sysdb context but only create a special context to look up subdomain
users. |
95f5e7963a36b7b68859ce91ae4b232088bbaa09 |
|
24-Sep-2012 |
Jakub Hrozek <jhrozek@redhat.com> |
SYSDB: Remove unnecessary domain parameter from several sysdb calls
The domain can be read from the sysdb object. Removing the domain string
makes the API more self-contained. |
21d485184df986e1a123f70c689517386e51a5ce |
|
23-Aug-2012 |
Michal Zidek <mzidek@redhat.com> |
Unify usage of sysdb transactions
Removing bad examples of usage of sysdb_transaction_start/commit/end
functions and making it more consistent (all files except of
src/db/sysdb_*.c). |
3d8a87081a6cd197acbd355b5a39111669ec2aa6 |
|
06-Jan-2012 |
Jakub Hrozek <jhrozek@redhat.com> |
HBAC: create empty groups with one NULL element
https://fedorahosted.org/sssd/ticket/1130 |
6fb75e297bf7fc83e3db1f5ae8560624656ef319 |
|
29-Nov-2011 |
Jan Zeleny <jzeleny@redhat.com> |
Add ipa_hbac_support_srchost option to IPA provider
don't fetch all host groups if this option is false
https://fedorahosted.org/sssd/ticket/1078 |
ac3a1f3da772cf101101c31675c63dc3549b21b5 |
|
22-Nov-2011 |
Jakub Hrozek <jhrozek@redhat.com> |
Cleanup: Remove unused parameters |
c3d09c0095a45de1973f320ce2045ac74d4e4f83 |
|
17-Oct-2011 |
Jakub Hrozek <jhrozek@redhat.com> |
Add a missing break |
c1fcc832ccfc237caac8b99be238cf2d598f908c |
|
14-Oct-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
HBAC: Use originalMember for identifying hostgroups |
f5e22261a2ff95f2a61f4f199fffb8de79668110 |
|
14-Oct-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
HBAC: Use originalMember for identifying servicegroups |
64e15adc53a8316277980ab8cee7d1f2227f1898 |
|
14-Oct-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
HBAC: Do not save member/memberOf links
We can just trust the values from the FreeIPA server |
3b6d344d84274e2aa3616c74237035b0e8a2eaaf |
|
28-Sep-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
HBAC: fix typos preventing proper hostgroup evaluation |
4a6a5421113ab662a665c62ed6a24b61a5a36950 |
|
28-Sep-2011 |
Jakub Hrozek <jhrozek@redhat.com> |
Multiline macro cleanup
This is mostly a cosmetic patch.
The purpose of wrapping a multi-line macro in a do { } while(0) is to
make the macro usable as a regular statement, not a compound statement.
When the while(0) is terminated with a semicolon, the do { } while(0);
block becomes a compound statement again. |
5215f682e5beda6fa85456576237de8a5a057bb8 |
|
26-Aug-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
HBAC: Handle saving groups that have no members |
e79d23932ef9d52cf4eb32ddec2d0a9b3af9a9eb |
|
15-Aug-2011 |
Jan Zeleny <jzeleny@redhat.com> |
sysdb refactoring: memory context deleted
This patch deletes memory context parameter in those places in sysdb
where it is not necessary. The code using modified functions has been
updated. Tests updated as well. |
8a1738f9379a1b8fb5c95c3df649e014ff5a1434 |
|
15-Aug-2011 |
Jan Zeleny <jzeleny@redhat.com> |
sysdb refactoring: deleted domain variables in sysdb API
The patch also updates code using modified functions. Tests have also
been adjusted. |
1ea2e8bd370e0dc2f2c3fa09232cf67082ef748d |
|
29-Jul-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
Fix incorrect NULL check in ipa_hbac_common.c
https://fedorahosted.org/sssd/ticket/936 |
9b72b00ebcfd6225a4e139619c8e18d44a448f87 |
|
08-Jul-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
Treat NULL or empty rhost as unknown
Previously, we were assuming this meant it was coming from the
localhost, but this is not a safe assumption. We will now treat it
as unknown and it will fail to match any rule that requires a
specified srchost or group of srchosts. |
e134a6af42102c8d865e82bf89e0b8c5a40fb5fa |
|
08-Jul-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
Add helper functions for looking up HBAC rule components |