[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Kimbal Welch
Subject: BADROOT
Date: Thu, 11 Jul 2002 12:26:37 -0400

The BADROOT code keeps CVS commit from working at all in local mode on NT machines.


(From previous post)


I downloaded the latest binary executable of CVS onto a Windows XP system (works about as well on NT) and slogged through setting up a local repository. Everything worked fine until I tried to ‘commit’ the modules file when I got this message:


cvs [commit aborted]: your apparent username (…) is unknown to this system


(The … had my Windows user name)


I went into the source and found this block of code:




     * For log purposes, do not allow "root" to commit files.  If you look

     * like root, but are really logged in as a non-root user, it's OK.


    /* FIXME: Shouldn't this check be much more closely related to the

       readonly user stuff (CVSROOT/readers, &c).  That is, why should

       root be able to "cvs init", "cvs import", &c, but not "cvs ci"?  */

    if (geteuid () == (uid_t) 0


      /* Who we are on the client side doesn't affect logging.  */

      && !current_parsed_root->isremote

#  endif



      struct passwd *pw;


      if ((pw = (struct passwd *) getpwnam (getcaller ())) == NULL)

          error (1, 0, "your apparent username (%s) is unknown to this system",

                   getcaller ());

      if (pw->pw_uid == (uid_t) 0)

          error (1, 0, "'root' is not allowed to commit files");


#endif /* CVS_BADROOT */


The error message obviously came from inside this ‘if’ statement. The geteuid function in the win32 library always returns a 0 since “everybody’s a superuser.” Also, I’m assuming the current_parsed_root->isremote will always be false for local repositories. Considering that getpwnam also always returns a NULL the commit and probably several other commands will always fail in local mode under Windows.


I’m guessing that CVS_BADROOT should not be defined for Windows builds so this may be a build problem.



Kimbal G. Welch

Chief Product Architect

WebTone Technologies, Inc.


p: 704.973.3515

f: 704.973.3595


reply via email to

[Prev in Thread] Current Thread [Next in Thread]