[SSSD] [PATCH] Include sys/types.h for types id_t and uid_t

Lukas Slebodnik lslebodn at redhat.com
Mon Sep 2 17:12:51 UTC 2013


ehlo,

I checked some manual pages, where [ug]?id types are used and each manual page
suggest to include header file "sys/types.h". This header file was indirectly
included in some files on linux, but it is not portable.

man getgid
  #include <unistd.h>
  #include <sys/types.h>

  gid_t getgid(void);
  gid_t getegid(void);
-------------------------
man getpwuid
  #include <sys/types.h>
  #include <pwd.h>     

  struct passwd *getpwuid(uid_t uid);

Attached patch modify header file "sss_idmap.h". Should be version-info changed
for libsssidmap?

LS
-------------- next part --------------
>From 66fe50cb23d437bc394883102f0bf6c9e4878c3e Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Fri, 30 Aug 2013 23:19:11 +0200
Subject: [PATCH 1/9] Include sys/types.h for types id_t and uid_t

---
 src/lib/idmap/sss_idmap.h        | 1 +
 src/responder/pac/pacsrv_utils.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/lib/idmap/sss_idmap.h b/src/lib/idmap/sss_idmap.h
index d326469ec761b2bed48ebcf077fa69e23d7c94c4..91e5d0bf3f84037fc465b3d50520a8320f1f0910 100644
--- a/src/lib/idmap/sss_idmap.h
+++ b/src/lib/idmap/sss_idmap.h
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <stdbool.h>
+#include <sys/types.h>
 
 #define DOM_SID_PREFIX "S-1-5-21-"
 #define DOM_SID_PREFIX_LEN (sizeof(DOM_SID_PREFIX) - 1)
diff --git a/src/responder/pac/pacsrv_utils.c b/src/responder/pac/pacsrv_utils.c
index a52282c7962375cbb7ae46c44385f051e9cd53eb..05b53edee2ada79abf8bd04a6032314b68541d8e 100644
--- a/src/responder/pac/pacsrv_utils.c
+++ b/src/responder/pac/pacsrv_utils.c
@@ -18,6 +18,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
+#include <sys/types.h>
 #include <stdbool.h>
 #include <util/data_blob.h>
 #include <gen_ndr/security.h>
-- 
1.8.3.1



More information about the sssd-devel mailing list