Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sun, 15 Sep 2002 12:07:49 +0100 From: Raphael To: cygwin AT cygwin DOT com Subject: Re: Crontab problems Message-ID: <20020915110749.GA1804@TOOS> Mail-Followup-To: cygwin AT cygwin DOT com References: <20020914200118 DOT GA1032 AT TOOS> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Operating-System: CYGWIN_NT-5.0 TOOS 1.3.12(0.54/3/2) 2002-07-06 02:16 i686 unknown X-Note: This E-mail was scanned by Declude JunkMail (www.declude.com) for spam. --5vNYLRcllDrimb99 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 14, 2002 at 07:55:36PM -0400, Igor Pechtchanski wrote: > On Sat, 14 Sep 2002, Raphael wrote: >=20 > > On Sat, Sep 14, 2002 at 01:00:20PM -0400, Igor Pechtchanski wrote: > > > On Thu, 12 Sep 2002, Raphael wrote: > > > > > > > On Wed, Sep 11, 2002 at 05:53:24PM -0400, Igor Pechtchanski wrote: > > > > > On Wed, 11 Sep 2002, Nicholas Wourms wrote: > > > > > > > > > > > --- Raphael wrote: > > > > > > > Hi guys/girls~, > > > > > > > > > > > > > > I'm having a bit of a problem with my windows based editor. U= sing > > > > > > > it with > > > > > > > Pine or Mutt is not problem. Using it with Crontab -e gives a > > > > > > > sharing > > > > > > > violation error when I want to save the new file. > > > > > > > > > > > > > > Is this a crontab problem? > > > > > > > > > > > > Use vi.exe > > > > > > > > > > Most windows editors adopt a remove-and-recreate (or rename-and-r= ecreate) > > > > > policy. This basically means that they will try to remove or ren= ame the > > > > > crontab-created file (which will fail, silently), and then create= that > > > > > file over (which will fail since crontab has it open). This is w= here your > > > > > sharing violation comes from. > > > > > > > > Ok, I can understand that explenation. > > > > > > > > > I've verified this with notepad and > > > > > editpad, but I'm sure most of the others will behave similarly. = Thus, > > > > > looks like using a cygwin-based editor is your only option, unles= s you can > > > > > find a windows one that writes the files in-place. If this creat= es one > > > > > more convert for the vi camp, all the better. ;-) > > > > > > > > Don't think so, why should Cron not be able to act like Pine or Mut= t. I > > > > guess the latter start opening the file in shared mode? > > > > > > I don't know about mutt, but pine, IIRC, does not keep the file open = while > > > it's being edited by an external editor. It re-opens the file afterw= ards, > > > which is why it doesn't care whether it's the same file, or a newly > > > created one. > > > > Hi Igor, > > But do you have any idea why Cron shouldn't be able to act the same? >=20 > Quoting straight from the crontab-3.0.1-7 source (crontab.c:418): >=20 > /* we still have the file open. editors will generally rewrite t= he > * original file rather than renaming/unlinking it and starting a > * new one; even backup files are supposed to be made by copying > * rather than by renaming. if some editor does not support this, > * then don't use it. the security problems are more severe if we > * close and reopen the file around the edit. > */ >=20 > Hope this answers your question. =20 Hmmm, it answers the question, but raises others. I cannot see the security= =20 issue for Cygwin as I now work arround by editing /var/cron/tabs/ directly and restarting the service afterwards. > By the way, the patch to close the file > and re-open it is trivial, and is left as an exercise for the reader. Great but without any C knowledge I wouldn't even know where to start. I'm= =20 wondering, if Corinne is reading this, if the patch might not be standarize= d=20 for Cygwin considering the interchangability between Cygwin and Windows. Ofcourse only if there is really no security issue. > Boy, I get to quote the source a lot these days... Not that I'm > complaining or anything... :-D I'm sure everyone is very greatfull for you sharing this information. It's considarably more informative than a blunt =B4Use vi.exe=B4 some people try to kill a thread with. Thank you very much. Kind Regards Raphael. --5vNYLRcllDrimb99 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (Cygwin32) iD8DBQE9hGoEWEtPuWPcngsRAhHmAJ9lSB3XZ9lEKkR51/QOvx7uGmutggCeKXQB azZHtaNf7cPYvQ6qRduUOMA= =R0HP -----END PGP SIGNATURE----- --5vNYLRcllDrimb99-- --- [This E-mail scanned for viruses by Declude Virus]