mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 19:00:07 +00:00
e852e88944
1998-07-28 Ulrich Drepper <drepper@cygnus.com> * math/libm-test.c (tgamma_test): Remove redundant tests. 1998-07-28 16:20 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/glob.c: Correct problems with */foo and GLOB_NOCHECK where foo does not exist in any of the subdirectories. Reported by Paul D. Smith <psmith@BayNetworks.COM>. * posix/globtest.sh: Add test for this bug. 1998-07-28 Mark Kettenis <kettenis@phys.uva.nl> * io/sys/statfs.h: Fix typos. * io/sys/statvfs.h: Fix typos. 1998-07-28 Ulrich Drepper <drepper@cygnus.com> * version.h (VERSION): Bump to 2.0.95. * math/Makefile (libm-calls): Remove w_gamma, add w_tgamma. * math/Versions [GLIBC_2.1]: Add tgamma, tgammaf, and tgammal. * math/libm-test.c: Split old gamma_test and move half of it in new function tgamma_test. * math/bits/mathcalls.h: Add declaration of tgamma. * sysdeps/libm-ieee754/k_standard.c: Change gamma errors into tgamma errors. * sysdeps/libm-ieee754/w_gamma.c: Remove lgamma compatibility code and rename to ... * sysdeps/libm-ieee754/w_tgamma.c: ... this. New file. * sysdeps/libm-ieee754/w_gammaf.c: Remove lgammaf compatibility code and rename to ... * sysdeps/libm-ieee754/w_tgammaf.c: ... this. New file. * sysdeps/libm-ieee754/w_gammal.c: Remove lgammal compatibility code and rename to ... * sysdeps/libm-ieee754/w_tgammal.c: ... this. New file. * sysdeps/libm-ieee754/w_lgamma.c: Add gamma as weak alias. * sysdeps/libm-ieee754/w_lgammaf.c: Likewise. * sysdeps/libm-ieee754/w_lgammal.c: Likewise. * stgdio-common/printf-parse.h: Implement handling of j, t, and z modifiers. * stdio-common/vfprintf.c: Likewise. * stdio-common/vfscanf.c: Likewise. * manual/stdio.texi: Document new printf/scanf modifiers. * sysdeps/unix/sysv/linux/recvmsg.c: Remove alias __recvmsg. * sysdeps/unix/sysv/linux/sendmsg.c: Remove alias __sendmsg. 1998-07-28 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * sunrpc/Makefile (routines): Add clnt_unix and svc_unix. * sunrpc/Versions: Add new *unix_create functions. * sunrpc/clnt_gen.c: Add support for RPC over AF_UNIX. * sunrpc/clnt_unix.c: New, client side of RPC over AF_UNIX. * sunrpc/key_call.c: Use RPC over AF_UNIX for communication with keyserv daemon. * sunrpc/rpc/clnt.h: Add AF_UNIX based RPC function prototypes. * sunrpc/rpc/svc.h: Likewise. * sunrpc/svc_authux.c: Copy internal auth flavor if none is given. * sunrpc/svc_tcp.c: Fix typos. * sunrpc/svc_unix.c: New, server side of AF_UNIX based RPC. * nis/Makefile: Remove currently not working cache functions. * nis/Versions: Add __nisbind_* functions for rpc.nisd. * nis/nis_call.c: Rewrite binding to a NIS+ server to reuse CLIENT handles. * nis/nis_file.c: Fix memory leaks. * nis/nis_intern.h: Move internal structs from here ... * nis/rpcsvc/nislib.h: ... to here for NIS+ server and tools. * nis/nis_lookup.c: Try at first if last client handle works. * nis/nis_table.c: Likewise. * nis/nis_checkpoint.c: Adjust __do_niscall2 parameters. * nis/nis_mkdir.c: Likewise. * nis/nis_ping.c: Likewise. * nis/nis_rmdir.c: Likewise. * nis/nis_server.c: Likewise. * nis/nis_util.c: Likewise. * nis/nis_findserv.c (__nis_findfastest): Little optimization. 1998-07-28 Andreas Jaeger <aj@arthur.rhein-neckar.de> * stdlib/strtol.c (STRTOL_LONG_MAX): Correct typo in last patch - define as LONG_MAX. 1998-07-28 09:31 Ulrich Drepper <drepper@cygnus.com> * nscd/connections.c (gr_send_answer): Deal with missing UIO_MAXIOV. Correct test whether writev send all data. * nscd/nscd_getgr_r.c (__nscd_getgr_r): Correct test whether readv received all data. 1998-07-28 Mark Kettenis <kettenis@phys.uva.nl> * nscd/nscd_getgr_r.c (__nscd_getgr_r): Deal with missing UIO_MAXIOV. 1998-07-28 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/mach/hurd/dl-sysdep.c (open_file): Change assert call to allow mode to be 0. (__xstat): New function. (__fxstat): New function. (_dl_sysdep_read_whole_file): Removed. The implementation in `elf/dl-misc.c' now also works for the Hurd.
156 lines
4.5 KiB
C
156 lines
4.5 KiB
C
/* @(#)svc_auth_unix.c 2.3 88/08/01 4.0 RPCSRC; from 1.28 88/02/08 SMI */
|
|
/*
|
|
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
|
* unrestricted use provided that this legend is included on all tape
|
|
* media and as a part of the software program in whole or part. Users
|
|
* may copy or modify Sun RPC without charge, but are not authorized
|
|
* to license or distribute it to anyone else except as part of a product or
|
|
* program developed by the user.
|
|
*
|
|
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
|
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
|
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
|
*
|
|
* Sun RPC is provided with no support and without any obligation on the
|
|
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
|
* modification or enhancement.
|
|
*
|
|
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
|
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
|
* OR ANY PART THEREOF.
|
|
*
|
|
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
|
* or profits or other special, indirect and consequential damages, even if
|
|
* Sun has been advised of the possibility of such damages.
|
|
*
|
|
* Sun Microsystems, Inc.
|
|
* 2550 Garcia Avenue
|
|
* Mountain View, California 94043
|
|
*/
|
|
#if !defined(lint) && defined(SCCSIDS)
|
|
static char sccsid[] = "@(#)svc_auth_unix.c 1.28 88/02/08 Copyr 1984 Sun Micro";
|
|
#endif
|
|
|
|
/*
|
|
* svc_auth_unix.c
|
|
* Handles UNIX flavor authentication parameters on the service side of rpc.
|
|
* There are two svc auth implementations here: AUTH_UNIX and AUTH_SHORT.
|
|
* _svcauth_unix does full blown unix style uid,gid+gids auth,
|
|
* _svcauth_short uses a shorthand auth to index into a cache of longhand auths.
|
|
* Note: the shorthand has been gutted for efficiency.
|
|
*
|
|
* Copyright (C) 1984, Sun Microsystems, Inc.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <rpc/rpc.h>
|
|
#include <rpc/svc.h>
|
|
|
|
/*
|
|
* Unix longhand authenticator
|
|
*/
|
|
enum auth_stat
|
|
_svcauth_unix (struct svc_req *rqst, struct rpc_msg *msg)
|
|
{
|
|
enum auth_stat stat;
|
|
XDR xdrs;
|
|
struct authunix_parms *aup;
|
|
long *buf;
|
|
struct area
|
|
{
|
|
struct authunix_parms area_aup;
|
|
char area_machname[MAX_MACHINE_NAME + 1];
|
|
gid_t area_gids[NGRPS];
|
|
}
|
|
*area;
|
|
u_int auth_len;
|
|
u_int str_len, gid_len;
|
|
u_int i;
|
|
|
|
area = (struct area *) rqst->rq_clntcred;
|
|
aup = &area->area_aup;
|
|
aup->aup_machname = area->area_machname;
|
|
aup->aup_gids = area->area_gids;
|
|
auth_len = (u_int) msg->rm_call.cb_cred.oa_length;
|
|
xdrmem_create (&xdrs, msg->rm_call.cb_cred.oa_base, auth_len, XDR_DECODE);
|
|
buf = XDR_INLINE (&xdrs, auth_len);
|
|
if (buf != NULL)
|
|
{
|
|
aup->aup_time = IXDR_GET_LONG (buf);
|
|
str_len = IXDR_GET_U_LONG (buf);
|
|
if (str_len > MAX_MACHINE_NAME)
|
|
{
|
|
stat = AUTH_BADCRED;
|
|
goto done;
|
|
}
|
|
bcopy ((caddr_t) buf, aup->aup_machname, (u_int) str_len);
|
|
aup->aup_machname[str_len] = 0;
|
|
str_len = RNDUP (str_len);
|
|
buf = (u_long *) ((char *) buf + str_len);
|
|
aup->aup_uid = IXDR_GET_LONG (buf);
|
|
aup->aup_gid = IXDR_GET_LONG (buf);
|
|
gid_len = IXDR_GET_U_LONG (buf);
|
|
if (gid_len > NGRPS)
|
|
{
|
|
stat = AUTH_BADCRED;
|
|
goto done;
|
|
}
|
|
aup->aup_len = gid_len;
|
|
for (i = 0; i < gid_len; i++)
|
|
{
|
|
aup->aup_gids[i] = IXDR_GET_LONG (buf);
|
|
}
|
|
/*
|
|
* five is the smallest unix credentials structure -
|
|
* timestamp, hostname len (0), uid, gid, and gids len (0).
|
|
*/
|
|
if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len)
|
|
{
|
|
(void) printf ("bad auth_len gid %d str %d auth %d\n",
|
|
gid_len, str_len, auth_len);
|
|
stat = AUTH_BADCRED;
|
|
goto done;
|
|
}
|
|
}
|
|
else if (!xdr_authunix_parms (&xdrs, aup))
|
|
{
|
|
xdrs.x_op = XDR_FREE;
|
|
(void) xdr_authunix_parms (&xdrs, aup);
|
|
stat = AUTH_BADCRED;
|
|
goto done;
|
|
}
|
|
|
|
/* get the verifier */
|
|
if ((u_int)msg->rm_call.cb_verf.oa_length)
|
|
{
|
|
rqst->rq_xprt->xp_verf.oa_flavor =
|
|
msg->rm_call.cb_verf.oa_flavor;
|
|
rqst->rq_xprt->xp_verf.oa_base =
|
|
msg->rm_call.cb_verf.oa_base;
|
|
rqst->rq_xprt->xp_verf.oa_length =
|
|
msg->rm_call.cb_verf.oa_length;
|
|
}
|
|
else
|
|
{
|
|
rqst->rq_xprt->xp_verf.oa_flavor = AUTH_NULL;
|
|
rqst->rq_xprt->xp_verf.oa_length = 0;
|
|
}
|
|
stat = AUTH_OK;
|
|
done:
|
|
XDR_DESTROY (&xdrs);
|
|
return stat;
|
|
}
|
|
|
|
|
|
/*
|
|
* Shorthand unix authenticator
|
|
* Looks up longhand in a cache.
|
|
*/
|
|
/*ARGSUSED */
|
|
enum auth_stat
|
|
_svcauth_short (struct svc_req *rqst, struct rpc_msg *msg)
|
|
{
|
|
return AUTH_REJECTEDCRED;
|
|
}
|