[4932] in Athena Bugs

home help back first fref pref prev next nref lref last post

Re: vax 6.4R: rcs, ci, co, rlog

daemon@ATHENA.MIT.EDU (drmorris@ATHENA.MIT.EDU)
Wed May 16 13:26:18 1990

From: drmorris@ATHENA.MIT.EDU
To: "Jonathan I. Kamens" <jik@PIT-MANAGER.MIT.EDU>
Cc: bugs@ATHENA.MIT.EDU
In-Reply-To: [4810]
Date: Wed, 16 May 90 13:25:56 EDT

> Date: Tue, 15 May 90 14:15:16 -0400
> Message-Id: <9005151815.AA06994@pit-manager.MIT.EDU>
> From: "Jonathan I. Kamens" <jik@PIT-MANAGER.MIT.EDU>
> Sender: jik@PIT-MANAGER.MIT.EDU
> To: drmorris@MIT.EDU
> In-Reply-To: drmorris@MIT.EDU's message of Sun, 22 Apr 90 06:53:33 EDT <9004221053.AA01260@beeblebrox.MIT.EDU>
> Subject: vax 6.4R: rcs, ci, co, rlog
> 
> 
>   Thank you for your bug report about rcs utilities coredumping when
> the user is not in the /etc/passwd file.  This bug is already in our
> bugs database.  The issue of fixing is not so much an issue of why it
> coredumps, but rather of what should be done when rcs discovers that
> the user isn't in the password file; this issue hasn't yet been
> resolved.
> 
>   jik

I had something in mind along the lines of:

[/usr/tmp/rcs.src]:tabetha % ./ci testfile
ci error: No passwd entry
ci aborted
[/usr/tmp/rcs.src]:tabetha % 

There are other possibilities, e.g. resorting to hesiod (makes it Athena
specific, though), or using #uid in place of the user name.  However, I
would say an error message similar to the above is the least is could
do.  Core dumping should not an acceptable option.

Patches which achieve that effect follow.

If the core dumping version is going to be released, then the man page
should mention this problem in the BUGS section.


		Dave Morrison

*** /source/athena/new/rcs/src/rcsutil.c        Thu Feb 18 15:07:26 1988
--- /usr/tmp/rcs.src/rcsutil.c  Wed May 16 12:51:26 1990
***************
*** 95,101 ****
  /* Function: gets the callers login from his uid.
   * If the uid is root, tries to get the true login with getlogin().
   */
! {       char * name;
        int uid;
        uid=getuid();
        if (uid==0) {
--- 95,102 ----
  /* Function: gets the callers login from his uid.
   * If the uid is root, tries to get the true login with getlogin().
   */
! {     struct passwd * pwent;
!       char * name;
        int uid;
        uid=getuid();
        if (uid==0) {
***************
*** 104,110 ****
                if (name!=nil && *name!='\0')
                        return name;
        }
!       return(getpwuid(uid)->pw_name);
  }


--- 105,113 ----
                if (name!=nil && *name!='\0')
                        return name;
        }
!       if ((pwent = getpwuid(uid)) == nil)
!         faterror("No passwd entry");
!       return(pwent->pw_name);
  }

home help back first fref pref prev next nref lref last post