rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re:  Porting rc to Linux
@ 1993-03-22  4:16 Paul Haahr
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Haahr @ 1993-03-22  4:16 UTC (permalink / raw)
  To: jeremy, rc

> When searching the path, why does rc try to double guess the kernel
> by testing the permissions itself rather than just trying to exec it?

because you want to be able to do the path search before you fork.

> And if it has to (whatis), why doesn't it just use the access system
> call rather than doing it for itself in rc_access?

because access lies if you run setuid or setgid, among other things.


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

* Porting rc to Linux
@ 1993-03-22  3:43 Jeremy Fitzhardinge
  0 siblings, 0 replies; 2+ messages in thread
From: Jeremy Fitzhardinge @ 1993-03-22  3:43 UTC (permalink / raw)
  To: rc

I didn't anticipate any problems, but there were a few:

Linux has real ansi headers in /usr/include, so it wasn't necessary to use
the face prototypes in proto.h, and it was undesireable to do so since
the compiler whined about inconsistencies.  I added a new configuration
flag GOODHEADERS that makes proto.h include system headers rather than
define prototypes.

Rc has the "mksignal" script to extract signal names and descriptions from
/usr/include/sys/signal.h.  This didn't work on linux for two reasons:
	/usr/include/sys/signal.h just includes <linux/signal.h> (in
	the kernel source tree).

	linux/signal.h doesn't have comments after each #define describing
	the signal.
I just made mksignal look at a fake signal.h when running under Linux.
A better solution might be to use the sys_siglist array which has
the name to number mapping of the signal names, if not a text description.

They were the easy problems, that prevented compilation.  The subtle
one was in which.c.  Under linux gid_t is defined as an
unsigned short, and getgroups() takes a pointer to gid_t as its second
argument. rc uses an array of ints for the group list, so it got a list
of bad groups.  This meant that rc wouldn't exec a file that was group
executable only and the group was in the user's supplimentary list.

When searching the path, why does rc try to double guess the kernel
by testing the permissions itself rather than just trying to exec it?
And if it has to (whatis), why doesn't it just use the access system
call rather than doing it for itself in rc_access?  The comment
says "does the right thing for group-executable files" - does access()
not work correctly on other Unicies in this case?

	J


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

end of thread, other threads:[~1993-03-22  4:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-03-22  4:16 Porting rc to Linux Paul Haahr
  -- strict thread matches above, loose matches on Subject: below --
1993-03-22  3:43 Jeremy Fitzhardinge

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).