Derek Scherger wrote:

> I think there might be a legitimate reason to commit files as root. I'm
> in the middle of attempting to put my system configuration files (this
> /etc/*) into CVS. These files are owned by root, managed by root, etc.
> but I'd still like to have a root-only repository that will allow me to
> make changes as root. I can see problems with allowing root to use
> something like :pserver: where the root password is flying around in the
> clear but for a local repository I really don't see any problems.


Here's a little more info on this, from cvs/src/commit.c:

    /*
     * 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.
     */

        ...

        if (pw->pw_uid == (uid_t) 0)
            error (1, 0, "cannot commit files as 'root'");

Which basically means that the *real* intent of not allowing root
commits is because they essentially come from an anonymous user. Note
that this section of code is wrapped in 

#ifdef CVS_BADROOT
        ...
#endif

too. And in options.h there's the following further comment:

/*
 * When committing a permanent change, CVS and RCS make a log entry of
 * who committed the change.  If you are committing the change logged
 * in as "root" (not under "su" or other root-priv giving program),
 * CVS/RCS cannot determine who is actually making the change.
 *
 * As such, by default, CVS disallows changes to be committed by users
 * logged in as "root".  You can disable this option by commenting out
 * the lines below.
 */
#ifndef CVS_BADROOT
/*#define       CVS_BADROOT*/
#endif


For my configuration purposes I've commented out the #define CVS_BADROOT
above and it works great.


-- 
Cheers,
Derek
_____________________________________________________________________
Derek Scherger                         Echologic Software Corporation
mailto:[EMAIL PROTECTED]                   http://www.echologic.com

Reply via email to