[SSSD] [PATCH] IFP: Add GetUserAttrs call

Jakub Hrozek jhrozek at redhat.com
Fri Apr 25 15:55:14 UTC 2014


On Thu, Apr 24, 2014 at 01:35:09PM +0200, Lukas Slebodnik wrote:
> >+if BUILD_IFP
> >+ifp_tests_DEPENDENCIES = \
> ^^^^
> Use prefix EXTRA_ if you need memberof pluging for this test.
> Otherwise, it can break parallel build.
> We have this prefix also on other places.

This was a copy-n-paste error, I think. This test doesn't need the
memberof plugin, so I simply removed the dependencies.

> 
> >+     $(ldblib_LTLIBRARIES)
> >+ifp_tests_SOURCES = \
> >+     $(TEST_MOCK_RESP_OBJ) \
> >+    src/tests/cmocka/test_ifp.c \
> >+    src/responder/ifp/ifpsrv_cmd.c \
> >+    src/responder/ifp/ifpsrv_util.c
> >+ifp_tests_CFLAGS = \
> >+    $(AM_CFLAGS)
> >+ifp_tests_LDFLAGS = \
> >+    -Wl,-wrap,sbus_conn_send_reply \
> >+    -Wl,-wrap,dbus_message_get_sender \
> >+    -Wl,-wrap,dbus_bus_get_unix_user
> >+ifp_tests_LDADD = \
> >+    $(CMOCKA_LIBS) \
> >+    $(SSSD_LIBS) \
> >+    $(SSSD_INTERNAL_LTLIBS) \
> >+    libsss_test_common.la
> > endif

[...]

> There are warnings introduced in this last patch.
> 

Thanks, I haven't seen the warnings with clang. I can see the one in
tests with gcc, but not the first one though..did you compile with
optimizations?

> src/responder/ifp/ifpsrv_cmd.c: In function ‘ifp_user_get_attr_process’:
> src/responder/ifp/ifpsrv_cmd.c:174:38: warning: ‘res’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>          el = ldb_msg_find_element(res->msgs[0], attrs[ai]);
>                                       ^
> src/responder/ifp/ifpsrv_cmd.c:119:24: note: ‘res’ was declared here
>      struct ldb_result *res;
>                         ^

I think the warning is mostly spurious, I don't think we can reach the
response with undefined 'res'. But I added an extra check anyway,
doesn't hurt to be too defensive.

> 
> And some in tests.
> 
> src/tests/cmocka/test_ifp.c: In function ‘test_el_to_dict’:
> src/tests/cmocka/test_ifp.c:186:26: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
>      el->values[0].data = (uint8_t *) "one";
>                           ^
> src/tests/cmocka/test_ifp.c:188:26: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
>      el->values[1].data = (uint8_t *) "two";

Fixed, thanks.



More information about the sssd-devel mailing list