Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-Id: <5.1.0.14.2.20010628134148.03478e48@imap.mscha.org>
X-Sender: ml@imap.mscha.org (Unverified)
X-Mailer: QUALCOMM Windows Eudora Version 5.1
Date: Thu, 28 Jun 2001 13:53:16 +0200
To: cygwin@cygwin.com
From: Michael Schaap <cygwin@mscha.com>
Subject: Re: CRON and time
In-Reply-To: <D8D1A6A7110BD51188B600E018C673D02D9843@ross.dorotech.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
X-Virus-Scanned: at mscha.com by AMaViSd snapshot-20010407 (http://amavis.org/)
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id HAA06058

At 13:04 28-6-2001, Trikkaliotis Niklos wrote:

>Yes the problems from cron is resolved !!!
>Take the next patch !!!
>Compile the sources, copy the exes in the correct place and run cron as
>service !!!
>All work fine :-))))

Well, It's up to Corinna, of course, but I would be surprised if this patch 
is accepted.
A few comments:


>cron.h
>92c92
>< #define       CRON_TAB(u)     "%s/%s", SPOOL_DIR, u
>---
> > #define       CRON_TAB(u)     "%s/%s/%s", CRONDIR, SPOOL_DIR, u

This should be totally unnecessary.  In every place this is used, the cwd 
is CRONDIR.
In any case, if it would be useful, you should put this change within an 
"#ifdef __CYGWIN__".


>crontab.c
>644c644
><       if (fchmod(fileno(tmp), 0600) < OK)
>---
> >       if (fchmod(fileno(tmp), 0644) < OK)

Also here, this shouldn't be necessary.  The SYSTEM user (which cron should 
be running under) has access to all files.
Also here, in any case, it should be within an "#ifdef __CYGWIN__".


>do_command.c
>232c232
><               if (setuid(e->uid) < 0)         /* we aren't root after
>this... */
>---
> >               if (setuid(ROOT_UID) < 0)               /* we aren't root
>after this... */

This is plain wrong.  The whole point of the setuid is to run as the user 
owning the crontab file.  Instead, you setuid to SYSTEM, which should 
already be the real uid running cron.

Just my € 0.02,

  - Michael


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

