espo@bpa.UUCP (05/27/83)
Relay-Version:version B 2.10 5/3/83; site harpo.UUCP Message-ID:<129@bpa.UUCP> Date:Fri, 27-May-83 08:04:15 EDT The fixes contained here will allow 'uustat' to perform as advertised. In addition to this, modifications to 'us-crs.c' and 'us_rrs.c' allow job entries in '/usr/lib/uucp/R_stat' to conform with the base 62 format. It would be a good idea to clean out the R_stat file after you re-make and install the source, since old entries are incorrect. Bob Esposito........sb6!bpa!espo uust.h ====================================================================== 18a19,21 > #define SpoolC "/usr/spool/uucp/C." /* spool command dir */ > #define L_DUMMY "/usr/lib/uucp/dummy" > #define S_DUMMY "/usr/spool/uucp/dummy" 28c31,32 < short jobn; /* job # */ --- > char jobn[5]; /* job # - changed to accommodate > * base 62 format */ us_crs.c ==================================================================== 33c33,35 < u.jobn = atoi(name); /* convert to digits */ --- > strncpy(u.jobn, name, 4); /* changed to accommodate > * base 62 format */ > u.jobn[5] = '\0'; 35c37 < fprintf(fq, "%04d\t%7.7s\t%7.7s\t", u.jobn, User, Rmtname); --- > fprintf(fq, "%4.4s\t%7.7s\t%7.7s\t", u.jobn, User, Rmtname); us_rrs.c =================================================================== 35c35 < fp = us_open(R_stat, "a+", LCKRSTAT, 10, 1); --- > fp = us_open(R_stat, "r+", LCKRSTAT, 10, 1); 37,40c37,39 < fseek(fp, 0L, 0); /* rewind */ < while (fscanf(fp, "%d%*s%*s%*ld", &u.jobn)!=NULL) { < if (u.jobn == n) { < DEBUG(6, " jobn : %d\n", u.jobn); --- > while (fscanf(fp, "%s%*s%*s%*ld", &u.jobn)!=NULL) { > if (strcmp(u.jobn, name) == SAME) { > DEBUG(6, " jobn : %s\n", u.jobn); uustat.c ================================================================== 60c60 < short ca, ja, ka, oa, ya; --- > short ca, oa, ya; 62c62 < char s[128], buf[BUFSIZ]; --- > char s[128], buf[BUFSIZ], ka[5], ja[5]; 81,82c81,82 < if (strcmp(optarg, "all") == SAME) ja = -1; < else ja = atoi(optarg); --- > strncpy(ja, optarg, 4); > ja[5] = '\0'; 93c93,94 < ka = atoi(optarg); --- > strncpy(ka, optarg, 4); > ka[5] = '\0'; 142c143 < fp=us_open(R_stat, "r", "dummy", 1, 1); --- > fp=us_open(R_stat, "r", L_DUMMY, 1, 1); 146c147 < fq=us_open(s, "w+", "dummy", 1, 1); --- > fq=us_open(s, "w+", S_DUMMY, 1, 1); 149c150,151 < sscanf(buf, "%*d%*s%*s%*ld%ld", &u.stime); --- > sscanf(buf, "%*s%*s%*s%*ld%ld", &u.stime); > printf("%s\n", buf); 161c163 < fp=us_open(L_stat, "r", "dummy", 1, 1); --- > fp=us_open(L_stat, "r", L_DUMMY, 1, 1); 193d194 < int n; 195,196c196,197 < DEBUG(5, "enter kill loop, ka: %d\n", ka); < fp=us_open(R_stat, "r", "dummy", 1, 1); --- > DEBUG(5, "enter kill loop, ka: %s\n", ka); > fp=us_open(R_stat, "r", L_DUMMY, 1, 1); 200c201 < fq=us_open(s, "w+", "dummy", 1, 1); --- > fq=us_open(s, "w+", S_DUMMY, 1, 1); 203,206c204,207 < sscanf(buf, "%d%s", &u.jobn, u.user); < if ((u.jobn==ka) && ((strcmp(u.user,User)==SAME) < || (geteuid()==rid))) { < DEBUG(5, "Job %d is deleted\n", ka); --- > sscanf(buf, "%4s%s", u.jobn, u.user); > if ((strncmp(u.jobn,ka,4)==SAME) && > ((strcmp(u.user,User)==SAME) || (geteuid()==rid))) { > DEBUG(5, "Job %s is deleted\n", ka); 208,210c209,211 < chdir(Spool); /* spool directory */ < if ((pdirf=fopen(Spool,"r"))==NULL) { < perror(Spool); --- > chdir(SpoolC); > if ((pdirf=opendir(SpoolC,"r"))==NULL) { > perror(SpoolC); 217,218c218 < n = atoi(name); < if (n == ka) { --- > if (strncmp(name, ka, 4)==SAME) { 230a231 > chdir(Spool); 236c237 < fp=us_open(R_stat, "r", "dummy", 1, 1); --- > fp=us_open(R_stat, "r", L_DUMMY, 1, 1); 239c240 < sscanf(buf, "%d%s%s%ld%ld%o", &u.jobn, u.user, --- > sscanf(buf, "%s%s%s%ld%ld%o", &u.jobn, u.user, 244c245,246 < if ((ja==-1) || (ja==u.jobn)) jout(&u); --- > if ((strcmp(ja,"all")==SAME) > || (strcmp(ja,u.jobn)==SAME)) jout(&u); 280c282 < printf("%-4.4d\t%.7s\t%.7s",u->jobn,u->user,u->rmt); --- > printf("%.4s\t%.7s\t%.7s",u->jobn,u->user,u->rmt); 306a309,312 > cleanup() /* to quiet make */ > { > } > ===============================================================================