[net.sources] ACCESS 2A REPOSTED/SPLIT

mahler@pur-ee.UUCP (Mahler) (11/18/84)

This is the distribution for the access, info, and lock programs.
It is contained in four separate mailings; each mailing is in
so-called "shell archive" format.

This is file 2 of 4.

To extract the sources and compile the programs, do the following:

	1. Save this file and the others into four separate
	   files.  Edit the files and delete the mail headers
	   and this text (delete from line 1 up to and including 
	   the line marked "--- CUT HERE ---").

	2. Create an empty directory and copy the files you
	   made in step 1 into it.  Now give each file to
	   the shell by typing

			sh filename1
			sh filename2
			sh filename3
			sh filename4

	   This will extract the various files in the
	   distribution.

	3. Fill in the answers to the questions by editing the file
	   QUESTIONAIRE and mail it to

		{decvax, ihnp4, ucbvax}!pur-ee!mahler

	   This is so we'll know just who is running the
	   program, and so we can distribute any corrections
	   or enhancements.

	4. Follow the directions contained in the README file.

------------------------- CUT HERE -----------------------------
# This is a shell archive.  Save this into a file, edit it
# and delete all lines above this comment.  Then give this
# file to sh by executing the command "sh file".  The files
# will be extracted into the current directory owned by
# you with default permissions.
#
# The files contained herein are:
#    QUESTIONAIRE       access.1         info.1         lock.1
# 
#
echo 'x - QUESTIONAIRE'
sed 's/^X//' <<'________This_Is_The_END________' >>QUESTIONAIRE
XPlease fill out this questionaire and return it (via electronic mail,
Xpreferably) to:
X
X		{decvax, ihnp4, ucbvax}!pur-ee!mahler
X			- or -
X		ecn.mahler@purdue
X
X1. What is the name of your organization?
X
X2. What is your name, electronic mail address, and U.S. Mail address?
X
X3. How many machines does your site operate, and what are they?
X
X4. What version of UNIX are you running at your site?
X
X5. Do you plan to use access in any introductory courses and/or
X   documentation at your site?
X
XThank you for yor time and interest.
________This_Is_The_END________
echo 'x - access.1'
sed 's/^X//' <<'________This_Is_The_END________' >>access.1
X.TH ACCESS 1 PURDUE-ECN
X.SH NAME
X.B access
X\- check, interpret, and modify file permissions
X.SH SYNOPSIS
X.B access
X[path ...]
X.SH DESCRIPTION
X.B Access
Xis an interactive program for checking,
Xinterpreting,
Xand changing file permissions.
XBy using
X.B access,
Xa user may find out who may read,
Xwrite,
Xexecute,
Xand remove any of his files;
Xand he may change these parameters at will.
X.PP
XTo run
X.B access,
Xsimply type ``access'' to the shell for interactive mode, or type
X``access pathname [...]'' for access information only.
XThe message ``Initializing, please wait.....'' will be printed on your
Xscreen.
XIt takes
X.B access
Xabout two minutes to initialize (it may take longer on a heavily loaded
Xsystem).
XWhen the initialization procedure is complete,
Xyou will see a message telling you what directory you are in,
Xand then the prompt ``Command:.''
XFrom the prompt,
Xyou may type the following commands:
X.IP "\fBaccess\fP \fIfile\fP [\fIfile file .....\fP]"
XThe
X.B access
Xcommand prints out a list of who may read,
Xwrite,
Xexecute,
Xand remove each file or directory listed on the command line.
XThis list may be a single user's name,
Xthe name of a group,
Xor a list of names.
XAlthough
X.B access
Xis fairly smart about figuring out the most concise way to list the people
Xwho may do something to a file,
Xoccasionally it can't.
XIf this happens,
Xa line such as ``there are 592 names in this list'' will be printed,
Xand you will be asked if you really want to see the list.
XIf you do want to see the list,
Xtype `y' (for `yes'),
Xotherwise,
Xtype `n' (for `no').
X.IP "\fBcat\fP [\fIargs\fP] \fIfile\fP [\fIfile file .....\fP]"
XExecute the
X.B cat(1)
Xprogram on the named files.
XThis is used when you want to see what a file contains.
XSome of the arguments
X.B cat
Xaccepts are \fB\-n\fP to number the lines,
Xand \fB-v\fP to print ``invisible'' characters.
X.IP "\fBcd\fP \fIdirectory-name\fP"
XChange into the directory named
X.I directory-name.
XThis command is just like the shell command of the same name.
X.IP "\fBchmod\fP \fImode file\fP [\fIfile file .....\fP]"
XExecute the
X.B chmod(1)
Xcommand on the named files.
X.B Chmod
Xis used to change the permissions on a file.
XModes are described in the manual for
X.B chmod
Xand also in the help file for
X.B access
X(see below).
X.IP "\fBexit\fP"
XExit the
X.B access
Xprogram.
X.IP "\fBquit\fP"
XThe same as
X.B exit.
XYou may also type Control-D to exit.
X.IP "\fBhelp\fP"
XDisplay a help file listing all the commands available and their uses.
XThis file is printed with the
X.B more(1)
Xcommand.
XTyping a question mark (`?') also shows this file.
X.IP "\fBinfo\fP [\fIargs\fP] \fIfile\fP [\fIfile file .....\fP]"
XRun the
X.B info(1)
Xcommand on the named files.
X.B Info
Xprints out various pieces of information about a file or directory,
Xsuch as its mode,
Xowner,
Xsize,
Xcontents,
Xcreation time,
Xetc.
XSome of the arguments to
X.B info
Xinclude \fB\-v\fP to print even more information,
Xsuch as number of links,
Xinode numbers,
Xetc.,
Xand \fB\-f\fP to skip trying to guess what's in the file.
X.IP "\fBlock\fP [\fIfile file file .....\fP]"
XLock the named files.
XIf no files are named,
Xthen the current directory is locked.
X.B Lock
Xis a variant of the
X.B chmod
Xcommand;
Xit simply makes everything mode 0700 (readable, writable, and executable
Xby the owner only).
X.IP "\fBls\fP [\fIargs\fP] [\fIfile file file .....\fP]"
XExecute the
X.B ls(1)
Xcommand on the named files.
XIf no files are named,
Xthe files in the current directory are listed.
XSome of the arguments to
X.B ls
Xinclude \fB\-l\fP to get a long listing,
X\fB\-s\fP to show the size in kilobytes of each file,
Xand \fB\-a\fP to show files whose names begin with `.'.
X.IP "\fBmore\fP [\fIargs\fP] \fIfile\fP [\fIfile file .....\fP]"
XExecute the
X.B more(1)
Xcommand on the named files.
X.B More
Xis similar to
X.B cat,
Xexcept that it stops after every page of the file and waits for the
Xuser to press the space bar before going to the next page.
X.IP "\fBpwd\fP"
XPrint the pathname of the current directory.
X.IP "\fBsh\fP"
XExecute a shell.
XThe shell executed is normally taken from the environment variable
X.B SHELL,
Xif this is not set,
X.I /bin/sh
Xis used.
XTo return to
X.B access,
Xtype Control-D (press the CTRL key and the D key at the same time).
X.IP "\fBcsh\fP"
XThe same as the
X.B sh
Xcommand.
X.IP "\fBunlock\fP [\fIfile file file .....\fP]"
XUnlock the named files.
XIf no files were named,
Xunlock the current directory.
XThis is the inverse of the
X.B lock
Xcommand;
Xit makes the named files mode 0755 (readable, writable, and executable by
Xthe owner, readable and executable by everyone else).
X.PP
X.B Access
Xunderstands the so-called metacharacters used in the shell.
XThat is,
Xwhen naming files,
Xthe characters `*',
X`?',
Xand `[]'
Xhave special meanings.
XThese are described in the manual for your shell,
Xeither
X.B sh(1)
Xor
X.B csh(1).
X.B Access
Xalso understands the `~' character,
Xwhich represents the home directory.
XFor example,
Xa `~' alone represents your home directory,
Xbut ``~bozo'' represents the home directory for user ``bozo.''
X.SH SEE ALSO
X.BR cat (1),
X.BR chmod (1),
X.BR csh (1),
X.BR info (1),
X.BR ls (1),
X.BR more (1),
X.BR sh (1)
X.SH BUGS
X.PP
XIt would be nice if the initialization process weren't so slow,
Xbut to speed it up would require making a special database just
Xfor that purpose.
X.SH AUTHOR
XDavid A. Curry
X.br
XPurdue Engineering Computer Network
X
________This_Is_The_END________
echo 'x - info.1'
sed 's/^X//' <<'________This_Is_The_END________' >>info.1
X.TH INFO 1 PURDUE-ECN
X.SH NAME
X\fBinfo\fR \- print information about files
X.SH SYNOPSIS
X\fBinfo\fR [\fB\-f\fR] [\fB\-s\fR] [\fB\-v\fR] \fIfiles\fR ...
X.SH DESCRIPTION
X.B Info
Xis used to find out about files.
XFor each filename given on the command line, 
X.B info
Xwill print information about that file, such as its size, mode, owner,
Xcontents, last access time, etc.  
XCertain information is always printed,
Xwhile other less pertinent information is only printed when the
X.B \-v
X(verbose) flag is given.
X.PP
XThe information printed is described in detail below:
X.IP "File Name"
XThe name of the file, as given on the command line.
X.IP "File Type"
XThis is a description of what the file is.
XThere are numerous file types on 
X.BR \s-2UNIX\s0 ,
Xthey are described in section 4 of the manual.
XA brief list is given below:
X.RS
X.IP "normal file"
XThis is a standard text file, such as might be created with an editor
Xor compiler.
X.IP "directory"
XThis is a special file which contains other files.
X.IP "socket"
XThis is a special file which is used by two processes to communicate
Xwith each other.
XSometimes sockets are called "named pipes".
X.IP "symbolic link"
XThis is a special type of file which "points" to another file.
X.IP "block special file"
XThis is a special type of file which is connected to devices such as
Xtape drives or disks which do input and output in large volumes.
X.IP "character special file"
XThis is a special type of file which is connected to devices such as
Xterminals which do single-character input and output.
X.RE
X.IP "File Size"
XThe size of the file, in both bytes and kilobytes.
X.IP "File Contents"
XProvided the file is a "normal" file (see above) and it is readable, 
X.B info
Xwill attempt to make an educated guess about what the file contains.
XThis is done by reading the first 1024 bytes of the file and applying
Xsome simple tests to what is read.
XIf the
X.B \-f
Xflag is given before the filename, 
X.B info
Xwill skip trying to guess what's in the file.
X.IP "Uid of Owner"
XThis is the login name of the person who owns the file, followed by
Xhis numeric user id in parentheses.
XIf for some reason 
X.B info
Xcannot determine the owner's login name, it will use his user id instead.
X.IP "Gid of Owner"
XThis is the name of the group which owns the file, followed by
Xthe numeric group id.
XIf for some reason the group name is unavailable,
X.B info
Xwill use the group id instead.
X.IP "File Mode"
XThe mode of the file is printed as a set of nine characters from the
Xset {\-, r, s, t, w, x}, just as \fIls\fR(1).
XThese nine characters are interpreted as three sets of three bits each.
XThe first set of three refers to the owner of the file's permissions,
Xthe second set of three refers to the permissions for other members
Xof the owner's group, and the third set refers to permissions for
Xanyone else not covered by the first two sets.
XWithin each set, the three characters indicate permission respectively
Xto read, to write (modify), or to execute the file as a program.
XFor a directory, ``execute'' permission is interpreted as permission 
Xto search the directory.
XThe permissions are indicated as follows:
X.sp
X.ta 5m 10m
X	\fBr\fR	if the file is readable;
X.br
X	\fBw\fR	if the file is writable;
X.br
X	\fBx\fR	if the file is executable;
X.br
X	\fB\-\fR	if the indicated permission is not granted.
X.IP
XThe group-execute permission character is given as \fBs\fR if the
Xfile has the set-group-id bit set; likewise the user-execute
Xpermission character is given as \fBs\fR if the file has the set-user-id
Xbit set.
XThese bits imply that when executing the program, a user will be
Xrunning as if his group id (user id) were that of the group (user)
Xowning the file.
XIf the world-execute permission character is given as \fBt\fR, this
Xmeans that the file's core image will not be deleted from the swap
Xdisk between executions.
XThis is used by the system management to increase efficiency; the
Xbit may not be set by anyone other than the super-user (see 
X\fIsticky\fR(8)).
X.IP "Explanations"
XFollowing the mode line, 
X.B info
Xwill print an explanation of what the line means.
XThis is done by listing the permissions granted for the owner, owner's
Xgroup, and everyone else.
XInformation is also printed about the set-user-id and set-group-id bits
Xif they are set.
X.IP "Links to File"
XThis is the number of entries in the filesystem which refer to this
Xfile (see \fIln\fR(1)).
XIt should be noted that a file always has at least one link (itself) and
Xa directory always has at least two (itself and its parent).
XThis field is only printed if the \fB\-v\fR flag is given.
X.IP "Inode Number"
XThe number of the file's inode.
XAn inode is the internal representation of a file for 
X.BR \s-2UNIX\s0 ;
Xit contains such information as where the file is located on disk.
XAn inode number by itself does not uniquely determine a file, the
Xdevice number of the disk drive the file is on (see below)
Xis also required.
XThus, it is possible for two or more files to have the same inode number.
XFurther, if two files are linked, they will have the same inode number.
XThis field is printed only when \fB\-v\fR is given.
X.IP "Major/Minor Device"
XThese two numbers are printed only when the file is a device, and the
X\fB\-v\fR flag has been given.
XThey specify, respectively, which device driver to use when talking
Xto the device, and which device to talk to with the driver.
X.IP "Inode's Device"
XThis is the minor device number of the disk drive on which the file
Xresides.
XThis field is only printed when \fB\-v\fR is given.
X.IP "Times"
XThree times are associated with each file.
XThe file's creation time indicates when that file came into existence
Xon the disk.
XThe file's modification time indicates the last time the file was
Xmodified (edited).
XIn the case of a directory, the modification time indicates the last
Xtime a file was created in or removed from the directory.
XThe file's access time indicates the last time the file was read, or,
Xin the case of a program, executed.
X.SH SEE ALSO
X.BR file (1), 
X.BR chmod (1), 
X.BR ls (1), 
X.BR chmod (2), 
X.BR stat (2), 
X.BR intro (4), 
X.BR sticky (8)
X.SH DIAGNOSTICS
X.PP
XShould be self-explanatory.
X.SH BUGS
X.PP
XThe algorithm for determining what a file contains is easily fooled.
XIn particular, if a program contains a large comment in the front,
Xthe algorithm is often misled into believing the file contains ASCII
Xtext.
X.SH AUTHOR
XDavid A. Curry
X.br
XPurdue Engineering Computer Network
________This_Is_The_END________
echo 'x - lock.1'
sed 's/^X//' <<'________This_Is_The_END________' >>lock.1
X.TH LOCK/UNLOCK 1 PURDUE-ECN
X.SH NAME
X.BR lock ,
X.B unlock
X\- lock and unlock a directory or file
X.SH SYNOPSIS
X.B lock
X[\fIname\fP]
X.br
X.B unlock
X[\fIname\fP]
X.SH DESCRIPTION
X.PP
X.B Lock
Xand
X.B unlock
Xare used to change the access rights of other users to
Xyour files and directories.
X.B Lock
Xprevents other users from reading or
Xexecuting your files.
X.B Unlock
Xallows other users to share your files
Xby reading or executing them.
X.PP
XIf called without any arguments
X.B lock
Xwill
X``change the mode'' of your home directory
Xso that only you can get at the files (and possibly
Xsubdirectories) within your home directory.
X.PP
XIf
X.B unlock
Xis called with no argument your home directory
Xwill then be sharable by others.
XIf you have locked any subdirectories
Xor files within your home directory, they will still remain
Xlocked as intended.
X.PP
XIf
X.B lock
Xis called with a filename or directory as an argument, that
Xfile, or the files within that directory, will not be usable by others.
XIf the name that you give
X.B lock
Xdoes not currently exist as a
Xfile or directory,
X.B lock
Xwill make a directory for you of that name,
Xand then make it unusable by others.
X.PP
XWhen
X.B unlock
Xis called with a filename or directory as an argument,
Xthat file, or the files within that directory, become sharable by others.
X.PP
X.B Lock
Xand
X.B unlock
Xchange modes and make directories behind your back.
X.SH "SEE ALSO"
X.BR access (1),
X.BR chmod (1),
X.BR info (1),
X.BR mkdir (1)
________This_Is_The_END________
exit