[comp.os.rsts] RSTS/E Protection codes.

cca@cs.exeter.ac.uk (Clive Carmock) (03/29/90)

I have benn using on old Systime system running RSTS/E.  I wonder if anyone could
enlighten me slightly as to the file protection codes.  I would like to know
how to change the protection code of an EXISTING file.

Also if the codes do not permit execute Read OR write to a user - does that
cause the filename to be hidden as well??  If not how are filenames hidden - 
i.e log in as a 1,* user and see all names login as another user and see only
some filenames.

Finally how is asystem program recompiled (BASIC source) to form a xxx.RSX
file for inclusion in the library??

Many thanks for any help - by e-mail if possible.
Clive Carmock
(cca@cs.exeter.ac.uk   OR   cca@expya.UUCP)

terry@spcvxa.spc.edu (Terry Kennedy) (03/29/90)

In article <2010@mit-amt.MEDIA.MIT.EDU>, adam@mit-amt.MEDIA.MIT.EDU (Adam Glass) writes:
> I'm not sure how modern the utilities I have at shool are, but I'll
> give it a shot. I'm going to assume you have PIP...
> 
> pip filename<protection>/re

  If you're on version 9.0 or higher of RSTS, the DCL syntax is:

  SET FILE/PROTECTION=n filnam.typ

> I'm not sure if what is about to follow is 100% correct. Maybe someone
> can help:

  For non-executable files:

     1 - Protect against reading by owner
     2 - Protect against writing by owner
     4 - Protect against reading by group
     8 - Protect against writing by group
    16 - Protect against reading by world
    32 - Protect against writing by world
    64 - Executable program
   128 - Protected file, overwrite when deleted

  For executable files:

     1 - Protect against execution by owner
     2 - Protect against read/write by owner
     4 - Protect against execution by group
     8 - Protect against read/write by group
    16 - Protect against execution by world
    32 - Protect against read/write by world
   128 - Program with privileges (but not .COM files)

  If you can't read/write/execute a file and it is not in your directory,
you won't see it in a directory listing. Remember that privileged users
(V8 or earlier) or users with GREAD/GWRITE/WREAD/WWRITE can view/execute
your files regardless of protection. Other privileges allow this as well,
but make it a little harder (RDNFS, etc...)

> Would someone mind enlightening me as to what sys call 4 does from
> basic plus? It seems to flush the keyboard buffer, but I know it does
> other things in the process.

SYS(CHR$(4%)) is ODT submode (single-character I/O).

> In addition, assuming there is a basic
> plus sys call to elevate job priority, what is the number and the
> syntax?

SYS(CHR$(6%)+CHR$(-22%))

  You need TUNE priv to execute this call. You should also verify that the
rest of the call is filled with 0's in case the call is ever enhanced to
take more parameters.

> You might as well mail answers to me. I'm sure everyone *else*
> has access to the programmer's manual... hmmpf.

  No big deal - it's not like we're drowning under the article load or any-
thing. 8-)

	Terry Kennedy		Operations Manager, Academic Computing
	terry@spcvxa.bitnet	St. Peter's College, US
	terry@spcvxa.spc.edu	(201) 915-9381

adam@mit-amt.MEDIA.MIT.EDU (Adam Glass) (03/29/90)

cca@cs.exeter.ac.uk (Clive Carmock) writes:
> I have benn using on old Systime system running RSTS/E.  I wonder if
> anyone could enlighten me slightly as to the file protection codes.  I
> would like to know how to change the protection code of an EXISTING
> file.

(That's easier than trying to change the protection code of a
nonexistant file, let me assure you.)

I'm not sure how modern the utilities I have at shool are, but I'll
give it a shot. I'm going to assume you have PIP...

pip filename<protection>/re

...will rename the file 'filename' (optionally proceed with ppn and
device) to have the protection code 'protection'. The '/re' switch
just means rename. '/co' is copy, '/de' delete, etc. You can add '/lo'
and PIP will tell you what it did. Wildcards are allowed in most cases.

You can also use the 'dest<prot>=source/switches' syntax to rename.
This is the syntax to use if you want to copy.

I'm not sure if what is about to follow is 100% correct. Maybe someone
can help:

bit 0 - Owner read (same project and programmer numbers)
bit 1 - Owner write
bit 2 - Group read (same project number, different programmer number)
bit 3 - Group write
bit 4 - World read (different project and programmer numbers)
bit 5 - World write
bit 6 - (Compiled? Privileged? What?)
bit 7 - (Unused?)

I think there's a different system for compiled code, but as I'm
having a little trouble with my sysadmin at school (not MIT), I don't
think I'll be able to correct this or get into it further. (Actually,
he deleted all online help files and refuses to let me see the RSTS/E
Programmer's Manual or the DCL guides, but as this isn't
comp.os.rsts.bitch.about.sysadmins, I'll stop whining.)

> Also if the codes do not permit execute Read OR write to a user -
> does that cause the filename to be hidden as well??

No, you will not see the filename in the directory listing if this is
the case.

> i.e log in as a 1,* user and see all names login as another user and
> see only some filenames.

Exactly.

> Many thanks for any help - by e-mail if possible.

Aw, heck. Maybe others are interested.

Would someone mind enlightening me as to what sys call 4 does from
basic plus? It seems to flush the keyboard buffer, but I know it does
other things in the process. In addition, assuming there is a basic
plus sys call to elevate job priority, what is the number and the
syntax? You might as well mail answers to me. I'm sure everyone *else*
has access to the programmer's manual... hmmpf.

Adam
--            (adam@media-lab.media.mit.edu, soon to be ag??+@andrew.cmu.edu)
"Didn't mean to make you cry... sometimes wish I'd never been born at all..."

kph@dustbin.cisco.com (Kevin Paul Herbert) (03/29/90)

Adam Glass (adam@mit-amt.MEDIA.MIT.EDU) did a good job of answering most
of the questions. Here are some additional details.

>Also if the codes do not permit execute Read OR write to a user - does that
>cause the filename to be hidden as well??
It depends on the version of RSTS that you run. Around V7.0, a feature patch
wsa released by DEC which caused the directory functions to not report files
that a user could not read. Later on, the default changed, and a feature
patch came out to change back to the old behavior. Later, the feature patch
was dropped entirely.

>i.e log in as a 1,* user and see all names login as another user and see only
>some filenames.
The basic rule is that you can't see what you can't access. For pre-V9.0
systems, this means that [1,*] can see everything, and other accounts
are limited based on protection code. For V9.0, people with world read
privilege can see all files regardless of protection, people with group
read privilege can see all group files, and otherwise it uses protection
code.

Here are the definitions of bits 6 and 7:

bit 6 - Executable file. Change the meaning of all "read" access bits
to mean "execute" and "write" to be "read/write". This means that a <104>
file is world-execute, but read/write only by owner. That's different
than <40>, which is world-read, but read/write only by owner.

bit 7 - Privileged file. If this bit is on, the file will get erased by
the system when it is deleted, so disk scroungers won't find the data.
Further, if bit 6 is on, when run, the program will get termporary
privileges.

I don't have RSTS manuals anymore, and I don't remember off-hand what
SYS(CHR$(4%)) does. It is one of the terminal control functions, but
I forget which one. As for the priority change, it is privileged so
you wouldn't be able to make use of it anyway.

Kevin