Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSSCTL: user-checks does not show custom attributes #712

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
4 participants
@thalman
Copy link
Contributor

commented Dec 11, 2018

"sssctl user-checks" also query the IFP interface of sssd. The problem
is, that this command only displays POSIX user attrs, no matter if we
configured the InfoPipe for additional user attributes.

With this patch additional attributes are also printed out.

Resolves:
https://pagure.io/SSSD/sssd/issue/3866

SSSCTL: user-checks does not show custom attributes
"sssctl user-checks" also query the IFP interface of sssd. The problem
is, that this command only displays POSIX user attrs, no matter if we
configured the InfoPipe for additional user attributes.

With this patch additional attributes are also printed out.

Resolves:
https://pagure.io/SSSD/sssd/issue/3866

@thalman thalman requested review from jhrozek and sumit-bose Dec 11, 2018

@jhrozek

This comment has been minimized.

Copy link
Contributor

commented Jan 8, 2019

I'm getting a crash when testing this code:

#0  0x00007fdfcaefaeab in raise () from /lib64/libc.so.6
#1  0x00007fdfcaee55b9 in abort () from /lib64/libc.so.6
#2  0x00007fdfcb5a9aad in _dbus_abort.cold.0 () from /lib64/libdbus-1.so.3
#3  0x00007fdfcb5cbef0 in _dbus_warn_check_failed () from /lib64/libdbus-1.so.3
#4  0x00007fdfcb5bd7ef in dbus_message_iter_open_container () from /lib64/libdbus-1.so.3
#5  0x00007fdfcbe38f47 in sbus_copy_iterator_container (from=0x7ffc535c9490, to=0x7ffc535c94e0, type=101)
    at /sssd/src/sbus/interface/sbus_properties.c:190
#6  0x00007fdfcbe390e1 in sbus_copy_iterator_value (from=0x7ffc535c9490, to=0x7ffc535c94e0)
    at /sssd/src/sbus/interface/sbus_properties.c:264
#7  0x00007fdfcbe38f76 in sbus_copy_iterator_container (from=0x7ffc535c95b0, to=0x7ffc535c9600, type=97)
    at /sssd/src/sbus/interface/sbus_properties.c:195
#8  0x00007fdfcbe390e1 in sbus_copy_iterator_value (from=0x7ffc535c95b0, to=0x7ffc535c9600)
    at /sssd/src/sbus/interface/sbus_properties.c:264
#9  0x00007fdfcbe38f76 in sbus_copy_iterator_container (from=0x7ffc535c9720, to=0x7ffc535c96d0, type=118)
    at /sssd/src/sbus/interface/sbus_properties.c:195
#10 0x00007fdfcbe390e1 in sbus_copy_iterator_value (from=0x7ffc535c9720, to=0x7ffc535c96d0)
    at /sssd/src/sbus/interface/sbus_properties.c:264
#11 0x00007fdfcbe3923a in sbus_copy_message_to_dictionary (name=0x7fdfcc2981db "extraAttributes", msg=0x1822c90,
    to=0x1831828) at /sssd/src/sbus/interface/sbus_properties.c:308
#12 0x00007fdfcbe39e82 in sbus_properties_getall_done (subreq=0x0) at /sssd/src/sbus/interface/sbus_properties.c:658
#13 0x00007fdfcbe398ea in sbus_properties_get_done (subreq=0x0) at /sssd/src/sbus/interface/sbus_properties.c:489
#14 0x00007fdfcc2896fe in _sbus_ifp_invoke_in__out_ifp_extra_step (ev=0x17f3900, te=0x182a5f0, tv=...,
    private_data=0x182a3b0) at /sssd/src/responder/ifp/ifp_iface/sbus_ifp_invokers.c:852
#15 0x00007fdfcba0a785 in tevent_common_loop_timer_delay (ev=ev@entry=0x17f3900) at ../tevent_timed.c:369
#16 0x00007fdfcba0b87b in epoll_event_loop_once (ev=0x17f3900, location=<optimized out>) at ../tevent_epoll.c:915
#17 0x00007fdfcba09dab in std_event_loop_once (ev=0x17f3900, location=0x7fdfceb9c3bd "/sssd/src/util/server.c:724")
    at ../tevent_standard.c:114
#18 0x00007fdfcba06098 in _tevent_loop_once (ev=ev@entry=0x17f3900,
    location=location@entry=0x7fdfceb9c3bd "/sssd/src/util/server.c:724") at ../tevent.c:725
#19 0x00007fdfcba062eb in tevent_common_loop_wait (ev=0x17f3900,
---Type <return> to continue, or q <return> to quit---
    location=0x7fdfceb9c3bd "/sssd/src/util/server.c:724") at ../tevent.c:848
#20 0x00007fdfcba09d3b in std_event_loop_wait (ev=0x17f3900, location=0x7fdfceb9c3bd "/sssd/src/util/server.c:724")
    at ../tevent_standard.c:145
#21 0x00007fdfceb72593 in server_loop (main_ctx=0x17f4d90) at /sssd/src/util/server.c:724
#22 0x0000000000408d59 in main (argc=6, argv=0x7ffc535c9d18) at /sssd/src/responder/ifp/ifpsrv.c:361

But this looks like I haven't gotten to your codepath yet. Did you see the error locally as well?

@jhrozek jhrozek self-assigned this Jan 8, 2019

@thalman

This comment has been minimized.

Copy link
Contributor Author

commented Jan 8, 2019

But this looks like I haven't gotten to your codepath yet. Did you see the error locally as well?

No, I did not see this error. It worked fine in my testing environment.

@jhrozek

This comment has been minimized.

Copy link
Contributor

commented Jan 9, 2019

@pbrezina does the traceback ring a bell?

@pbrezina

This comment has been minimized.

Copy link
Member

commented Jan 11, 2019

No. Do you have a reproducer/logs?

@sumit-bose

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2019

@pbrezina, I can reproduce the crash with current master and

[ifp]
user_attributes = +telephoneNumber
...
[domain/...]
ldap_user_extra_attrs = telephoneNumber

and gdb's 'bt full' looks like:

#6  0xb71a9e8e in _dbus_warn_return_if_fail (function=function@entry=0xb71b95c0 <__func__.5027> "dbus_message_iter_open_container", 
    assertion=0xb71b8b70 "(type == DBUS_TYPE_STRUCT && contained_signature == NULL) || (type == DBUS_TYPE_DICT_ENTRY && contained_signature == NULL) || (type == DBUS_TYPE_VARIANT && contained_signature != NULL) || (type == DBU"..., 
    file=0xb71b8f45 "../../dbus/dbus-message.c", line=2973) at ../../dbus/dbus-internals.c:936
No locals.
#7  0xb7198e75 in dbus_message_iter_open_container (iter=<optimized out>, type=<optimized out>, contained_signature=<optimized out>, sub=<optimized out>) at ../../dbus/dbus-message.c:2995
        real = 0xbfe6e4f4
        contained_str = {dummy1 = 0x8e8fdd8, dummy2 = 149422160, dummy3 = 3, dummy_bit1 = 1, dummy_bit2 = 0, dummy_bit3 = 0, dummy_bits = 0}
        ret = <optimized out>
        real_sub = 0xbfe6e414
        contained_signature_validity = <optimized out>
        sub = <optimized out>
        contained_signature = <optimized out>
        type = <optimized out>
        iter = <optimized out>
        real = 0xbfe6e4f4
        real_sub = 0xbfe6e414
#8  0xb7218079 in sbus_copy_iterator_container (from=0xbfe6e52c, to=0xbfe6e4f4, type=101) at ../src/sbus/interface/sbus_properties.c:190
        from_sub = {dummy1 = 0x8e8fd98, dummy2 = 0x600000, dummy3 = 108, dummy4 = 149487064, dummy5 = 3, dummy6 = 149487064, dummy7 = 16, dummy8 = -1222850888, dummy9 = 0, dummy10 = -1222736804, dummy11 = -1222850440, 
          pad1 = -1075387084, pad2 = 0xb71a383d <dbus_type_is_container+29>, pad3 = 0x65}
        to_sub = {dummy1 = 0x0, dummy2 = 0x0, dummy3 = 0, dummy4 = 0, dummy5 = 0, dummy6 = 0, dummy7 = 0, dummy8 = 0, dummy9 = 0, dummy10 = 0, dummy11 = 0, pad1 = -1223071913, pad2 = 0xbfe6e4ac, pad3 = 0x5}
        signature = 0x8e80050 "s"
        dbret = 3072116856
        ret = -1223065022
#9  0xb72181fd in sbus_copy_iterator_value (from=0xbfe6e52c, to=0xbfe6e4f4) at ../src/sbus/interface/sbus_properties.c:264
        basic = 0x3
        dbret = 3071905225
        element_type = 8
        type = 101
        ret = 0
        __FUNCTION__ = "sbus_copy_iterator_value"
#10 0xb721809f in sbus_copy_iterator_container (from=0xbfe6e60c, to=0xbfe6e5d4, type=97) at ../src/sbus/interface/sbus_properties.c:195
        from_sub = {dummy1 = 0x8e8fd98, dummy2 = 0x600000, dummy3 = 2156, dummy4 = 149487064, dummy5 = 2, dummy6 = 149487064, dummy7 = 16, dummy8 = -1222850936, dummy9 = 16, dummy10 = -1222736804, dummy11 = -1223085850, 
          pad1 = -1222850440, pad2 = 0xb71a383d <dbus_type_is_container+29>, pad3 = 0x61}
        to_sub = {dummy1 = 0x8e87400, dummy2 = 0x4e00000, dummy3 = 221548, dummy4 = 149451840, dummy5 = 414, dummy6 = 149451840, dummy7 = 424, dummy8 = 424, dummy9 = 420, dummy10 = 414, dummy11 = -1223085888, pad1 = 149487064, 
          pad2 = 0x1, pad3 = 0x6}
        signature = 0x8e80038 "{sas}"
        dbret = 1
        ret = -1223065022
#11 0xb72181fd in sbus_copy_iterator_value (from=0xbfe6e60c, to=0xbfe6e5d4) at ../src/sbus/interface/sbus_properties.c:264
        basic = 0x3
        dbret = 3071905225
        element_type = 101
        type = 97
        ret = 0
        __FUNCTION__ = "sbus_copy_iterator_value"
#12 0xb721809f in sbus_copy_iterator_container (from=0xbfe6e6b8, to=0xbfe6e6f0, type=118) at ../src/sbus/interface/sbus_properties.c:195
        from_sub = {dummy1 = 0x8e8fd98, dummy2 = 0x600000, dummy3 = 108, dummy4 = 149487064, dummy5 = 1, dummy6 = 149487064, dummy7 = 8, dummy8 = -1222850984, dummy9 = 0, dummy10 = -1222736804, dummy11 = -1222850440, pad1 = -1075386688, 
          pad2 = 0xb71a383d <dbus_type_is_container+29>, pad3 = 0x76}
        to_sub = {dummy1 = 0x8e87400, dummy2 = 0x4e00000, dummy3 = 226924, dummy4 = 149451840, dummy5 = 419, dummy6 = 149451840, dummy7 = 420, dummy8 = 8, dummy9 = 0, dummy10 = 1, dummy11 = -1015883776, pad1 = 149496148, pad2 = 0x65, 
          pad3 = 0xb71910f9 <_dbus_header_cache_revalidate+9>}
        signature = 0x8e847f0 "a{sas}"
        dbret = 1
        ret = 21
#13 0xb72181fd in sbus_copy_iterator_value (from=0xbfe6e6b8, to=0xbfe6e6f0) at ../src/sbus/interface/sbus_properties.c:264
        basic = 0x15
        dbret = 3071899049
        element_type = 115
        type = 118
        ret = -1075386640
        __FUNCTION__ = "sbus_copy_iterator_value"
#14 0xb721831d in sbus_copy_message_to_dictionary (name=0xb726e237 "extraAttributes", msg=0x8e8fd98, to=0x8e9214c) at ../src/sbus/interface/sbus_properties.c:308
        entry = {dummy1 = 0x8e87400, dummy2 = 0x3e00000, dummy3 = 222572, dummy4 = 149420736, dummy5 = 4, dummy6 = 149451840, dummy7 = 412, dummy8 = 8, dummy9 = 0, dummy10 = 1, dummy11 = 149507240, pad1 = -1222538936, pad2 = 0x8e97d60, 
          pad3 = 0xb722d18c}
        from = {dummy1 = 0x8e8fd98, dummy2 = 0x600000, dummy3 = 108, dummy4 = 149487004, dummy5 = 21, dummy6 = 149487064, dummy7 = 0, dummy8 = -1222850792, dummy9 = 0, dummy10 = -1222736804, dummy11 = 149507304, pad1 = 149519984, 
          pad2 = 0xb6efd889 <__GI___libc_free+9>, pad3 = 0xb71e1ef8}
        dbret = 1
        ret = 0
#15 0xb7218e74 in sbus_properties_getall_done (subreq=0x0) at ../src/sbus/interface/sbus_properties.c:658
        state = 0x8e92138
        req = 0x8e92058
        ret = 0
        __FUNCTION__ = "sbus_properties_getall_done"
#16 0xb71e81d3 in tevent_req_finish (req=0x8e94ce8, state=TEVENT_REQ_DONE, location=0xb722d1e4 "../src/sbus/interface/sbus_properties.c:489") at ../tevent_req.c:162
No locals.
#17 0xb7218934 in sbus_properties_get_done (subreq=0x0) at ../src/sbus/interface/sbus_properties.c:489
        state = 0x8e94dc8
        req = 0x8e94ce8
        ret = 0
#18 0xb71e81d3 in tevent_req_finish (req=0x8e97d60, state=TEVENT_REQ_DONE, location=0xb726b014 "../src/responder/ifp/ifp_iface/sbus_ifp_invokers.c:852") at ../tevent_req.c:162
No locals.
#19 0xb72612c5 in _sbus_ifp_invoke_in__out_ifp_extra_step (ev=0x8e774f0, te=0x8e97ea0, tv=..., private_data=0x8e97d60) at ../src/responder/ifp/ifp_iface/sbus_ifp_invokers.c:852
        state = 0x8e97e40
        subreq = 0xb71e81d3 <tevent_req_finish+99>
        req = 0x8e97d60
        ret = 0

With my limited knowledge of DBus I would says that some special handling of variable arrarys might be needed in sbus_copy_iterator_container() because it tries to handle a '{sas}' array but it calls dbus_message_iter_open_container() with the signature "s" instead of "{sas}". Do I understand this correctly or can you see something else in the backtrace? Do you need any other details?

@thalman, imo all this is unrelated to your patch.

bye,
Sumit

@jhrozek

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2019

Thanks, yes, this is how I reproduced the bug as well. But while I agree the issue is not related to the patch per se, I don't know if I can test the patch without this crash being fixed?

@sumit-bose

This comment has been minimized.

Copy link
Contributor

commented Jan 16, 2019

Thanks, yes, this is how I reproduced the bug as well. But while I agree the issue is not related to the patch per se, I don't know if I can test the patch without this crash being fixed?

Yes, the patch can only be tested if the crash is fixed, I just wanted to make @thalman aware that currently there is no need to change the patch.

@pbrezina

This comment has been minimized.

Copy link
Member

commented Jan 16, 2019

Thank you Sumit. I opened: #735

@jhrozek

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2019

I'm sorry for the long delay. ACK. A test was submitted as #739

@jhrozek

This comment has been minimized.

Copy link
Contributor

commented Feb 5, 2019

@jhrozek jhrozek closed this Feb 5, 2019

@jhrozek jhrozek added the Pushed label Feb 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.