Thursday, December 13, 2012

Basic ITS hacking

OK, so ITS has only one level of directory in its file system, otherwise known as the SNAME portion of a filename.

How do you create a directory if there isn't one already? For instance, if you login as an unknown user JAO and ITS complains it can't find MD:USERS1;LOGIN JAO, and Emacs won't let you create a file USERS1;LOGIN JAO because USERS1; doesn't exist, what do you do?

I expected there to be a DDT command to create a directory. But there isn't one. I found a cryptic comment to "look at the documentation for the OPEN UUO." So I did. Examining SYSDOC;_CALLS.124
The file names  ..NEW. (UDIR)  cause a new directory
to be created with the given sname if none already
exists.  Creating a directory in this way causes a
message to be printed on the system console.
(A directory is destroyed only when the disks are
salvaged by the stand-alone salvager, which is generally
run just before the time-sharing system is restarted.
A directory is then destroyed iff it contains no files.) 
I.e., a magic file name which, if opened, causes a new SNAME to be created. I used Emacs Find File: ^X^F USERS1; DSK: ..NEW. (UDIR) (note that Emacs is a bit scrambled in how it presents file names) but you probably should do something simpler like asking DDT to
:PRINT DSK:USERS1;..NEW. (UDIR)
TODO: Document here what I did for PWORD, PANDA

Still to puzzle out: what to do with INQUIR and how to simulate ACOUNT if I have already logged in as the user.

No comments:

Post a Comment