rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: <d7stfax@dtek.chalmers.se>
To: rc@archone.tamu.edu (The rc mailing list)
Subject: Re: Why doesn't signal handlers export?
Date: Fri, 29 Nov 1991 05:19:45 -0600	[thread overview]
Message-ID: <9111291119.AA19075@hacke4.dtek.chalmers.se> (raw)

Chris Siebenmann writes: "... what, don't other people write scripts
in rc? :))" I blush in pure shame. What an extremely stupid mistake to
make, especially since I seem to have done nothing *but* writing rc
shell scripts for the last few weeks. Of course I don't want signal
handlers to export to a shell script. I freely admit that I didn't
think about that when I said that "I saw no problems with letting that
happen." or words to that effect. Since I was indeed starting the rc:s
in question from a shell script (.xsession) I really must have been
out of contact with the uppermost part of my anatomy, on that
occasion.

Well that said, (better stop now before everybody thinks I'm a
complete wimp ;-)), I of course poked around the sources, and in no
time (almost) had a running rc that recognized signal handler
functions exported from the parent, really simple to add, just a few
lines of code.  Then I read the CHANGES file in the distribution and
realised that that was probably in order since Byron had *removed* the
export of signal handlers in the transition from version 1.0 or some
such... Well, I hadn't planned to export all signal handlers blindly,
but rather some keyword: 'export sig!whatever!', or some such. Hacking
the sources wasn't a complete waste of time however, I have been
planning to read the sources to rc for some time now, and what I saw
in no ways detered me from continuing. I just needed an excuse to
start doing it. And I also *suspect* but I haven't thought it over,
that one would be introducing a security hole in letting the value of
a signal handler be read from the environment into a shell script.
There is of course the possibility of restricting the import to
interactive shells, but now it's getting complicated enough not to be
worth the effort, switching on interactive vs noninteractive, and
introducing 'export', and of course not letting all signal handlers
export, such as sigterm, sigquit and a few others.

So, after having read (or rather searched) through the archive, I must
confess that I haven't read it thoroughly, I came to the conclusion
that: indeed 'prompt' it is. Thanks for pointing me in the right
direction, and avoiding what could easily have been me advocating a
case of 'creeping featurism,' sometimes one needs the right
perspective.  I still think that there is a bug in the man page, it
should be stated clearly that signal handlers doesn't export like
ordinary functions. As it is now one (I at least) was lulled into
drawing parallels between functions and signal handlers that I
shouldn't have done, them being similar in other areas.

Regards,
-- 
Stefan Axelsson,			Chalmers University of Technology,
d7stfax@dtek.chalmers.se		Sweden


             reply	other threads:[~1991-11-29 11:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-11-29 11:19 d7stfax [this message]
  -- strict thread matches above, loose matches on Subject: below --
1991-11-27 12:45 d7stfax
1991-11-27 20:30 ` Chris Siebenmann

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=9111291119.AA19075@hacke4.dtek.chalmers.se \
    --to=d7stfax@dtek.chalmers.se \
    --cc=rc@archone.tamu.edu \
    /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).