home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2821 < prev    next >
Internet Message Format  |  1991-02-20  |  4KB

  1. From: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
  2. Newsgroups: alt.sources
  3. Subject: X386MON x1.00 patch 2 (part 01/01)
  4. Message-ID: <331@n4hgf.Mt-Park.GA.US>
  5. Date: 21 Feb 91 06:02:58 GMT
  6.  
  7. Submitted-by: wht@n4hgf.Mt-Park.GA.US
  8. Archive-name: x386monx100/patch02
  9.  
  10. #-------------------------------------------------------------
  11. # X386MON x1.00 PATCH 2 - rev stays x1.10
  12. #
  13. # 1. This patch makes the ps display show the username for
  14. #    the effective uid rather than the real uid.
  15. # 2. Get rid of debug printf
  16. #
  17. # patch < this.article
  18. #-------------------------------------------------------------
  19.  
  20. *** x1.10/ps.c    Thu Feb 21 00:30:19 1991
  21. --- ps.c    Thu Feb 21 00:55:21 1991
  22. ***************
  23. *** 480,486
  24.   struct user *tuser;
  25.   {
  26.   #if defined(RDUBLK)    /* see sysi86.h #include above */
  27. - printf(">>getuser p=%d ",tproc->p_pid);
  28.       /* this system call is not returning 0 on success ?!? */
  29.       int rtn = !!sysi86(RDUBLK,tproc->p_pid,(char *)tuser,sizeof(*tuser)));
  30.   printf(">> rtn=%d\n,rtn);
  31.  
  32. --- 480,485 -----
  33.   struct user *tuser;
  34.   {
  35.   #if defined(RDUBLK)    /* see sysi86.h #include above */
  36.       /* this system call is not returning 0 on success ?!? */
  37.       int rtn = !!sysi86(RDUBLK,tproc->p_pid,(char *)tuser,sizeof(*tuser)));
  38.       return(rtn);
  39. ***************
  40. *** 483,489
  41.   printf(">>getuser p=%d ",tproc->p_pid);
  42.       /* this system call is not returning 0 on success ?!? */
  43.       int rtn = !!sysi86(RDUBLK,tproc->p_pid,(char *)tuser,sizeof(*tuser)));
  44. - printf(">> rtn=%d\n,rtn);
  45.       return(rtn);
  46.   #else /* RDUBLK */
  47.       register caddr_t uptr = (caddr_t)tuser;
  48.  
  49. --- 482,487 -----
  50.   #if defined(RDUBLK)    /* see sysi86.h #include above */
  51.       /* this system call is not returning 0 on success ?!? */
  52.       int rtn = !!sysi86(RDUBLK,tproc->p_pid,(char *)tuser,sizeof(*tuser)));
  53.       return(rtn);
  54.   #else /* RDUBLK */
  55.       register caddr_t uptr = (caddr_t)tuser;
  56. ***************
  57. *** 491,497
  58.       int ipde;
  59.       paddr_t mptr;
  60.   
  61. - printf(">>getuser p=%d ",tproc->p_pid);
  62.   #if !defined(ISC_1) && !defined(mips) && defined(SULOAD)
  63.       if(tproc->p_flag & SULOAD)
  64.       {
  65.  
  66. --- 489,494 -----
  67.       int ipde;
  68.       paddr_t mptr;
  69.   
  70.   #if !defined(ISC_1) && !defined(mips) && defined(SULOAD)
  71.       if(tproc->p_flag & SULOAD)
  72.       {
  73. ***************
  74. *** 505,511
  75.           {
  76.               if(!tproc->p_ubptbl[ipde].pgm.pg_pres)    /* if not resident */
  77.               {
  78. -                 printf(">> not resident\n");
  79.                   return(0);
  80.               }
  81.               mptr = tproc->p_ubptbl[ipde].pgm.pg_pfn * NBPP;
  82.  
  83. --- 502,507 -----
  84.           {
  85.               if(!tproc->p_ubptbl[ipde].pgm.pg_pres)    /* if not resident */
  86.               {
  87.                   return(0);
  88.               }
  89.               mptr = tproc->p_ubptbl[ipde].pgm.pg_pfn * NBPP;
  90. ***************
  91. *** 541,550
  92.        * we can get crap from swap if things change after we get
  93.        * an address to read from, so validate user as best we can
  94.        */
  95. -     printf(">> u_ruid=%d p_uid=%d ruid=%d p_suid=%d\n",
  96. -             tuser->u_ruid,tproc->p_uid,tuser->u_ruid,tproc->p_suid,
  97. -             ((tuser->u_ruid == tproc->p_uid) || (tuser->u_ruid == tproc->p_suid)));
  98.       return( (tuser->u_ruid == tproc->p_uid) ||
  99.               (tuser->u_ruid == tproc->p_suid));
  100.   
  101.  
  102. --- 537,542 -----
  103.        * we can get crap from swap if things change after we get
  104.        * an address to read from, so validate user as best we can
  105.        */
  106.       return( (tuser->u_ruid == tproc->p_uid) ||
  107.               (tuser->u_ruid == tproc->p_suid));
  108.   
  109. ***************
  110. *** 752,758
  111.   
  112.       if(initial)
  113.       {
  114. !         strcpy(s80,uid_to_name(tproc->p_uid));
  115.           cptr = s80 + strlen(s80);
  116.           *cptr++ = (tproc->p_uid != tproc->p_suid) ? '#' : ' ';
  117.           *cptr = 0;
  118.  
  119. --- 744,750 -----
  120.   
  121.       if(initial)
  122.       {
  123. !         strcpy(s80,uid_to_name(tproc->p_suid));
  124.           cptr = s80 + strlen(s80);
  125.           *cptr++ = (tproc->p_uid != tproc->p_suid) ? '#' : ' ';
  126.           *cptr = 0;
  127. ***************
  128. *** 935,942
  129.   int fheight = FHEIGHT;
  130.   int yl1 = y + (FASCENT / 2);
  131.   int ys  = y + FASCENT;
  132. - printf(">> darw_Ps i=%d b=%d\n",initial,current_display_mode);
  133.   
  134.       if(ps_WorkProc_ID || (DrawAreaXYWH.height < (x + (FHEIGHT * 2))))
  135.           return;
  136.  
  137. --- 927,932 -----
  138.   int fheight = FHEIGHT;
  139.   int yl1 = y + (FASCENT / 2);
  140.   int ys  = y + FASCENT;
  141.   
  142.       if(ps_WorkProc_ID || (DrawAreaXYWH.height < (x + (FHEIGHT * 2))))
  143.           return;
  144.  
  145. -----------------------------------------------------------------------
  146. Warren Tucker, TuckerWare   gatech!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
  147. Many [Nobel physics] prizes  have been given  to people for  telling us
  148. the universe is not as simple as we thought it was. -Stephen Hawking in
  149. A Brief History of Time     In computing, there are no such prizes. -me
  150.