On Thu, Mar 10, 2016 at 08:37:23PM +0100, Lukas Slebodnik wrote:
On (10/03/16 20:02), Jakub Hrozek wrote:
>On Thu, Mar 10, 2016 at 12:53:44PM +0100, Lukas Slebodnik wrote:
>> diff --git a/Makefile.am b/Makefile.am
>> index d6eb0fc..f8111d0 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -946,6 +946,10 @@ libipa_hbac_la_DEPENDENCIES =
src/providers/ipa/ipa_hbac.exports
>> libipa_hbac_la_SOURCES = \
>> src/providers/ipa/hbac_evaluator.c \
>> src/util/sss_utf8.c
>> +libipa_hbac_la_CFLAGS = \
>> + $(AM_CFLAGS) \
>> + -std=c90 \
>> + $(NULL)
>> libipa_hbac_la_LIBADD = \
>> $(UNICODE_LIBS)
>> libipa_hbac_la_LDFLAGS = \
>> diff --git a/src/util/sss_utf8.c b/src/util/sss_utf8.c
>> index 7ba11ca..722f28d 100644
>> --- a/src/util/sss_utf8.c
>> +++ b/src/util/sss_utf8.c
>> @@ -22,6 +22,9 @@
>>
>> #include "config.h"
>>
>> +#include <string.h>
>> +#include <errno.h>
>> +
>> #ifdef HAVE_LIBUNISTRING
>> #include <unistr.h>
>> #include <unicase.h>
>> diff --git a/src/util/sss_utf8.h b/src/util/sss_utf8.h
>> index 95b085f..bca9b2c 100644
>> --- a/src/util/sss_utf8.h
>> +++ b/src/util/sss_utf8.h
>> @@ -23,12 +23,15 @@
>> #ifndef SSS_UTF8_H_
>> #define SSS_UTF8_H_
>>
>> -#include "util/util.h"
>> -
>> #ifndef ENOMATCH
>> #define ENOMATCH -1
>> #endif
>>
>> +#include <stdint.h>
>> +#include <stdbool.h>
>> +
>> +#include "util/util_errors.h"
>> +
>> void sss_utf8_free(void *ptr);
>>
>> /* The result must be freed with sss_utf8_free() */
>
>According to make V=1 output, this seems to work:
>
>/bin/sh ./libtool --tag=CC --mode=compile /usr/bin/gcc -DHAVE_CONFIG_H -I.
-I/home/remote/jhrozek/devel/sssd -Wall -I..
-I/home/remote/jhrozek/devel/sssd/src/sss_client -I/home/remote/jhrozek/devel/sssd/src -I.
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/libnl3
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DLIBDIR=\"/usr/lib64\"
-DVARDIR=\"/var\" -DSSS_STATEDIR=\"/var
>/lib/sss\" -DSYSCONFDIR=\"/etc\" -DSHLIBEXT=\"\"
-DSSSD_LIBEXEC_PATH=\"/usr/libexec/sssd\"
-DSSSD_CONF_DIR=\"/etc/sssd\" -DSSS_NSS_MCACHE_DIR=\"/var/lib/sss/mc\"
-DSSS_NSS_SOCKET_NAME=\"/var/lib/sss/pipes/nss\"
-DSSS_PAM_SOCKET_NAME=\"/var/lib/sss/pipes/pam\"
-DSSS_PAC_SOCKET_NAME=\"/var/lib/sss/pipes/pac\"
-DSSS_PAM_PRIV_SOCKET_NAME=\"/var/lib/sss/pipes/private/pam\"
-DSSS_SUDO_SOCKET_NAME=\"/var/lib/sss/pipes/sudo\"
>-DSSS_AUTOFS_SOCKET_NAME=\"/var/lib/sss/pipes/autofs\"
-DSSS_SSH_SOCKET_NAME=\"/var/lib/sss/pipes/ssh\"
-DLOCALEDIR=\"/usr/share/locale\"
-DBASE_FILE_STEM=\"libipa_hbac_la-hbac_evaluator\" -Wall -Wshadow -Wst
>rict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wundef
-Werror-implicit-function-declaration -Winit-self -Wmissing-include-dirs
-fno-strict-aliasing -std=gnu99 -I/home/remote/jhrozek/devel/sssd/src/util -std=c90 -O0
-Wp,-U_FORTIFY_SOURCE -ggdb -pipe -Wall -Wextra -Wshadow -Wformat -Wformat-security
-Werror=unused-function -Wunused-variable -Wno-missing-field-initializers
-Wno-missing-field-in
>itializers -Wno-unused-parameter -Wno-cast-align -Wno-sign-compare
-Werror=implicit-function-declaration -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_FILE_OFFSET_BITS=64 -D_LAR
>GEFILE_SOURCE -D_LARGEFILE64_SOURCE -MT
src/lib/ipa_hbac/libipa_hbac_la-hbac_evaluator.lo -MD -MP -MF
src/lib/ipa_hbac/.deps/libipa_hbac_la-hbac_evaluator.Tpo -c -o
src/lib/ipa_hbac/libipa_hbac_la-hbac_evaluator
>.lo `test -f 'src/lib/ipa_hbac/hbac_evaluator.c' || echo
'/home/remote/jhrozek/devel/sssd/'`src/lib/ipa_hbac/hbac_evaluator.c
>
>When I reverted the C99 removal patch, I also got an error message:
>/home/remote/jhrozek/devel/sssd/src/lib/ipa_hbac/hbac_evaluator.c:166:5: error:
'for' loop initial declarations are only allowed in C99 or C11 mode
> for (uint32_t i = 0; rules[i]; i++) {
>
>But I had to change your diff a bit:
>diff --git a/src/util/sss_tc_utf8.c b/src/util/sss_tc_utf8.c
>index 4b2c493..44194ab 100644
>--- a/src/util/sss_tc_utf8.c
>+++ b/src/util/sss_tc_utf8.c
>@@ -19,6 +19,7 @@
> */
>
> #include <talloc.h>
>+#include "util/util.h"
> #include "util/sss_utf8.h"
>
It's possible. It was a POC to
get warning for in for loop
"for (uint32_t i = 0; rules[i]; i++)"
>Otherwise sss_tc_utf8.c wouldn't compile..
>
>Can you resubmit the patch with a nicer commit message and some comment
>in the Makefile.am?
I'm lazy.
just squash it you your 1st patch :-)
and fix other compilation issues.
I would prefer to give you credit for the suggestion, see a new patch
atop mine.
CI:
http://sssd-ci.duckdns.org/logs/job/39/02/summary.html