The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] v5 and v6 kernel is mode 777
@ 2015-02-22 19:50 Noel Chiappa
  2015-02-22 20:01 ` Dave Horsfall
  0 siblings, 1 reply; 9+ messages in thread
From: Noel Chiappa @ 2015-02-22 19:50 UTC (permalink / raw)


    > From: Mark Longridge

    > There's no reason for it to be mode 777 is there?

Not that I know of. Once UNIX has booted, it has no use for 'unix' (or
whatever file it booted from), and the boot loader doesn't even read the mode.

I think I habitually set mine to 644. (The 'execute' bits are, of course,
pointless...)

	Noel



^ permalink raw reply	[flat|nested] 9+ messages in thread
* [TUHS] v5 and v6 kernel is mode 777
@ 2015-02-22 20:19 Noel Chiappa
  0 siblings, 0 replies; 9+ messages in thread
From: Noel Chiappa @ 2015-02-22 20:19 UTC (permalink / raw)


    > From: Dave Horsfall <dave at horsfall.org>

    >> Once UNIX has booted, it has no use for 'unix' (or whatever file it
    >> booted from)

    > Didn't "ps" try and read its symbol table?

Sorry, meant 'UNIX the monolithic kernel'; yes, ps and siblings (e.g. iostat)
need to get the running system's symbol table.


    > I had fun days when I booted, say, "/unix.new", and "ps" wouldn't
    > sodding work...

Know that feeling! I added the following to one of the kernel data files:

    char *endsys &end;

and then in programs which grab the system's symbol table, I have an nlist()
entry:

  "_endsys",

with the follwing code:

  /* Check that the namelist applies to the current system.
   */

  checknms(symfile)
  char	*symfile;

  {	char	*chkloc, *chkval;

	if (nl[0].type == 0)
		cerror("No namelist\n");

	chkloc = nl[ENDSYS].value;
	chkval = rdloc(chkloc);

	if (chkval != nl[END].value) {
		cerror("Symbol table in %s doesn't match running system\n",
		       symfile);
		}
  }

on the theory that pretty much any change at all is going to result in a
change in the system's size (and thus the address of 'end').

Although in a split I/D system, this may not be true (you could change the
code, and have the data+BSS remain the same size); I should probably check
the location of 'etext' as well...

Anyway, a rebuilt system may result in the address of 'endsys' changing, and
thus the rdloc() won't return the contents of the running system's 'endsys',
but the chances of an essentially-random fetch being the same as the value of
'end' in /unix are pretty slim, I would say...

	Noel



^ permalink raw reply	[flat|nested] 9+ messages in thread
* [TUHS] v5 and v6 kernel is mode 777
@ 2015-02-22 19:36 Mark Longridge
  2015-02-22 19:49 ` Ronald Natalie
  2015-02-22 19:56 ` Dave Horsfall
  0 siblings, 2 replies; 9+ messages in thread
From: Mark Longridge @ 2015-02-22 19:36 UTC (permalink / raw)


I just had it brought to my attention that the unix kernel is mode 777
in Unix v5 and v6:

ls -l /unix
-rwxrwx  1 root        27066 Mar 23  1975 /unix

There's no reason for it to be mode 777 is there? It seems rather dangerous.

In Unix v7 it defaults to mode 775 and in 32v it is 755. I figure it
setting it to mode 755 will work and so far it seems fine in v5.

Mark



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

end of thread, other threads:[~2015-02-23 18:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-22 19:50 [TUHS] v5 and v6 kernel is mode 777 Noel Chiappa
2015-02-22 20:01 ` Dave Horsfall
2015-02-23  5:31   ` Ed Carp
2015-02-23 18:42     ` scj
  -- strict thread matches above, loose matches on Subject: below --
2015-02-22 20:19 Noel Chiappa
2015-02-22 19:36 Mark Longridge
2015-02-22 19:49 ` Ronald Natalie
2015-02-22 20:30   ` Mark Longridge
2015-02-22 19:56 ` Dave Horsfall

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