9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: arisawa <arisawa@ar.aichi-u.ac.jp>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] shell functions
Date: Sun, 28 Sep 2014 16:00:00 +0900	[thread overview]
Message-ID: <D821D108-E39D-4C2D-BD68-6217FE79A996@ar.aichi-u.ac.jp> (raw)
In-Reply-To: <8738bdw2hj.fsf@gmail.com>

Hello,

when rc is invoked, rc reconstructs shell variable and shell functions using files in /env/.
in case of shell functions, rc evaluates whole data in the file.
this feature makes problem if the content is
	fn foo {…}; maliciouscommand
I think this problem must be fixed.

Kenji Arisawa

2014/09/27 23:40、Christian Neukirchen <chneukirchen@gmail.com> のメール:
> 
> The problem could be completely avoided if the '{}' were implicit, that
> is, store 
> 
> fn foo { echo bar }
> 
> as
> 
> fn#foo=echo bar
> 
> (Also, I heard Research Unix v8 sh(1) stored functions in the environment
> as "foo(){ ... }", i.e. without =.  So this never clashes with any
> variable.  Not sure if that works portably enough for plan9port, though.)
> 
> -- 
> Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org
> 
> 




  reply	other threads:[~2014-09-28  7:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAL0h+tWUCrwWoTSeLz+Kx1yqKwKqwDBZZbH7fLe-PWXjLSgWWw@mail.gmail.com>
2014-09-26 15:54 ` Russ Cox
2014-09-26 16:32   ` [9fans] " Kurt H Maier
2014-09-26 16:44     ` Skip Tavakkolian
2014-09-26 16:55       ` Kurt H Maier
2014-09-29 15:30     ` Russ Cox
2014-09-26 16:48   ` Bakul Shah
2014-09-27 14:40   ` Christian Neukirchen
2014-09-28  7:00     ` arisawa [this message]
2014-09-28  9:39       ` Richard Miller
2014-09-29 13:03         ` arisawa
2014-09-29 13:20           ` Charles Forsyth
2014-10-01  9:37             ` arisawa
2014-09-29 18:05           ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D821D108-E39D-4C2D-BD68-6217FE79A996@ar.aichi-u.ac.jp \
    --to=arisawa@ar.aichi-u.ac.jp \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).