public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Crontab problems
@ 2002-09-11 12:47 Raphael
  2002-09-11 13:48 ` Nicholas Wourms
  0 siblings, 1 reply; 15+ messages in thread
From: Raphael @ 2002-09-11 12:47 UTC (permalink / raw)
  To: cygwin

Hi guys/girls~,

I'm having a bit of a problem with my windows based editor. Using 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?

Kind regards

Raphael.


---
[This E-mail scanned for viruses by Declude Virus]


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-11 12:47 Crontab problems Raphael
@ 2002-09-11 13:48 ` Nicholas Wourms
  2002-09-11 15:20   ` Igor Pechtchanski
  0 siblings, 1 reply; 15+ messages in thread
From: Nicholas Wourms @ 2002-09-11 13:48 UTC (permalink / raw)
  To: Raphael, cygwin


--- Raphael <raphael@oninet.pt> wrote:
> Hi guys/girls~,
> 
> I'm having a bit of a problem with my windows based editor. Using
> 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

__________________________________________________
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-11 13:48 ` Nicholas Wourms
@ 2002-09-11 15:20   ` Igor Pechtchanski
  2002-09-14  3:01     ` Raphael
  0 siblings, 1 reply; 15+ messages in thread
From: Igor Pechtchanski @ 2002-09-11 15:20 UTC (permalink / raw)
  To: Raphael; +Cc: cygwin

On Wed, 11 Sep 2002, Nicholas Wourms wrote:

> --- Raphael <raphael@oninet.pt> wrote:
> > Hi guys/girls~,
> >
> > I'm having a bit of a problem with my windows based editor. Using
> > 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-recreate)
policy.  This basically means that they will try to remove or rename the
crontab-created file (which will fail, silently), and then create that
file over (which will fail since crontab has it open).  This is where your
sharing violation comes from.  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, unless you can
find a windows one that writes the files in-place.  If this creates one
more convert for the vi camp, all the better. ;-)
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-11 15:20   ` Igor Pechtchanski
@ 2002-09-14  3:01     ` Raphael
  2002-09-14 10:52       ` Igor Pechtchanski
  0 siblings, 1 reply; 15+ messages in thread
From: Raphael @ 2002-09-14  3:01 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]

On Wed, Sep 11, 2002 at 05:53:24PM -0400, Igor Pechtchanski wrote:
> On Wed, 11 Sep 2002, Nicholas Wourms wrote:
> 
> > --- Raphael <raphael@oninet.pt> wrote:
> > > Hi guys/girls~,
> > >
> > > I'm having a bit of a problem with my windows based editor. Using
> > > 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-recreate)
> policy.  This basically means that they will try to remove or rename the
> crontab-created file (which will fail, silently), and then create that
> file over (which will fail since crontab has it open).  This is where 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, unless you can
> find a windows one that writes the files in-place.  If this creates 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 Mutt. I 
guess the latter start opening the file in shared mode?

Kind regards

Raphael.

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-14  3:01     ` Raphael
@ 2002-09-14 10:52       ` Igor Pechtchanski
  2002-09-14 14:46         ` Raphael
  0 siblings, 1 reply; 15+ messages in thread
From: Igor Pechtchanski @ 2002-09-14 10:52 UTC (permalink / raw)
  To: cygwin

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 <raphael@oninet.pt> wrote:
> > > > Hi guys/girls~,
> > > >
> > > > I'm having a bit of a problem with my windows based editor. Using
> > > > 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-recreate)
> > policy.  This basically means that they will try to remove or rename the
> > crontab-created file (which will fail, silently), and then create that
> > file over (which will fail since crontab has it open).  This is where 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, unless you can
> > find a windows one that writes the files in-place.  If this creates 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 Mutt. 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 afterwards,
which is why it doesn't care whether it's the same file, or a newly
created one.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-14 10:52       ` Igor Pechtchanski
@ 2002-09-14 14:46         ` Raphael
  2002-09-14 18:47           ` Igor Pechtchanski
  0 siblings, 1 reply; 15+ messages in thread
From: Raphael @ 2002-09-14 14:46 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1913 bytes --]

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 <raphael@oninet.pt> wrote:
> > > > > Hi guys/girls~,
> > > > >
> > > > > I'm having a bit of a problem with my windows based editor. Using
> > > > > 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-recreate)
> > > policy.  This basically means that they will try to remove or rename the
> > > crontab-created file (which will fail, silently), and then create that
> > > file over (which will fail since crontab has it open).  This is where 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, unless you can
> > > find a windows one that writes the files in-place.  If this creates 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 Mutt. 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 afterwards,
> 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?

Kind Regards

Raphael

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-14 14:46         ` Raphael
@ 2002-09-14 18:47           ` Igor Pechtchanski
  2002-09-15  5:49             ` Raphael
  0 siblings, 1 reply; 15+ messages in thread
From: Igor Pechtchanski @ 2002-09-14 18:47 UTC (permalink / raw)
  To: cygwin

On Sat, 14 Sep 2002, Raphael wrote:

> 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 <raphael@oninet.pt> wrote:
> > > > > > Hi guys/girls~,
> > > > > >
> > > > > > I'm having a bit of a problem with my windows based editor. Using
> > > > > > 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-recreate)
> > > > policy.  This basically means that they will try to remove or rename the
> > > > crontab-created file (which will fail, silently), and then create that
> > > > file over (which will fail since crontab has it open).  This is where 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, unless you can
> > > > find a windows one that writes the files in-place.  If this creates 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 Mutt. 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 afterwards,
> > 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?

Quoting straight from the crontab-3.0.1-7 source (crontab.c:418):

        /* we still have the file open.  editors will generally rewrite the
         * 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.
         */

Hope this answers your question.  By the way, the patch to close the file
and re-open it is trivial, and is left as an exercise for the reader.

Boy, I get to quote the source a lot these days...  Not that I'm
complaining or anything... :-D
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-14 18:47           ` Igor Pechtchanski
@ 2002-09-15  5:49             ` Raphael
  2002-09-15  7:44               ` Nicholas Wourms
  2002-09-16 16:24               ` Warren Young
  0 siblings, 2 replies; 15+ messages in thread
From: Raphael @ 2002-09-15  5:49 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 3681 bytes --]

On Sat, Sep 14, 2002 at 07:55:36PM -0400, Igor Pechtchanski wrote:
> On Sat, 14 Sep 2002, Raphael wrote:
> 
> > 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 <raphael@oninet.pt> wrote:
> > > > > > > Hi guys/girls~,
> > > > > > >
> > > > > > > I'm having a bit of a problem with my windows based editor. Using
> > > > > > > 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-recreate)
> > > > > policy.  This basically means that they will try to remove or rename the
> > > > > crontab-created file (which will fail, silently), and then create that
> > > > > file over (which will fail since crontab has it open).  This is where 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, unless you can
> > > > > find a windows one that writes the files in-place.  If this creates 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 Mutt. 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 afterwards,
> > > 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?
> 
> Quoting straight from the crontab-3.0.1-7 source (crontab.c:418):
> 
>         /* we still have the file open.  editors will generally rewrite the
>          * 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.
>          */
> 
> Hope this answers your question.  

Hmmm, it answers the question, but raises others. I cannot see the security 
issue for Cygwin as I now work arround by editing /var/cron/tabs/<currentuser>
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 
wondering, if Corinne is reading this, if the patch might not be standarized 
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 ´Use vi.exe´ some people try
to kill a thread with. Thank you very much.

Kind Regards

Raphael.

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-15  5:49             ` Raphael
@ 2002-09-15  7:44               ` Nicholas Wourms
  2002-09-15  9:19                 ` Raphael
  2002-09-15  9:53                 ` Igor Pechtchanski
  2002-09-16 16:24               ` Warren Young
  1 sibling, 2 replies; 15+ messages in thread
From: Nicholas Wourms @ 2002-09-15  7:44 UTC (permalink / raw)
  To: Raphael, cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 2134 bytes --]


--- Raphael <raphael@oninet.pt> wrote:
 > Great but without any C knowledge I wouldn't even know where to
> start. I'm 
> wondering, if Corinne is reading this, if the patch might not be
> standarized 
> 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 ´Use vi.exe´ some people
> try
> to kill a thread with. Thank you very much.

Paul Vixie last released cron in freakin' 1994 (or thereabouts)!  Not
much has been done to modify it since then.  I'm sure his design was
quite appropriate at the time, when the thought of using a gui editor
to edit cron jobs was unheard of.  The point is: why make life
difficult for yourself?  If you want a lazy editor, use nano or pico
for crying out loud!  They're so easy my grandmother could use them. 
Trying to use Windows NotePad, which introduces the whole \r\n deal,
is friggin' crazy!  Why should Corinna, or anyone else for that
matter, patch the *working* cron sources just for *you* when there
are perfectly good tools already available?  I'm sorry my friend, but
this isn't Burger King, where you can have it your way right away.  I
applaud Igor for being generous and doing the research for you, but I
don't think you should expect it every time.  I think you read too
much into "use vi".  It was simply providing a sensible alternative
to Windows NotePad which provides the same functionality without the
need for modifing *working* sources.  If that doesn't suit you,
TextPad looks like a viable alternative...

Cheers,
Nicholas

__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-15  7:44               ` Nicholas Wourms
@ 2002-09-15  9:19                 ` Raphael
  2002-09-15 15:18                   ` Nicholas Wourms
  2002-09-15  9:53                 ` Igor Pechtchanski
  1 sibling, 1 reply; 15+ messages in thread
From: Raphael @ 2002-09-15  9:19 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 3384 bytes --]

On Sun, Sep 15, 2002 at 06:49:48AM -0700, Nicholas Wourms wrote:
> 
> --- Raphael <raphael@oninet.pt> wrote:
>  > Great but without any C knowledge I wouldn't even know where to
> > start. I'm 
> > wondering, if Corinne is reading this, if the patch might not be
> > standarized 
> > 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 ?Use vi.exe? some people
> > try
> > to kill a thread with. Thank you very much.

1st. I hereby ask you kindly and publicly, to refrain from sending any 
more mails to my personal address. If you want to reply to the list thats
fine by me, but stop cc-ing to my personal address. That said....

> Paul Vixie last released cron in freakin' 1994 (or thereabouts)!  Not
> much has been done to modify it since then.  I'm sure his design was
> quite appropriate at the time, when the thought of using a gui editor
> to edit cron jobs was unheard of.

Makes you think doesn't it. Might anything have changed since then?

> The point is: why make life
> difficult for yourself?  If you want a lazy editor, use nano or pico
> for crying out loud!
> They're so easy my grandmother could use them.

Your assumptions are based on extreme prejudice. 

> Trying to use Windows NotePad, which introduces the whole \r\n deal,
> is friggin' crazy!

Your reading is 'friggin crazy'. In fact I'm using TextPad, a fine editor
that has no problems whatsoever with \r\n as it is very able to recognise
what kind of file it is editing.

> Why should Corinna, or anyone else for that
> matter, patch the *working* cron sources just for *you* when there
> are perfectly good tools already available?

I don't know, I was under the impression that the interoperabilty between
Windows programs and Cygwin where of high priority. If I'm not mistaken
I have seen several times statements written here that cygwin is no *nix
and has no intention to become one. In fact thats logical becouse then one
might better take the step to any *nix instead of bothering with a hybrid.

> I'm sorry my friend,

I'm not your friend, nor is it very likely that I will ever become one.

> but
> this isn't Burger King, where you can have it your way right away.

What gave you the impression I would like to have my way right away?

> I
> applaud Igor for being generous and doing the research for you, but I
> don't think you should expect it every time.  I think you read too
> much into "use vi".  It was simply providing a sensible alternative
> to Windows NotePad which provides the same functionality without the
> need for modifing *working* sources.  If that doesn't suit you,
> TextPad looks like a viable alternative...

How thick are you anyway? Haven't you understood anything of 
Igor's splendid explanation. You who are preaching the most about reading
and research on this list seem to fail the exercise completely. Might 
highschool be a good advise? It might help you to prevent more of these
painfull mistakes.

> Cheers,
> Nicholas

Sure blame it on the alcohol.

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-15  7:44               ` Nicholas Wourms
  2002-09-15  9:19                 ` Raphael
@ 2002-09-15  9:53                 ` Igor Pechtchanski
  2002-09-15  9:54                   ` Igor Pechtchanski
  1 sibling, 1 reply; 15+ messages in thread
From: Igor Pechtchanski @ 2002-09-15  9:53 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 2868 bytes --]

On Sun, 15 Sep 2002, Nicholas Wourms wrote:

> --- Raphael <raphael@oninet.pt> wrote:
> > Great but without any C knowledge I wouldn't even know where to start.
> > I'm wondering, if Corinne is reading this, if the patch might not be
> > standarized 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 ´Use vi.exe´ some
> > people try to kill a thread with. Thank you very much.
>
> Paul Vixie last released cron in freakin' 1994 (or thereabouts)!  Not
> much has been done to modify it since then.  I'm sure his design was
> quite appropriate at the time, when the thought of using a gui editor
> to edit cron jobs was unheard of.  The point is: why make life
> difficult for yourself?  If you want a lazy editor, use nano or pico
> for crying out loud!  They're so easy my grandmother could use them.
> Trying to use Windows NotePad, which introduces the whole \r\n deal,
> is friggin' crazy!  Why should Corinna, or anyone else for that
> matter, patch the *working* cron sources just for *you* when there
> are perfectly good tools already available?  I'm sorry my friend, but
> this isn't Burger King, where you can have it your way right away.  I
> applaud Igor for being generous and doing the research for you, but I
> don't think you should expect it every time.  I think you read too
> much into "use vi".  It was simply providing a sensible alternative
> to Windows NotePad which provides the same functionality without the
> need for modifing *working* sources.  If that doesn't suit you,
> TextPad looks like a viable alternative...
>
> Cheers,
> Nicholas

Not to step on anyone's toes (and I really do want to correct this just
for the archives), but EditPad ( http://www.editpadpro.com/ ) offers a
nice alternative to Notepad, and can handle UNIX-style newlines.  It even
has a "go to line" feature for programmers.  I don't use it to edit
crontabs, but I did use it for perl programs, with great results.
Not all Windows editors are bad.  Sorry, couldn't resist giving it a plug.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-15  9:53                 ` Igor Pechtchanski
@ 2002-09-15  9:54                   ` Igor Pechtchanski
  0 siblings, 0 replies; 15+ messages in thread
From: Igor Pechtchanski @ 2002-09-15  9:54 UTC (permalink / raw)
  To: cygwin

On Sun, 15 Sep 2002, Igor Pechtchanski wrote:

> On Sun, 15 Sep 2002, Nicholas Wourms wrote:
>
> > Trying to use Windows NotePad, which introduces the whole \r\n deal,
> > is friggin' crazy!
> > [snip]
> > I think you read too much into "use vi".  It was simply providing a
> > sensible alternative to Windows NotePad which provides the same
> > functionality without the need for modifing *working* sources.  If
> > that doesn't suit you, TextPad looks like a viable alternative...
> >
> > Cheers,
> > Nicholas
>
> Not to step on anyone's toes (and I really do want to correct this just
> for the archives), but EditPad ( http://www.editpadpro.com/ ) offers a
> nice alternative to Notepad, and can handle UNIX-style newlines.  It even
> has a "go to line" feature for programmers.  I don't use it to edit
> crontabs, but I did use it for perl programs, with great results.
> Not all Windows editors are bad.  Sorry, couldn't resist giving it a plug.

Sorry, didn't see that TextPad reference...  My brain's on hold sometimes.
Please disregard (you can still try out EditPad, though :-D).
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-15  9:19                 ` Raphael
@ 2002-09-15 15:18                   ` Nicholas Wourms
  0 siblings, 0 replies; 15+ messages in thread
From: Nicholas Wourms @ 2002-09-15 15:18 UTC (permalink / raw)
  To: Raphael, cygwin

--- Raphael <raphael@oninet.pt> wrote:
> On Sun, Sep 15, 2002 at 06:49:48AM -0700, Nicholas Wourms wrote:
> > 
> > --- Raphael <raphael@oninet.pt> wrote:
> >  > Great but without any C knowledge I wouldn't even know where
> to
> > > start. I'm 
> > > wondering, if Corinne is reading this, if the patch might not
> be
> > > standarized 
> > > 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 ?Use vi.exe? some
> people
> > > try
> > > to kill a thread with. Thank you very much.
> 
> 1st. I hereby ask you kindly and publicly, to refrain from sending
> any 
> more mails to my personal address. If you want to reply to the list
> thats
> fine by me, but stop cc-ing to my personal address. That said....

Well too bad.  As Earnie Boyd once said:
"In response to this email I hit Reply-All.  If you don't set
Reply-To
then this email is sent to you in response and the list is CCed.  I
and others don't adjust the distribution as I/we can't remember the
names of the 1000's of people on this list.  It's you who needs to
adjust the headers not me or someone else."

Definitely sums up how I feel.
 
> > Paul Vixie last released cron in freakin' 1994 (or thereabouts)! 
> Not
> > much has been done to modify it since then.  I'm sure his design
> was
> > quite appropriate at the time, when the thought of using a gui
> editor
> > to edit cron jobs was unheard of.
> 
> Makes you think doesn't it. Might anything have changed since then?

Jeeze, that's the point!  Nothing has changed because it is highly
stable.  That is not something to scoff at, it something to be
desired.
 
> > The point is: why make life
> > difficult for yourself?  If you want a lazy editor, use nano or
> pico
> > for crying out loud!
> > They're so easy my grandmother could use them.
> 
> Your assumptions are based on extreme prejudice.

No, my assumptions are based on the philosophy of some of those who
put the Posix standards in place.  The whole idea is to use the right
tool for the right situation to get the job done efficiently. 
Expecting crontab to use a gui editor is overkill and will likely
introduce instability into the system.  However, using it edit source
code, makefiles, startx, etc. is perfectly fine.

> 
> > Trying to use Windows NotePad, which introduces the whole \r\n
> deal,
> > is friggin' crazy!
> 
> Your reading is 'friggin crazy'. In fact I'm using TextPad, a fine
> editor
> that has no problems whatsoever with \r\n as it is very able to
> recognise
> what kind of file it is editing.

But it is still a Windows app which has no bindings to Cygwin, so in
order to make it work, the i/o of crontab will need to be changed. 
Thus, it will introduce possible instabilities into a piece of
software which is extremely reliable at the moment.  It's called
"Don't fix it if it isn't broken".  AFAICT, cron is working within
specified parameters.  I'm sure 90% of the people out there would
agree.
 
> > Why should Corinna, or anyone else for that
> > matter, patch the *working* cron sources just for *you* when
> there
> > are perfectly good tools already available?
> 
> I don't know, I was under the impression that the interoperabilty
> between
> Windows programs and Cygwin where of high priority. If I'm not
> mistaken
> I have seen several times statements written here that cygwin is no
> *nix
> and has no intention to become one. In fact thats logical becouse
> then one
> might better take the step to any *nix instead of bothering with a
> hybrid.
> > I'm sorry my friend,
> 
> I'm not your friend, nor is it very likely that I will ever become
> one.

Obviously you aren't aware of sarcasm when it is directed at you...

> > but
> > this isn't Burger King, where you can have it your way right
> away.
> 
> What gave you the impression I would like to have my way right
> away?

Well, in a follow up message, earlier in this thread, you stated
that:
If Corinna was reading this that she should investigate and patch the
code to work for you.

Again, nobody else seems to have a problem with not wanting to use
the tools that come with the toolkit...  Only you.  Wonder why that
is?

> > I
> > applaud Igor for being generous and doing the research for you,
> but I
> > don't think you should expect it every time.  I think you read
> too
> > much into "use vi".  It was simply providing a sensible
> alternative
> > to Windows NotePad which provides the same functionality without
> the
> > need for modifing *working* sources.  If that doesn't suit you,
> > TextPad looks like a viable alternative...
> 
> How thick are you anyway? Haven't you understood anything of 
> Igor's splendid explanation. You who are preaching the most about
> reading
> and research on this list seem to fail the exercise completely.
> Might 
> highschool be a good advise? It might help you to prevent more of
> these
> painfull mistakes.

What does this have to do with anything?  As far as I see it, you
asked a question that implied you had done no research.  You didn't
follow the guidelines by even giving us a hint about what you had
already done to investigate the situation.  The facts in your case
were scare if non-existant.  I suggest you considier learning the
scientific method, as it would give you the ability to produce better
bug reports.

> > Cheers,
> > Nicholas
> 
> Sure blame it on the alcohol.

Well I don't drink, so I really wouldn't know.  You might want to
keep off the crack rock though...



__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Crontab problems
  2002-09-15  5:49             ` Raphael
  2002-09-15  7:44               ` Nicholas Wourms
@ 2002-09-16 16:24               ` Warren Young
  1 sibling, 0 replies; 15+ messages in thread
From: Warren Young @ 2002-09-16 16:24 UTC (permalink / raw)
  To: Cygwin-L

Raphael wrote:
> I cannot see the security 
> issue for Cygwin as I now work arround by editing /var/cron/tabs/<currentuser>
> directly and restarting the service afterwards.

The security problem is a race condition.  Here's the scenario:

1. The crontab program makes a copy of the cron file to a temp file and 
then launches your $EDITOR on that file.

2. Editor reads file in, lets you modify it.  You say 'File | Save'.

3. Editor removes/renames temp file.

4. Security risk here.  (Details below.)

5. Editor creates a new file with the temp file name and writes file 
contents into it.

6. Editor exits, crontab installs new file and exits.

So what can happen at 4?  Here's one possibility which might even have 
a few variations:

1. Malicious program sits watching for crontab to start up, then watches 
the /tmp directory for new files.

2. A new file appears.  Now the malware sits waiting for it to disappear.

3. File disappears, and in the split second that it's gone the malware 
quickly writes out a new file with that name and keeps it open so that 
the $EDITOR can't write new contents into it.

4. Editor tries to open a new file with the temp file name for writing, 
but fails because there's already a file with that name.  User assumes 
that Windows is buggy (good guess, but wrong this time) and exits 
$EDITOR without saving.

5. The file is still open, but if you create the file with the right 
permissions it can still be read.  Crontab notices that the file has a 
new modification time, so it assumes that $EDITOR successfully rewrote 
the file; it reads the file and installs it.

6. At a time chosen by the malware's author, cron runs a program with 
Raphael's authentication token.  Since this is Windows, user Raphael is 
probably an Administrator.  One PC, cracked like an egg.

Since you're already editing the crontab file directly with an 
erase/rename-and-rewrite type of editor, you've opened yourself to this 
kind of security problem already.  I hope this worries you.

There are ways around this problem, at least under Unix type systems and 
probably also on systems running NTFS.  One is for crontab to make a 
directory under /tmp which is readable and writeable only by the user 
that owns the cron file, and to place the temp file into that directory. 
  Then the malware has no way of creating a file in that directory 
unless it already holds your authentication token, in which case there 
is little point to the attack to begin with.  This is a much bigger 
patch than making crontab close the file before handing it off to your 
$EDITOR, though.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: Crontab problems
@ 2002-09-11 14:32 Harig, Mark A.
  0 siblings, 0 replies; 15+ messages in thread
From: Harig, Mark A. @ 2002-09-11 14:32 UTC (permalink / raw)
  To: Nicholas Wourms, Raphael, cygwin

I can think of several Cygwin-supported
alternatives/workarounds.
None of them address your question, however.

1. Set the environment variable EDITOR to 'vi'
or 'vim', as suggested by Nicholas Wourms:

   $ export EDITOR=vi
   $ crontab -e

2. Install 'nano' using 'setup.exe'.  nano is
   a small emacs-like editor (closer to emacs
   than to vi).  Then set EDITOR to nano:

   $ export EDITOR=nano
   $ crontab -e

3. Install 'emacs' using 'setup.exe' and set
   EDITOR to 'emacs' or 'emacs -nw':

   $ export EDITOR=emacs
   $ crontab -e

> -----Original Message-----
> From: Nicholas Wourms [mailto:nwourms@yahoo.com]
> Sent: Wednesday, September 11, 2002 4:48 PM
> To: Raphael; cygwin@cygwin.com
> Subject: Re: Crontab problems
> 
> 
> 
> --- Raphael <raphael@oninet.pt> wrote:
> > Hi guys/girls~,
> > 
> > I'm having a bit of a problem with my windows based editor. Using
> > 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
> 
> __________________________________________________
> Yahoo! - We Remember
> 9-11: A tribute to the more than 3,000 lives lost
> http://dir.remember.yahoo.com/tribute
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-09-16 22:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-11 12:47 Crontab problems Raphael
2002-09-11 13:48 ` Nicholas Wourms
2002-09-11 15:20   ` Igor Pechtchanski
2002-09-14  3:01     ` Raphael
2002-09-14 10:52       ` Igor Pechtchanski
2002-09-14 14:46         ` Raphael
2002-09-14 18:47           ` Igor Pechtchanski
2002-09-15  5:49             ` Raphael
2002-09-15  7:44               ` Nicholas Wourms
2002-09-15  9:19                 ` Raphael
2002-09-15 15:18                   ` Nicholas Wourms
2002-09-15  9:53                 ` Igor Pechtchanski
2002-09-15  9:54                   ` Igor Pechtchanski
2002-09-16 16:24               ` Warren Young
2002-09-11 14:32 Harig, Mark A.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).