[Top][All Lists]

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

CVS commit in local mode on NT fails - and why

From: Kimbal Welch
Subject: CVS commit in local mode on NT fails - and why
Date: Thu, 11 Jul 2002 09:07:06 -0400

(I'm a little new to CVS and open source so please excuse any protocol

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

(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
     * 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
                         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]