delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/15/13:00:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 15 Apr 2003 12:59:59 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: David Byron <DByron AT everdreamcorp DOT com>
cc: cygwin AT cygwin DOT com
Subject: RE: Crontab on Win9X works
In-Reply-To: <217E3C0C100E144B93AF131E71C6D62A031E7F5E@edc-exchange.everdreamcorp.com>
Message-ID: <Pine.GSO.4.44.0304151255080.22724-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Tue, 15 Apr 2003, David Byron wrote:

> Pierre A. Humblet wrote
>
> > Corinna Vinschen wrote:
> > >
> > > On Mon, Apr 14, 2003 at 10:44:23PM -0400, Pierre A. Humblet wrote:
> >
> > > > The change in env.c reverts to ignoring the daemon
> > > > environment, on Win9x only.
> > >
> > > Why?
> >
> > For the same reason as the original cron does it, I guess.
> > On Win9X it is typically a large user environment, including
> > functions in the case of bash. On NT it is only the small
> > service environment. Also the functions screw up the mail
> > headers (because "}>" isn't a valid
> > mail header), as in
> > ******************************
> > X-Cron-Env: <WINDOWID=168105192>
> > X-Cron-Env: <_=./cron>
> > X-Cron-Env: <fontpath=() {  xset fp+ /ust/lib/X11/fonts/75dpi
> > Date: Mon, 14 Apr 2003 18:20:00 -0400
> >
> > }>
> > X-Cron-Env: <rm=() {  command rm -i "$@"
> > }>
> > X-Cron-Env: <xfig=() {  command xfig -latexfonts -specialtext
> > -pwidth 8
> >   -pheight 7 -but_per_row 3 +-startgridmode 1 -startposnmode 1 $* & }>
> > **********************************
>
> I ran into this same thing under XP when I start cron from my user context.
> One of my environment variables has a carriage return in it so that
> everything before it goes properly into the header, and everything after it
> goes into the body of the message.  I'm not sure what the right solution is.
> Is there some kind of quoting convention that ssmtp understands?  I'm
> attaching /etc/profile since it contains the offending definition of PS1 and
> it's hard to get right in the body of the message.
>
> This part ends up in the header:
>
> X-Cron-Env: <PS1=\[\033]0;\w\007
>
> This ends up in the body of the message:
>
> \033[32m\]\u@\h \[\033[33m\w\033[0m\]
> $ >
> X-Cron-Env: <PWD=/usr/src/cron-3.0.1-7>
> X-Cron-Env: <SESSIONNAME=Console>
>
> [rest of environment variables snipped...]
>
> > > > USE_SIGCHLD is now left undefined in compat.h to get
> > > > rid of a syslog message about the mail command failing.
> > >
> > > Why?  Isn't a syslog message what we want if the mail command fails?
> >
> > The message will be there if needed. Currently it can be
> > there even when mail succeeds (wait() can return -1).
>
> Thank you.
>
> -DB

According to RFC 2822, a newline followed by whitespace is going to be
"unfolded" (so the newline is not "semantically visible" in the header
field).  The RFC also allows unfolding lines consisting entirely of
whitespace (but not blank lines!).

It seems to me that cron does not accomodate environment values with
whitespace in them at all.  A solution would be to have cron insert a " "
(space) after every newline in the variable value, which will render
newlines harmless.  Does this make sense?
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019