source: rtems/c/src/lib/librpc/svc_auth.c @ 4721cf1

4.104.114.84.95
Last change on this file since 4721cf1 was 4721cf1, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 3, 1998 at 11:54:14 PM

Patch from Emmanuel Raguet <raguet@…> to add remote debug server
and RPC support to RTEMS. Thanks. :) Email follows:

Hello,

For Xmas, here is the Remote Debugger on RTEMS !

Here are 2 patches for the Remote Debugger on RTEMS for pc386 from Linux
host :

  • one for RTEMS it self,
  • one for GDB-4.17.

1/ RTEMS patch
--------------

This patch adds 2 libraries :

  • a simplified SUN RPC library
  • the Remote Debugger library

The configuration command is the following :
../rtems4/configure --target=i386-rtemself --enable-rtemsbsp=pc386
--enable-rdbg

The SUN RPC library is built only if networking is set.
The RDBG library is built if networking and enable-rdbg are set.

The function used to initialize the debugger is :

rtems_rdbg_initialize ();

A special function has been created to force a task to be
in a "debug" state : enterRdbg().
The use of this function is not mandatory.

2/ GDB-4.17 patch
-----------------

This patch create a new RTEMS target for GDB-4.17.

The configuration command is the following :
./configure --enable-shared --target=i386RTEMS

To connect to a target, use :

target rtems [your_site_address]

Then, attach the target using : attach 1

And... Debug ;)

You can obtain the original GDB-4.17 on
ftp://ftp.debian.org/debian/dists/stable/main/source/devel/gdb_4.17.orig.tar.gz

This has been tested from a Debian 2.0.1 linux host.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1
2#if !defined(lint) && defined(SCCSIDS)
3static char sccsid[] = "@(#)svc_auth.c  2.1 88/08/07 4.0 RPCSRC; from 1.19 87/08/11 Copyr 1984 Sun Micro";
4#endif
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part.  Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California  94043
32 */
33
34/*
35 * svc_auth_nodes.c, Server-side rpc authenticator interface,
36 * *WITHOUT* DES authentication.
37 *
38 * Copyright (C) 1984, Sun Microsystems, Inc.
39 */
40
41#include <rpc/rpc.h>
42
43/*
44 * svcauthsw is the bdevsw of server side authentication.
45 *
46 * Server side authenticators are called from authenticate by
47 * using the client auth struct flavor field to index into svcauthsw.
48 * The server auth flavors must implement a routine that looks 
49 * like:
50 *
51 *      enum auth_stat
52 *      flavorx_auth(rqst, msg)
53 *              register struct svc_req *rqst;
54 *              register struct rpc_msg *msg;
55 *
56 */
57
58enum auth_stat _svcauth_null();         /* no authentication */
59enum auth_stat _svcauth_unix();         /* unix style (uid, gids) */
60enum auth_stat _svcauth_short();        /* short hand unix style */
61
62static struct {
63        enum auth_stat (*authenticator)();
64} svcauthsw[] = {
65        _svcauth_null,                  /* AUTH_NULL */
66#ifdef MR
67        _svcauth_unix,                  /* AUTH_UNIX */
68        _svcauth_short                  /* AUTH_SHORT */
69#endif
70};
71
72#ifdef MR
73#define AUTH_MAX        2               /* HIGHEST AUTH NUMBER */
74#else
75#define AUTH_MAX        0               /* HIGHEST AUTH NUMBER */
76#endif
77
78
79/*
80 * The call rpc message, msg has been obtained from the wire.  The msg contains
81 * the raw form of credentials and verifiers.  authenticate returns AUTH_OK
82 * if the msg is successfully authenticated.  If AUTH_OK then the routine also
83 * does the following things:
84 * set rqst->rq_xprt->verf to the appropriate response verifier;
85 * sets rqst->rq_client_cred to the "cooked" form of the credentials.
86 *
87 * NB: rqst->rq_cxprt->verf must be pre-alloctaed;
88 * its length is set appropriately.
89 *
90 * The caller still owns and is responsible for msg->u.cmb.cred and
91 * msg->u.cmb.verf.  The authentication system retains ownership of
92 * rqst->rq_client_cred, the cooked credentials.
93 *
94 * There is an assumption that any flavour less than AUTH_NULL is
95 * invalid.
96 */
97enum auth_stat
98_authenticate(rqst, msg)
99        register struct svc_req *rqst;
100        struct rpc_msg *msg;
101{
102        register int cred_flavor;
103
104        rqst->rq_cred = msg->rm_call.cb_cred;
105        rqst->rq_xprt->xp_verf.oa_flavor = _null_auth.oa_flavor;
106        rqst->rq_xprt->xp_verf.oa_length = 0;
107        cred_flavor = rqst->rq_cred.oa_flavor;
108        if ((cred_flavor <= AUTH_MAX) && (cred_flavor >= AUTH_NULL)) {
109                return ((*(svcauthsw[cred_flavor].authenticator))(rqst, msg));
110        }
111
112        return (AUTH_REJECTEDCRED);
113}
114
115enum auth_stat
116_svcauth_null(/*rqst, msg*/)
117        /*struct svc_req *rqst;
118        struct rpc_msg *msg;*/
119{
120
121        return (AUTH_OK);
122}
Note: See TracBrowser for help on using the repository browser.