Added a wrapper for globus_libc_gethostname()
authorDaniel Kouřil <kouril@ics.muni.cz>
Thu, 2 Aug 2007 12:22:59 +0000 (12:22 +0000)
committerDaniel Kouřil <kouril@ics.muni.cz>
Thu, 2 Aug 2007 12:22:59 +0000 (12:22 +0000)
org.glite.security.gss/interface/glite_gss.h
org.glite.security.gss/src/glite_gss.c

index 52caf02..ed5de59 100644 (file)
@@ -110,6 +110,9 @@ int
 edg_wll_gss_get_name(gss_cred_id_t cred, char **name);
 */
 
+int
+edg_wll_gss_gethostname(char *name, int len);
+
 #ifdef __cplusplus
 } 
 #endif
index d96b52b..893a771 100644 (file)
@@ -15,6 +15,8 @@
 #include <ares.h>
 #include <errno.h>
 
+#include <globus_common.h>
+
 #include "glite_gss.h"
 
 #define tv_sub(a,b) {\
@@ -1055,3 +1057,19 @@ edg_wll_gss_reject(int sock)
    /* XXX is it possible to cut & paste edg_wll_ssl_reject() ? */
    return 0;
 }
+
+int
+edg_wll_gss_gethostname(char *name, int len)
+{
+   int ret;
+
+   ret = globus_module_activate(GLOBUS_COMMON_MODULE);
+   if (ret != GLOBUS_SUCCESS) {
+      ret = gethostname(name, len);
+      return ret;
+   }
+   ret = globus_libc_gethostname(name, len);
+   globus_module_deactivate(GLOBUS_COMMON_MODULE);
+
+   return ret;
+}