[SSSD] [PATCH] SDAP: add missing header files

Lukas Slebodnik lslebodn at redhat.com
Mon Oct 12 05:32:08 UTC 2015


On (11/10/15 23:11), Pavel Reichl wrote:
>Hello,
>
>while messing around with some code analyses tool I noticed that some header files are not including directly header files which they use and thus are dependent on being included in particular order.
>
>Please see simple patch attached that fixes some of such files (but definitely not all).

>From 12c273af1c8ffe727efc526c9e993240904bcbf1 Mon Sep 17 00:00:00 2001
>From: Pavel Reichl <reichl.pavel at gmail.com>
>Date: Sun, 11 Oct 2015 22:29:44 +0200
>Subject: [PATCH 1/4] SDAP: add missing header files
>
>---
> src/providers/ldap/ldap_auth.h       | 4 ++++
> src/providers/ldap/sdap_async_enum.h | 6 ++++++
> src/providers/ldap/sdap_autofs.h     | 6 ++++++
> src/providers/ldap/sdap_id_op.h      | 4 ++++
> src/providers/ldap/sdap_sudo.h       | 6 ++++++
> src/providers/ldap/sdap_users.h      | 4 ++++
> 6 files changed, 30 insertions(+)
>
>diff --git a/src/providers/ldap/ldap_auth.h b/src/providers/ldap/ldap_auth.h
>index 5fbddd7087dc65ab8bd1df5fb57492d2fc26d0bb..1848af5de19796c8287117b9afe5c6d3e1a248ec 100644
>--- a/src/providers/ldap/ldap_auth.h
>+++ b/src/providers/ldap/ldap_auth.h
>@@ -22,6 +22,10 @@
> 
> #include "config.h"
> 
>+#include <talloc.h>
>+
>+#include "util/util.h"
>+
util.h already includes talloc.h.
Could you explain why do we need to include both of them?



> enum pwexpire {
>     PWEXPIRE_NONE = 0,
>     PWEXPIRE_LDAP_PASSWORD_POLICY,
>diff --git a/src/providers/ldap/sdap_async_enum.h b/src/providers/ldap/sdap_async_enum.h
>index 2da38f988913fa0d6f252697925e50e05eb794a6..7d4ff82c5e003ffbd14aca76f321a8a0fc41b3d6 100644
>--- a/src/providers/ldap/sdap_async_enum.h
>+++ b/src/providers/ldap/sdap_async_enum.h
>@@ -26,6 +26,12 @@
> #ifndef _SDAP_ASYNC_ENUM_H_
> #define _SDAP_ASYNC_ENUM_H_
> 
>+#include "config.h"
>+
>+#include <talloc.h>
>+
>+#include "util/util.h"
>+

util.h already includes config.h and talloc.h.
Could you explain why we need to include all mentioned header files?

@see
src/util/util.h
#ifndef __SSSD_UTIL_H__
#define __SSSD_UTIL_H__

#include "config.h"
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <errno.h>
#include <libintl.h>
#include <limits.h>
#include <locale.h>
#include <time.h>
#include <pcre.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <arpa/inet.h>
#include <netinet/in.h>

#include <talloc.h>
#include <tevent.h>
#include <ldb.h>
#include <dhash.h>


LS


More information about the sssd-devel mailing list