about summary refs log tree commit diff
path: root/sunrpc/auth_unix.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-04-15 13:54:57 +0000
committerUlrich Drepper <drepper@redhat.com>1999-04-15 13:54:57 +0000
commitf8afba91cf8bf8f8324c3c88b8c368e7c2bd5894 (patch)
treedbdd5f960cf217c76d495ba44173feafae9d184f /sunrpc/auth_unix.c
parenta5486962345290853d7d42ef4a799f16bd6764e2 (diff)
downloadglibc-f8afba91cf8bf8f8324c3c88b8c368e7c2bd5894.tar.gz
glibc-f8afba91cf8bf8f8324c3c88b8c368e7c2bd5894.tar.xz
glibc-f8afba91cf8bf8f8324c3c88b8c368e7c2bd5894.zip
Update.
	* Versions.def: Add GLIBC_2.1.1 to libpthread.

	* iconvdata/Makefile (modules): Add KOI8-U.
	(distribute): Add koi8-u.c.
	(gen-8bit-gap-modules): Add koi8-u.
	* iconvdata/gconv-modules: Add KOI8-U entries.
	* iconvdata/koi8-u.c: New file.

1999-04-13  Thorsten Kukuk  <kukuk@suse.de>

	* sunrpc/auth_des.c: 64bit fixes, security fixes.
	* sunrpc/auth_none.c: Pretty print.
	* sunrpc/auth_unix.c: Likewise.
	* sunrpc/authdes_prot.c: Likewise.
	* sunrpc/authuxprot.c: Likewise.
	* sunrpc/bindrsvprt.c: Likewise.
	* sunrpc/clnt_gen.c: Likewise.
	* sunrpc/rpc/xdr.h: Likewise.
	* sunrpc/rpc/auth_des.h: Add rpc_timeval struct.
	* sunrpc/rpc_cmsg.c: Don't use *long pointers.
	* sunrpc/rtime.c: Use new rpc_timeval.
	* sunrpc/svc_authux.c: Don't use *long pointers.
	* sunrpc/svcauth_des.c: Likewise + security fixes.
	* sunrpc/xdr_mem.c: Don't use *long pointers.
	* sunrpc/xdr_rec.c: Likewise.
	* sunrpc/xdr_sizeof.c: Likewise.
	* sunrpc/xdr_stdio.c: Likewise.

1999-04-15  Ulrich Drepper  <drepper@cygnus.com>
Diffstat (limited to 'sunrpc/auth_unix.c')
-rw-r--r--sunrpc/auth_unix.c53
1 files changed, 20 insertions, 33 deletions
diff --git a/sunrpc/auth_unix.c b/sunrpc/auth_unix.c
index 9314119a70..82ef91a0de 100644
--- a/sunrpc/auth_unix.c
+++ b/sunrpc/auth_unix.c
@@ -1,4 +1,3 @@
-/* @(#)auth_unix.c	2.2 88/08/01 4.0 RPCSRC */
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  * unrestricted use provided that this legend is included on all tape
@@ -27,20 +26,16 @@
  * 2550 Garcia Avenue
  * Mountain View, California  94043
  */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
 /*
- * auth_unix.c, Implements UNIX style authentication parameters.
- *
  * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+/*
+ * auth_unix.c, Implements UNIX style authentication parameters.
  *
  * The system is very weak.  The client uses no encryption for it's
  * credentials and only sends null verifiers.  The server sends backs
  * null verifiers or optionally a verifier that suggests a new short hand
  * for the credentials.
- *
  */
 
 #include <limits.h>
@@ -63,8 +58,7 @@ static bool_t authunix_validate (AUTH *, struct opaque_auth *);
 static bool_t authunix_refresh (AUTH *);
 static void authunix_destroy (AUTH *);
 
-static struct auth_ops auth_unix_ops =
-{
+static struct auth_ops auth_unix_ops = {
   authunix_nextverf,
   authunix_marshal,
   authunix_validate,
@@ -75,14 +69,13 @@ static struct auth_ops auth_unix_ops =
 /*
  * This struct is pointed to by the ah_private field of an auth_handle.
  */
-struct audata
-  {
-    struct opaque_auth au_origcred;	/* original credentials */
-    struct opaque_auth au_shcred;	/* short hand cred */
-    u_long au_shfaults;		/* short hand cache faults */
-    char au_marshed[MAX_AUTH_BYTES];
-    u_int au_mpos;		/* xdr pos at end of marshed */
-  };
+struct audata {
+  struct opaque_auth au_origcred;	/* original credentials */
+  struct opaque_auth au_shcred;	/* short hand cred */
+  u_long au_shfaults;		/* short hand cache faults */
+  char au_marshed[MAX_AUTH_BYTES];
+  u_int au_mpos;		/* xdr pos at end of marshed */
+};
 #define	AUTH_PRIVATE(auth)	((struct audata *)auth->ah_private)
 
 static bool_t marshal_new_auth (AUTH *) internal_function;
@@ -93,12 +86,8 @@ static bool_t marshal_new_auth (AUTH *) internal_function;
  * Returns an auth handle with the given stuff in it.
  */
 AUTH *
-authunix_create (machname, uid, gid, len, aup_gids)
-     char *machname;
-     uid_t uid;
-     gid_t gid;
-     int len;
-     gid_t *aup_gids;
+authunix_create (char *machname, uid_t uid, gid_t gid, int len,
+		 gid_t *aup_gids)
 {
   struct authunix_parms aup;
   char mymem[MAX_AUTH_BYTES];
@@ -146,12 +135,13 @@ authunix_create (machname, uid, gid, len, aup_gids)
     abort ();
   au->au_origcred.oa_length = len = XDR_GETPOS (&xdrs);
   au->au_origcred.oa_flavor = AUTH_UNIX;
-  if ((au->au_origcred.oa_base = mem_alloc ((u_int) len)) == NULL)
+  au->au_origcred.oa_base = mem_alloc ((u_int) len);
+  if (au->au_origcred.oa_base == NULL)
     {
-      (void) fprintf (stderr, _("authunix_create: out of memory\n"));
+      (void) fputs (_("authunix_create: out of memory\n"), stderr);
       return NULL;
     }
-  bcopy (mymem, au->au_origcred.oa_base, (u_int) len);
+  memcpy(au->au_origcred.oa_base, mymem, (u_int) len);
 
   /*
    * set auth handle to reflect new cred.
@@ -317,13 +307,10 @@ marshal_new_auth (AUTH *auth)
   xdrmem_create (xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE);
   if ((!xdr_opaque_auth (xdrs, &(auth->ah_cred))) ||
       (!xdr_opaque_auth (xdrs, &(auth->ah_verf))))
-    {
-      perror (_("auth_none.c - Fatal marshalling problem"));
-    }
+    perror (_("auth_none.c - Fatal marshalling problem"));
   else
-    {
-      au->au_mpos = XDR_GETPOS (xdrs);
-    }
+    au->au_mpos = XDR_GETPOS (xdrs);
+
   XDR_DESTROY (xdrs);
 
   return TRUE;