summary refs log tree commit diff
path: root/sunrpc
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2002-11-10 11:06:36 +0000
committerAndreas Jaeger <aj@suse.de>2002-11-10 11:06:36 +0000
commitfb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff (patch)
treeb6d3b7b6350601fbb8f6cbf8f820d25c0ab59cdb /sunrpc
parent55c303acb873e478540042612f1028139454d4a4 (diff)
downloadglibc-fb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff.tar.gz
glibc-fb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff.tar.xz
glibc-fb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff.zip
* nss/getXXent.c (GETFUNC_NAME): Use union type to avoid strict
aliasing problem. 
* nss/getXXbyYY_r.c (INTERNAL): Likewise. 
* nss/getnssent_r.c (__nss_getent_r): Likewise. 
(__nss_setent): Likewise. 
(__nss_getent_r): Likewise. 
* inet/getnetgrent_r.c (innetgr): Likewise. 
(__internal_setnetgrent_reuse): Likewise. 
(internal_getnetgrent_r): Likewise. 
* inet/ether_hton.c (ether_hostton): Likewise. 
* inet/ether_ntoh.c (ether_ntohost): Likewise. 
* sunrpc/netname.c (netname2user): Likewise. 
* sunrpc/publickey.c (getpublickey): Likewise. 
(getsecretkey): Likewise.
Diffstat (limited to 'sunrpc')
-rw-r--r--sunrpc/netname.c16
-rw-r--r--sunrpc/publickey.c32
2 files changed, 30 insertions, 18 deletions
diff --git a/sunrpc/netname.c b/sunrpc/netname.c
index dd275f133c..07cddb7c38 100644
--- a/sunrpc/netname.c
+++ b/sunrpc/netname.c
@@ -147,32 +147,36 @@ netname2user (const char netname[MAXNETNAMELEN + 1], uid_t * uidp, gid_t * gidp,
   static service_user *startp;
   static netname2user_function start_fct;
   service_user *nip;
-  netname2user_function fct;
+  union
+  {
+    netname2user_function f;
+    void *ptr;
+  } fct;
   enum nss_status status = NSS_STATUS_UNAVAIL;
   int no_more;
 
   if (startp == NULL)
     {
-      no_more = __nss_publickey_lookup (&nip, "netname2user", (void **) &fct);
+      no_more = __nss_publickey_lookup (&nip, "netname2user", &fct.ptr);
       if (no_more)
 	startp = (service_user *) - 1;
       else
 	{
 	  startp = nip;
-	  start_fct = fct;
+	  start_fct = fct.f;
 	}
     }
   else
     {
-      fct = start_fct;
+      fct.f = start_fct;
       no_more = (nip = startp) == (service_user *) - 1;
     }
 
   while (!no_more)
     {
-      status = (*fct) (netname, uidp, gidp, gidlenp, gidlist);
+      status = (*fct.f) (netname, uidp, gidp, gidlenp, gidlist);
 
-      no_more = __nss_next (&nip, "netname2user", (void **) &fct, status, 0);
+      no_more = __nss_next (&nip, "netname2user", &fct.ptr, status, 0);
     }
 
   return status == NSS_STATUS_SUCCESS;
diff --git a/sunrpc/publickey.c b/sunrpc/publickey.c
index ecf57bc90c..5b95edf632 100644
--- a/sunrpc/publickey.c
+++ b/sunrpc/publickey.c
@@ -42,32 +42,36 @@ getpublickey (const char *name, char *key)
   static service_user *startp;
   static public_function start_fct;
   service_user *nip;
-  public_function fct;
+  union
+  {
+    public_function f;
+    void *ptr;
+  } fct;
   enum nss_status status = NSS_STATUS_UNAVAIL;
   int no_more;
 
   if (startp == NULL)
     {
-      no_more = __nss_publickey_lookup (&nip, "getpublickey", (void **) &fct);
+      no_more = __nss_publickey_lookup (&nip, "getpublickey", &fct.ptr);
       if (no_more)
 	startp = (service_user *) -1;
       else
 	{
 	  startp = nip;
-	  start_fct = fct;
+	  start_fct = fct.f;
 	}
     }
   else
     {
-      fct = start_fct;
+      fct.f = start_fct;
       no_more = (nip = startp) == (service_user *) -1;
     }
 
   while (! no_more)
     {
-      status = (*fct) (name, key, &errno);
+      status = (*fct.f) (name, key, &errno);
 
-      no_more = __nss_next (&nip, "getpublickey", (void **) &fct, status, 0);
+      no_more = __nss_next (&nip, "getpublickey", &fct.ptr, status, 0);
     }
 
   return status == NSS_STATUS_SUCCESS;
@@ -81,32 +85,36 @@ getsecretkey (const char *name, char *key, const char *passwd)
   static service_user *startp;
   static secret_function start_fct;
   service_user *nip;
-  secret_function fct;
+  union
+  {
+    secret_function f;
+    void *ptr;
+  } fct;
   enum nss_status status = NSS_STATUS_UNAVAIL;
   int no_more;
 
   if (startp == NULL)
     {
-      no_more = __nss_publickey_lookup (&nip, "getsecretkey", (void **) &fct);
+      no_more = __nss_publickey_lookup (&nip, "getsecretkey", &fct.ptr);
       if (no_more)
 	startp = (service_user *) -1;
       else
 	{
 	  startp = nip;
-	  start_fct = fct;
+	  start_fct = fct.f;
 	}
     }
   else
     {
-      fct = start_fct;
+      fct.f = start_fct;
       no_more = (nip = startp) == (service_user *) -1;
     }
 
   while (! no_more)
     {
-      status = (*fct) (name, key, passwd, &errno);
+      status = (*fct.f) (name, key, passwd, &errno);
 
-      no_more = __nss_next (&nip, "getsecretkey", (void **) &fct, status, 0);
+      no_more = __nss_next (&nip, "getsecretkey", &fct.ptr, status, 0);
     }
 
   return status == NSS_STATUS_SUCCESS;