[5833] in Athena Bugs
nfsc changes for pmax/ultrix
daemon@ATHENA.MIT.EDU (John T Kohl)
Fri Aug 24 11:30:00 1990
Date: Fri, 24 Aug 90 11:29:38 -0400
From: John T Kohl <jtkohl@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
add refcnt printing
fix some rpc_xxx_t/xxx_t confusion
*** /tmp/,RCSt1008831 Fri Aug 24 11:27:02 1990
--- nfsc.c Wed Aug 1 22:03:44 1990
***************
*** 8,18 ****
*/
#ifndef lint
! static char *rcsid_nfsc_c = "$Header: /hecate/u4/lockers/decworld/supplemental/nfsc/RCS/nfsc.c,v 1.4 88/04/21 11:49:38 shanzer Exp $";
#endif lint
#include <stdio.h>
! #include <ss.h>
#include <ctype.h>
#include <netdb.h>
#include <sys/types.h>
--- 8,18 ----
*/
#ifndef lint
! static char *rcsid_nfsc_c = "$Header: /u1/athena/supplemental/nfsc/RCS/nfsc.c,v 1.6 90/08/02 12:03:40 jtkohl Exp $";
#endif lint
#include <stdio.h>
! #include <ss/ss.h>
#include <ctype.h>
#include <netdb.h>
#include <sys/types.h>
***************
*** 186,192 ****
} else {
/* should add something to tables.. */
printf("add: ");
! print_cred(&sin.sin_addr, uid, credp);
}
return;
usage:
--- 186,192 ----
} else {
/* should add something to tables.. */
printf("add: ");
! print_cred(&sin.sin_addr, 0, uid, credp);
}
return;
usage:
***************
*** 198,205 ****
#endif
}
! void print_cred(addr, uid, credp)
struct in_addr *addr;
rpc_uid_t uid;
struct authunix_parms *credp;
{
--- 198,206 ----
#endif
}
! void print_cred(addr, refcnt, uid, credp)
struct in_addr *addr;
+ u_short refcnt;
rpc_uid_t uid;
struct authunix_parms *credp;
{
***************
*** 214,220 ****
if (hp == NULL) s = inet_ntoa(addr);
else s = hp->h_name;
! printf("%s: %s -> ", s, getloginbyuid(uid));
if (credp) {
printf("%s [%s", getloginbyuid(credp->aup_uid),
getgroupbygid(credp->aup_gid));
--- 215,224 ----
if (hp == NULL) s = inet_ntoa(addr);
else s = hp->h_name;
! if (refcnt)
! printf("%s: %s [refcnt:%d] -> ", s, getloginbyuid(uid), refcnt);
! else
! printf("%s: %s -> ", s, getloginbyuid(uid));
if (credp) {
printf("%s [%s", getloginbyuid(credp->aup_uid),
getgroupbygid(credp->aup_gid));
***************
*** 255,261 ****
ss_perror(ss_idx, errno, (char *)0);
goto usage;
} else if (credp == NULL) printf("get: no credential returned.\n");
! else print_cred(&sin.sin_addr, uid, credp);
return (0);
usage:
printf("Usage: get host [user|uid]\n");
--- 259,265 ----
ss_perror(ss_idx, errno, (char *)0);
goto usage;
} else if (credp == NULL) printf("get: no credential returned.\n");
! else print_cred(&sin.sin_addr, 0, uid, credp);
return (0);
usage:
printf("Usage: get host [user|uid]\n");
***************
*** 379,385 ****
--- 383,395 ----
NULL,
"*",
0,
+ #ifdef ultrix
+ 0,
+ #endif
NOGROUP,
+ #ifdef ultrix
+ 0,
+ #endif
0,
NULL,
"Unknown user",
*** /tmp/,RCSt1008836 Fri Aug 24 11:27:17 1990
--- getgrps.c Tue Aug 7 03:06:36 1990
***************
*** 22,27 ****
--- 25,31 ----
#include <sys/param.h>
#include <grp.h>
#include <pwd.h>
+ #include <rpc/types.h> /* for rpc_uid_t and rpc_gid_t */
#include "nfsc_err.h"
#define STREQ(s1, s2) ((*(s1) == *(s2)) && (strcmp((s1)+1,(s2)+1) == 0))
***************
*** 28,43 ****
struct group *getgrent();
! gid_t *
getgroupset(user_name, gid, grlen, status)
register char *user_name;
! register gid_t gid; /* The user's primary group */
int *grlen; /* RETURN: number of groups retrieved */
int *status; /* RETURN: status code. */
{
register length=0, i=0;
register struct group *gp;
! static gid_t grps[NGROUPS];
*status = 0;
setgrent();
--- 32,47 ----
struct group *getgrent();
! rpc_gid_t *
getgroupset(user_name, gid, grlen, status)
register char *user_name;
! register rpc_gid_t gid; /* The user's primary group */
int *grlen; /* RETURN: number of groups retrieved */
int *status; /* RETURN: status code. */
{
register length=0, i=0;
register struct group *gp;
! static rpc_gid_t grps[NGROUPS];
*status = 0;
setgrent();
***************
*** 60,66 ****
}
char *getloginbyuid(uid)
! uid_t uid;
{
struct passwd *pp;
static char buf[10];
--- 64,70 ----
}
char *getloginbyuid(uid)
! rpc_uid_t uid;
{
struct passwd *pp;
static char buf[10];
***************
*** 72,78 ****
}
char *getgroupbygid(gid)
! gid_t gid;
{
struct group *gp;
static char buf[10];
--- 76,82 ----
}
char *getgroupbygid(gid)
! rpc_gid_t gid;
{
struct group *gp;
static char buf[10];
*** /tmp/,RCSt1008848 Fri Aug 24 11:27:47 1990
--- nfsc_db.c Mon Aug 7 14:09:26 1989
***************
*** 18,24 ****
#include <stdio.h>
#include "nfsc_err.h"
#include <strings.h>
! #include <ss.h>
#include <ctype.h>
extern int errno;
char *trim();
--- 18,24 ----
#include <stdio.h>
#include "nfsc_err.h"
#include <strings.h>
! #include <ss/ss.h>
#include <ctype.h>
extern int errno;
char *trim();
*** /tmp/,RCSt1008859 Fri Aug 24 11:28:14 1990
--- nfsc_show.c Wed Aug 1 21:53:24 1990
***************
*** 43,48 ****
--- 46,52 ----
struct sockaddr e_sock;
int e_len;
struct authunix_parms *e_credp;
+ u_short e_rfcnt; /* reference count */
};
struct nfsmap_ent *nfsmap_htable[256];
***************
*** 121,127 ****
}
};
sock = (struct sockaddr_in *)&ent->e_sock;
! (*print_func)((char *)&(sock->sin_addr.s_addr),
(rpc_uid_t)ent->e_uid, credp);
if (credp) {
if (credp->aup_gids) free((char *)(credp->aup_gids));
--- 125,131 ----
}
};
sock = (struct sockaddr_in *)&ent->e_sock;
! (*print_func)((char *)&(sock->sin_addr.s_addr), ent->e_rfcnt,
(rpc_uid_t)ent->e_uid, credp);
if (credp) {
if (credp->aup_gids) free((char *)(credp->aup_gids));
***************
*** 179,186 ****
return(1);
}
! static void dump_cred(addr, uid, credp)
struct in_addr *addr;
rpc_uid_t uid;
struct authunix_parms *credp;
{
--- 183,191 ----
return(1);
}
! static void dump_cred(addr, refcnt, uid, credp)
struct in_addr *addr;
+ u_short refcnt;
rpc_uid_t uid;
struct authunix_parms *credp;
{