getgroups.
* auth_unix.c (authunix_create_default): Use GETGROUPS_T array in
call to getgroups. Copy into array of int for call to
authunix_create. Note: If auth_unix protection ever used with this
code, we will need to cleanup assumptions in int being 32 bits in
OTW transfer of gids.
* clnt_tcp.c, svc_tcp.c: Change writetcp and readtcp to take char
* as first argument to be compatible with xdrrec_create.
* xdr.c (xdr_opaque): Cast argument in call to XDR_GETBYTES.
* svc.h: Add prototype for gssrpc_svcudp_enablecache.
* svc_auth_gssapi.c (_gssrpc_svcauth_gssapi): Change
_svcauth_gssapi to _gssrpc_svcauth_gssapi for consistancy.
* svc_auth.c: Move prototypes for _gssrpc_svcauth_{unix, null,
short, gssapi} to:
* svc_auth.h: here.
* svc_auth_unix.c: Update _gssrpc_svcauth_short and
_gssrpc_svcauth_unix to match prototype.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13563
dc483132-0cff-0310-8789-
dd5450dbe970
+2001-07-05 Ezra Peisach <epeisach@mit.edu>
+
+ * configure.in: Add AC_TYPE_GETGROUPS to determine argument to
+ getgroups.
+
+ * auth_unix.c (authunix_create_default): Use GETGROUPS_T array in
+ call to getgroups. Copy into array of int for call to
+ authunix_create. Note: If auth_unix protection ever used with this
+ code, we will need to cleanup assumptions in int being 32 bits in
+ OTW transfer of gids.
+
+ * clnt_tcp.c, svc_tcp.c: Change writetcp and readtcp to take char
+ * as first argument to be compatible with xdrrec_create.
+
+ * xdr.c (xdr_opaque): Cast argument in call to XDR_GETBYTES.
+
+ * svc.h: Add prototype for gssrpc_svcudp_enablecache.
+
+ * svc_auth_gssapi.c (_gssrpc_svcauth_gssapi): Change
+ _svcauth_gssapi to _gssrpc_svcauth_gssapi for consistancy.
+
+ * svc_auth.c: Move prototypes for _gssrpc_svcauth_{unix, null,
+ short, gssapi} to:
+ * svc_auth.h: here.
+
+ * svc_auth_unix.c: Update _gssrpc_svcauth_short and
+ _gssrpc_svcauth_unix to match prototype.
+
2001-06-28 Ezra Peisach <epeisach@mit.edu>
* auth.h: Provide full prototype for xdr_des_block.
char machname[MAX_MACHINE_NAME + 1];
register int uid;
register int gid;
- int gids[NGRPS];
+ GETGROUPS_T gids[NGRPS];
+ int igids[NGRPS], i;
if (gethostname(machname, MAX_MACHINE_NAME) == -1)
abort();
gid = getegid();
if ((len = getgroups(NGRPS, gids)) < 0)
abort();
- return (authunix_create(machname, uid, gid, len, gids));
+ for(i = 0; i < NGRPS; i++) {
+ igids[i] = gids[i];
+ }
+ return (authunix_create(machname, uid, gid, len, igids));
}
/*
XDR ct_xdrs;
};
-static int readtcp(struct ct_data *, caddr_t, int);
-static int writetcp(struct ct_data *, caddr_t, int);
+static int readtcp(char *, caddr_t, int);
+static int writetcp(char *, caddr_t, int);
/*
* around for the rpc level.
*/
static int
-readtcp(ct, buf, len)
- register struct ct_data *ct;
+readtcp(ctptr, buf, len)
+ char *ctptr;
caddr_t buf;
register int len;
{
+ register struct ct_data *ct = (struct ct_data *)ctptr;
#ifdef FD_SETSIZE
fd_set mask;
fd_set readfds;
}
static int
-writetcp(ct, buf, len)
- struct ct_data *ct;
+writetcp(ctptr, buf, len)
+ char *ctptr;
caddr_t buf;
int len;
{
+ struct ct_data *ct = (struct ct_data *)ctptr;
register int i, cnt;
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_CHECK_HEADERS(sys/uio.h)
+AC_TYPE_GETGROUPS
dnl Arrange for types.hin to include stdlib.h
AC_CHECK_HEADER(stdlib.h, [
STDLIB_INCLUDE="#include <stdlib.h>"],
*/
#define svcudp_create gssrpc_svcudp_create
#define svcudp_bufcreate gssrpc_svcudp_bufcreate
+#define svcudp_enablecache gssrpc_svcudp_enablecache
extern SVCXPRT *svcudp_create(int);
extern SVCXPRT *svcudp_bufcreate(int, unsigned int, unsigned int);
+extern int svcudp_enablecache(SVCXPRT *, rpc_u_int32);
/*
* Tcp based rpc.
*
*/
-#define _svcauth_null _gssrpc_svcauth_null
-#define _svcauth_unix _gssrpc_svcauth_unix
-#define _svcauth_short _gssrpc_svcauth_short
-
-/* no authentication */
-enum auth_stat _svcauth_null(struct svc_req *, struct rpc_msg *, bool_t *);
-/* unix style (uid, gids) */
-enum auth_stat _svcauth_unix(struct svc_req *, struct rpc_msg *, bool_t *);
-/* short hand unix style */
-enum auth_stat _svcauth_short(struct svc_req *, struct rpc_msg *, bool_t *);
-/* GSS-API style */
-enum auth_stat _svcauth_gssapi(struct svc_req *, struct rpc_msg *, bool_t *);
-
static struct svcauthsw_type {
unsigned int flavor;
enum auth_stat (*authenticator)(struct svc_req *, struct rpc_msg *,
((*((auth)->svc_ah_ops->svc_ah_unwrap))(auth, xdrs, xfunc, xwhere))
+#define _svcauth_null _gssrpc_svcauth_null
+#define _svcauth_unix _gssrpc_svcauth_unix
+#define _svcauth_short _gssrpc_svcauth_short
+#define _svcauth_gssapi _gssrpc_svcauth_gssapi
+/* no authentication */
+enum auth_stat _svcauth_null(struct svc_req *, struct rpc_msg *, bool_t *);
+/* unix style (uid, gids) */
+enum auth_stat _svcauth_unix(struct svc_req *, struct rpc_msg *, bool_t *);
+/* short hand unix style */
+enum auth_stat _svcauth_short(struct svc_req *, struct rpc_msg *, bool_t *);
+/* GSS-API style */
+enum auth_stat _svcauth_gssapi(struct svc_req *, struct rpc_msg *, bool_t *);
+
extern int errno;
-enum auth_stat _svcauth_gssapi(rqst, msg, no_dispatch)
+enum auth_stat _gssrpc_svcauth_gssapi(rqst, msg, no_dispatch)
register struct svc_req *rqst;
register struct rpc_msg *msg;
bool_t *no_dispatch;
* Unix longhand authenticator
*/
enum auth_stat
-_gssrpc_svcauth_unix(rqst, msg)
+_gssrpc_svcauth_unix(rqst, msg, dispatch)
register struct svc_req *rqst;
register struct rpc_msg *msg;
+ bool_t *dispatch;
{
register enum auth_stat stat;
XDR xdrs;
*/
/*ARGSUSED*/
enum auth_stat
-_gssrpc_svcauth_short(rqst, msg)
+_gssrpc_svcauth_short(rqst, msg, dispatch)
struct svc_req *rqst;
struct rpc_msg *msg;
+ bool_t *dispatch;
{
rqst->rq_xprt->xp_auth = &svc_auth_any;
return (AUTH_REJECTEDCRED);
svctcp_destroy
};
-static int readtcp(SVCXPRT *, caddr_t, int), writetcp(SVCXPRT *, caddr_t, int);
+static int readtcp(char *, caddr_t, int), writetcp(char *, caddr_t, int);
static SVCXPRT *makefd_xprt(int, unsigned int, unsigned int);
struct tcp_rendezvous { /* kept in xprt->xp_p1 */
* (And a read of zero bytes is a half closed stream => error.)
*/
static int
-readtcp(xprt, buf, len)
- register SVCXPRT *xprt;
+readtcp(xprtptr, buf, len)
+ char *xprtptr;
caddr_t buf;
register int len;
{
+ register SVCXPRT *xprt = (SVCXPRT *) xprtptr;
register int sock = xprt->xp_sock;
#ifdef FD_SETSIZE
fd_set mask;
* Any error is fatal and the connection is closed.
*/
static int
-writetcp(xprt, buf, len)
- register SVCXPRT *xprt;
+writetcp(xprtptr, buf, len)
+ char *xprtptr;
caddr_t buf;
int len;
{
+ register SVCXPRT *xprt = (SVCXPRT *) xprtptr;
register int i, cnt;
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
}
if (rndup == 0)
return (TRUE);
- return (XDR_GETBYTES(xdrs, crud, rndup));
+ return (XDR_GETBYTES(xdrs, (caddr_t) (void *)crud, rndup));
}
if (xdrs->x_op == XDR_ENCODE) {