[Top][All Lists]

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

Re: locks obeyed for same user on check out...

From: James Olin Oden
Subject: Re: locks obeyed for same user on check out...
Date: Fri, 24 Oct 2003 16:40:47 -0400 (EDT)

On Fri, 24 Oct 2003, James Olin Oden wrote:

> Hi All,
> I have created a wrapper for rcs at my work that we use to manage updates
> to config files.  Its been working quite nice, except for one particular 
> problem.  We use rcs in many automated scripts and also from scriptlets
> in rpms, and if any of these tools are running simultaneously and would
> like to check out the same file, since (especially with rpm) they are 
> running as root (i.e. the same user), rcs allows them re-aquire the lock
> on the file.  While I can see this as desirable in some settings, in ours
> where many processes could be using rcs, and they are often running
> as the same user, it can be quite problematic.  When the processes are
> not shell scripts we can of course do our own locking, but when they
> are not all bets are off.  Also, I would rather not make my tool (called
> rcstool) manage locks in addition to what rcs is doing.
> Anyway would a patch providing an option to cause locks to be obeyed
> even for the user owning the lock (only on co) be acceptable?  I have
> found where I would have to change rcs's behaviour but before I patch
> it I wanted to know if this would be accepted upstream (or if I am making 
> things too hard and there is an easier path [someone please tell me there
> is (-;]).

Attached is a patch that implements the above functionality.  Basically,
I added the -S switch to co which tells it to obey locks even for the 
same user.  I then modified the addlock() function to take a third 
argument which was an integer specifying whether or not to obey locks
for the same user.   I then made all the other source files that 
called addlock() add this parameter and set it to false.  In co I default
to it being false unless -S was specified.

Their may have been a better way of doing this than changing the signature 
of addlock(), but I did not know the rcs code base well enough to come up
with any better way.  


Attachment: rcs-5.7-sameuserlocks.patch
Description: RCS same user locks patch.

reply via email to

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