* 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
* 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.
* Mountain View, California 94043
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)clnt_perror.c 2.1 88/07/29 4.0 RPCSRC";*/
static char *rcsid
= "$Id: clnt_perror.c,v 1.4 1993/08/26 00:53:16 jtc Exp $";
* Copyright (C) 1984, Sun Microsystems, Inc.
static char *auth_errmsg();
buf
= (char *)malloc(256);
(void) sprintf(str
, "%s: ", s
);
(void) strcpy(str
, clnt_sperrno(e
.re_status
));
case RPC_PROGNOTREGISTERED
:
(void) sprintf(str
, "; errno = %s",
"; low version = %lu, high version = %lu",
e
.re_vers
.low
, e
.re_vers
.high
);
err
= auth_errmsg(e
.re_why
);
(void) sprintf(str
,"; why = ");
(void) sprintf(str
, "%s",err
);
"(unknown authentication error - %d)",
case RPC_PROGVERSMISMATCH
:
"; low version = %lu, high version = %lu",
e
.re_vers
.low
, e
.re_vers
.high
);
(void) sprintf(str
, "\n");
(void) fprintf(stderr
,"%s",clnt_sperror(rpch
,s
));
static struct rpc_errtab rpc_errlist
[] = {
"RPC: Can't encode arguments" },
"RPC: Can't decode result" },
"RPC: Unable to receive" },
"RPC: Incompatible versions of RPC" },
"RPC: Authentication error" },
"RPC: Program unavailable" },
"RPC: Program/version mismatch" },
"RPC: Procedure unavailable" },
"RPC: Server can't decode arguments" },
"RPC: Remote system error" },
"RPC: Unknown protocol" },
"RPC: Port mapper failure" },
"RPC: Program not registered"},
"RPC: Failed (unspecified error)"}
* This interface for use by clntrpc
for (i
= 0; i
< sizeof(rpc_errlist
)/sizeof(struct rpc_errtab
); i
++) {
if (rpc_errlist
[i
].status
== stat
) {
return (rpc_errlist
[i
].message
);
return ("RPC: (unknown error code)");
(void) fprintf(stderr
,"%s",clnt_sperrno(num
));
(void) sprintf(str
, "%s: ", s
);
(void) strcat(str
, clnt_sperrno(rpc_createerr
.cf_stat
));
switch (rpc_createerr
.cf_stat
) {
(void) strcat(str
, " - ");
clnt_sperrno(rpc_createerr
.cf_error
.re_status
));
(void) strcat(str
, " - ");
if (rpc_createerr
.cf_error
.re_errno
> 0
&& rpc_createerr
.cf_error
.re_errno
< sys_nerr
)
strerror(rpc_createerr
.cf_error
.re_errno
));
(void) sprintf(&str
[strlen(str
)], "Error %d",
rpc_createerr
.cf_error
.re_errno
);
(void) strcat(str
, "\n");
(void) fprintf(stderr
,"%s",clnt_spcreateerror(s
));
static struct auth_errtab auth_errlist
[] = {
"Invalid client credential" },
"Server rejected credential" },
"Invalid client verifier" },
"Server rejected verifier" },
"Client credential too weak" },
"Invalid server verifier" },
"Failed (unspecified error)" },
for (i
= 0; i
< sizeof(auth_errlist
)/sizeof(struct auth_errtab
); i
++) {
if (auth_errlist
[i
].status
== stat
) {
return(auth_errlist
[i
].message
);