uclibc only defines strndup(3) if _GNU_SOURCE is defined
authorTobias Brunner <tobias@strongswan.org>
Wed, 19 Feb 2014 15:09:41 +0000 (16:09 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 19 Feb 2014 15:11:47 +0000 (16:11 +0100)
References #516.

13 files changed:
src/libcharon/config/ike_cfg.c
src/libcharon/sa/xauth/xauth_manager.c
src/libimcv/ita/ita_attr_command.c
src/libimcv/ita/ita_attr_get_settings.c
src/libimcv/ita/ita_attr_settings.c
src/libimcv/plugins/imv_os/imv_os_database.c
src/libpts/plugins/imv_attestation/imv_attestation_agent.c
src/libpts/plugins/imv_attestation/imv_attestation_process.c
src/libpts/tcg/pts/tcg_pts_attr_req_file_meas.c
src/libpts/tcg/pts/tcg_pts_attr_req_file_meta.c
src/libpts/tcg/pts/tcg_pts_attr_unix_file_meta.c
src/libstrongswan/plugins/x509/x509_cert.c
src/libtnccs/tnc/tnc.c

index cb6f6ca..c74daa0 100644 (file)
  * for more details.
  */
 
-#include "ike_cfg.h"
-
+#define _GNU_SOURCE /* for stdndup() */
 #include <string.h>
 
-#include <daemon.h>
+#include "ike_cfg.h"
 
+#include <daemon.h>
 
 ENUM(ike_version_names, IKE_ANY, IKEV2,
        "IKEv1/2",
index 17eecc2..3aabe7e 100644 (file)
@@ -13,6 +13,9 @@
  * for more details.
  */
 
+#define _GNU_SOURCE /* for stdndup() */
+#include <string.h>
+
 #include "xauth_manager.h"
 
 #include <collections/linked_list.h>
index f32ab2b..9692e1f 100644 (file)
  * for more details.
  */
 
+#define _GNU_SOURCE /* for stdndup() */
+#include <string.h>
+
 #include "ita_attr.h"
 #include "ita_attr_command.h"
 
 #include <pen/pen.h>
 #include <utils/debug.h>
 
-#include <string.h>
-
 typedef struct private_ita_attr_command_t private_ita_attr_command_t;
 
 /**
index 1966131..d0bc31d 100644 (file)
@@ -13,6 +13,9 @@
  * for more details.
  */
 
+#define _GNU_SOURCE /* for stdndup() */
+#include <string.h>
+
 #include "ita_attr.h"
 #include "ita_attr_get_settings.h"
 
@@ -22,8 +25,6 @@
 #include <pen/pen.h>
 #include <utils/debug.h>
 
-#include <string.h>
-
 typedef struct private_ita_attr_get_settings_t private_ita_attr_get_settings_t;
 
 /**
@@ -166,7 +167,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
        status = SUCCESS;
 
 end:
-       reader->destroy(reader);        
+       reader->destroy(reader);
        return status;
 }
 
@@ -182,7 +183,7 @@ METHOD(pa_tnc_attr_t, destroy, void,
 {
        if (ref_put(&this->ref))
        {
-               this->list->destroy_function(this->list, free); 
+               this->list->destroy_function(this->list, free);
                free(this->value.ptr);
                free(this);
        }
index 9ce253d..0d2967e 100644 (file)
@@ -13,6 +13,9 @@
  * for more details.
  */
 
+#define _GNU_SOURCE /* for stdndup() */
+#include <string.h>
+
 #include "ita_attr.h"
 #include "ita_attr_settings.h"
 
@@ -22,8 +25,6 @@
 #include <pen/pen.h>
 #include <utils/debug.h>
 
-#include <string.h>
-
 typedef struct private_ita_attr_settings_t private_ita_attr_settings_t;
 typedef struct entry_t entry_t;
 
@@ -211,7 +212,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
        status = SUCCESS;
 
 end:
-       reader->destroy(reader);        
+       reader->destroy(reader);
        return status;
 }
 
@@ -227,7 +228,7 @@ METHOD(pa_tnc_attr_t, destroy, void,
 {
        if (ref_put(&this->ref))
        {
-               this->list->destroy_function(this->list, (void*)free_entry);    
+               this->list->destroy_function(this->list, (void*)free_entry);
                free(this->value.ptr);
                free(this);
        }
index d2a08b0..12cf207 100644 (file)
  * for more details.
  */
 
+#define _GNU_SOURCE /* for stdndup() */
+#include <string.h>
+
 #include "imv_os_database.h"
 
 #include <utils/debug.h>
 
-#include <string.h>
-
 typedef struct private_imv_os_database_t private_imv_os_database_t;
 
 /**
index f8026e2..e8c3c5e 100644 (file)
@@ -14,6 +14,9 @@
  * for more details.
  */
 
+#define _GNU_SOURCE /* for stdndup() */
+#include <string.h>
+
 #include "imv_attestation_agent.h"
 #include "imv_attestation_state.h"
 #include "imv_attestation_process.h"
index 83f74b3..e40c92a 100644 (file)
@@ -14,6 +14,9 @@
  * for more details.
  */
 
+#define _GNU_SOURCE /* for stdndup() */
+#include <string.h>
+
 #include "imv_attestation_process.h"
 
 #include <imcv.h>
index f0bc7cf..c5a2f4b 100644 (file)
@@ -13,6 +13,9 @@
  * for more details.
  */
 
+#define _GNU_SOURCE /* for stdndup() */
+#include <string.h>
+
 #include "tcg_pts_attr_req_file_meas.h"
 
 #include <pa_tnc/pa_tnc_msg.h>
@@ -20,8 +23,6 @@
 #include <bio/bio_reader.h>
 #include <utils/debug.h>
 
-#include <string.h>
-
 typedef struct private_tcg_pts_attr_req_file_meas_t private_tcg_pts_attr_req_file_meas_t;
 
 /**
index e475cd3..8d703af 100644 (file)
@@ -13,6 +13,9 @@
  * for more details.
  */
 
+#define _GNU_SOURCE /* for stdndup() */
+#include <string.h>
+
 #include "tcg_pts_attr_req_file_meta.h"
 
 #include <pa_tnc/pa_tnc_msg.h>
@@ -20,8 +23,6 @@
 #include <bio/bio_reader.h>
 #include <utils/debug.h>
 
-#include <string.h>
-
 typedef struct private_tcg_pts_attr_req_file_meta_t private_tcg_pts_attr_req_file_meta_t;
 
 /**
index f96371b..eff64c2 100644 (file)
@@ -13,6 +13,9 @@
  * for more details.
  */
 
+#define _GNU_SOURCE /* for stdndup() */
+#include <string.h>
+
 #include "tcg_pts_attr_unix_file_meta.h"
 
 #include <pa_tnc/pa_tnc_msg.h>
@@ -21,8 +24,6 @@
 #include <collections/linked_list.h>
 #include <utils/debug.h>
 
-#include <string.h>
-
 typedef struct private_tcg_pts_attr_file_meta_t private_tcg_pts_attr_file_meta_t;
 
 /**
index 09eda32..ed850e8 100644 (file)
 
 #define _GNU_SOURCE
 
-#include "x509_cert.h"
-
 #include <sys/stat.h>
 #include <time.h>
 #include <unistd.h>
 #include <string.h>
 #include <stdio.h>
 
+#include "x509_cert.h"
+
 #include <library.h>
 #include <utils/debug.h>
 #include <asn1/oid.h>
index 7cdd363..e002b10 100644 (file)
  * for more details.
  */
 
-#include "tnc.h"
-
+#define _GNU_SOURCE /* for stdndup() */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <string.h>
+
+#include "tnc.h"
 
 #include <utils/lexparser.h>
 #include <utils/debug.h>