get/rls, serially sharable resource locks

Stephen C. Woods scw at cepu.UUCP
Thu Feb 14 02:54:50 AEST 1985


Here is a shar of a set of programs to allocate devices like tape drives
on a peruser protected basis.
---------------------------cut here---------------------------------------------
#!/bin/sh
echo 'Start of lock.shar, part 01 of 01:'
echo 'x - Makefile'
sed 's/^X//' > Makefile << '/'
XFILES=Makefile READ_ME get.c rls.c get.1 rls.1 lock.7 lokfilefile
XDEST=/bin
X
XCFLAGS=-O -DLOCKSFILE='"/etc/miscdirs/get/lokfilefile"'
X
Xall: get rls
X
Xget: get.o;cc -o get get.o
X
Xrls: rls.o;cc -o rls rls.o
X
Xinstall: install.get install.ret
X
Xinstall.get: get
X	cp get $(DEST)/get
X	chmod og-w,u+s $(DEST)/get
X
Xinstall.rls: rls
X	cp rls $(DEST)/rls
X	chmod og-w,u+s $(DEST)/rls
Xlock.shar: $(FILES); packmail -olock.shar $(FILES)
/
echo 'x - READ_ME'
sed 's/^X//' > READ_ME << '/'
XThis set of programs was written by Dave Butterfield at the UCLA Dept. of
XMathamatics (Now at Locus Computing Corp. Santa Monica CA; dave at lcc.UUCP).
XAnd modified extensively by Steve Woods (scw at cepu.UUCP) to add uucp support.
X
XTo install them, edit the Makefile and change the LOCKSFILE define to
Xthe desired directory/file (currently /etc/miscdirs/get/lokfilefile).
Xensure that the desired directory/file path exsists (see get.1 and rls.1
Xfor details), su to root and make install.  Edit the LOCKSFILE as desired
Xto support any devices that you wish to have lockable.  Edit get.1 to
Xindicate the devices that you have in your LOCKSFILE.
X
XTheory of operation:
X
XThe programs MUST be setuid root to work.
X
X   Get locks files using a link(2) to a creat(2)ed hitching post, if the
Xlink succedes the ownership of all the associated devices (note that they
Xdon't need to be devices) is set to the real userid and the mode is set
Xto 0600. If the link fails you will be notified. In any case the hitching
Xpost is unlink(2)ed.
X
X   Rls attempts to free the specified device (checking that you are the owner,
Xor if you aren't the owner that the owner is not logged in) by checking
Xfor the presence of the lock file, if it's there and the ownership chekc passes
Xit changes the owner of the devices to root, mode 0600 then deletes the lock.
X
XAs a special case if root runs 'rls -s' ALL known devices are realsed and
Xownership is reset.  If any other user runs 'rls -s' or 'rls -y' all locked
Xdevices that he owns are released (put a rls -s in everyones .logout).
X
XThe programs run under V7, so should run under any UN*X variant.
X
XPlease report any problems/bugs to:
X--------------
XStephen C. Woods (VA Wadsworth Med Ctr./UCLA Dept. of Neurology)
Xuucp:	{ {ihnp4, uiucdcs}!bradley, hao, trwrb, sdcrdcf}!cepu!scw
XARPA: cepu!scw at ucla-cs location: N 34 3' 9.1" W 118 27' 4.3"
XVoice: 1 (818) 824-4448
/
echo 'x - get.c'
sed 's/^X//' > get.c << '/'
X/*
X *      get --- a program to do simple device locking.
X */
X/*
X * modified for uucp support Mon Jun  6 17:45:23 PDT 1983
X * by S.C.Woods Wadsworth VAMC (scw!cepu at ucla-s)
X * as follows
X * if argv[0] == "uuget"
X * then even if lock( lkp->link)file exsists
X * as long as lock file is owned by uucp
X * and dev(0) is owned by root
X * then get it anyway
X *
X * to avoid inadvertant locking/unlocking
X * the uuget version should NOT be installed (uucico must fork and exec it
X * correctly)
X *
X * Mod to speed up operation
X * set uuid and ugid as uuid and ugid
X *          or the uid/gid of uucp if this is uuget
X */
X/*
X * format of working file (lokfilefile)
X * full_name_of_lock_file full_name_of_linkto name_of_device minor0 minor1
X * full name of files must include path (in great detail /.../.../...)
X * linkto name should be of a form compatable with mktemp(3)
X * there may be as many as 6 minor devices associated with name_of_device
X * note that name_of_device need not be the same as any minor device
X * exapmle
X * /etc/tape0.lock /etc/lck0tXXXXXX tape0 /dev/mt0 /dev/mt4 /dev/rmt0 /dev/rmt4
X * /usr/spool/uucp/LCK..cul0 /usr/spool/uucp/cul0XXXXXX cul0 /dev/cul0
X */
X#include <stdio.h>
X#include <signal.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <pwd.h>
X
X#ifndef LOCKSFILE
X#define LOCKSFILE     "/etc/miscdirs/get/lokfilefile"
X#endif
X#define MAXSTLEN        40      /*much more than necessary*/
X#define NLOCKS          10      /* "    "     "      "  */
X#define MAXPDEV         6       /* max # phys. devices associate with a name*/
X#define OWNERONLY       0600    /*protection mode for the devices*/
X
X#define Printf  if(!silent) printf
X#define subdev(LP,n)     (& ( (LP)->physdev[n][0]))         /*all dave's fault*/
X
XFILE *fopen();
X
Xtypedef struct {
X        char link[MAXSTLEN],            /*file to link to*/
X             lok[MAXSTLEN],             /*link (lok, link)*/
X             dev[MAXSTLEN],             /* what the user calls it(get dev) */
X             physdev[MAXPDEV][MAXSTLEN];      /* /dev/dev */
X        }dev_lk;
X
Xdev_lk locks[NLOCKS];
X
Xint silent = 0;
X
Xmain(argc,argv)
Xint argc;
Xchar *argv[];
X{
X        register int nlock, i, pdev;
X        register struct lk_dev *lkp;
X        register char **argp;
X        int nerrs = 0;
X	int uuget = 0; /* set if called from uucp */
X	int uuid,ugid;
X	struct passwd *uups;
X	struct stat *statbuf;
X	statbuf=malloc((sizeof *statbuf));
X	uuget= strcmp("uuget",argv[0]) == 0;
X	if(uuget){
X	    uups=getpwname("uucp");
X	    endpwent();
X	    if(uups){
X		uuid=uups->pw_uid;
X		ugid=uups->pw_gid;
X	    }
X	    else{
X		uuid = getuid();
X		ugid = getgid();
X	    }
X	}
X	else{
X	    uuid = getuid();
X	    ugid = getgid();
X	}
X        argp = &argv[1];
X        if( ! strcmp(*argp, "-s")){
X	    silent ++;
X	    argc--;
X	    argp++;
X	}
X        if(argc < 2){
X	    Printf("usage: %s [-s] device [device ...]\n",argv[0]);
X	    exit(1);
X	}
X        if((nlock = read_loks(LOCKSFILE, locks)) < 0){
X	    Printf("%s:%s unopenable or messed up.\n",argv[0],LOCKSFILE);
X	    exit(1);
X	}
X        /* locks have been read-in */
X
X        /*can't be interrupted once we start linking things so ...*/
X        for(i = 1;i < NSIG; signal(i++, SIG_IGN));
X        /*now check each argument*/
X        for(argc--;argc--;argp++){
X	    for(i=0;i < nlock; i++) if(strcmp(locks[i].dev,*argp) == 0) break;
X                if(i >= nlock){
X		    Printf("I don't know how to get %s.\n",*argp);
X		    nerrs++;
X		    continue;
X		}
X	    lkp = &locks[i];
X		
X	    unlink(lkp->lok);
X	    if(uuget){
X		close(creat(lkp->lok,644)) ;
X		if( link (lkp->lok, lkp->link) < 0){
X		    /* special case may be locked already*/
X		    stat(lkp->link,statbuf);
X		    /* but lock must belong to uucp*/
X		    if(statbuf->st_uid != uuid){
X					nerrs++;
X					unlink(lkp->lok);
X					continue;
X				}
X				/* and device must be owned by root or uucp */
X				stat(subdev(lkp,0),statbuf);
X				if(statbuf->st_uid != geteuid() &&
X				   statbuf->st_uid != uuid ){
X					nerrs++;
X					unlink(lkp->lok);
X					continue;
X				}
X			}
X			unlink(lkp->lok);
X			/* note that device ownership changed before lock */
X			for(pdev = 0;pdev<MAXPDEV &&(*subdev(lkp,pdev));pdev++){
X				chown( subdev(lkp,pdev),uuid,ugid );
X				chmod( subdev(lkp,pdev),OWNERONLY);
X				}
X			chown(lkp->link,uuid,ugid);
X			}
X		else{
X			if (close(creat(lkp->lok,644))!=0 
X			|| link (lkp->lok, lkp->link) < 0){ /* Test and lock  */
X				Printf("%s is in use. Try again later.\n",
X					lkp->dev);
X				Printf("\t(or try 'rls %s').\n",lkp->dev);
X				nerrs++;
X				unlink(lkp->lok);
X				continue;
X			}
X			unlink(lkp->lok);
X			chown(lkp->link,uuid,ugid);
X			for(pdev = 0;pdev < MAXPDEV && (*subdev(lkp,pdev));pdev++){
X				chown( subdev(lkp,pdev),uuid,ugid );
X				chmod( subdev(lkp,pdev),OWNERONLY);}
X
X			Printf("You have the '%s'. Please 'rls' it when done.\n",
X					lkp->dev);
X			}
X                }/*endwhile*/
X        exit(nerrs);
X}
X
X
Xint
Xread_loks(lf, lks)
Xchar *lf;
Xregister dev_lk lks[];
X{
X        register FILE *lfp;
X        register dev_lk *dp;
X        register int i;
X        int n;
X	char *cp,*tmpnam="/GETXXXXXX";
X        char line[256];
X
X        lfp = fopen(lf, "r");
X        if(lfp == NULL)
X                return -1;      /*error*/
X
X        /*now read in the entries*/
X        for(dp = lks,i=0; i < NLOCKS ;dp++, i++){
X                if( fgets(line,sizeof(line),lfp) == NULL)            /* if EOF*/
X                        break;
X                                  /*read at most 3 + MAXPDEV entries from line*/
X                n = sscanf(line,"%s%s%s %s%s%s%s%s%s",dp->link,dp->lok,dp->dev,
X                                subdev(dp,0),subdev(dp,1),
X                                subdev(dp,2),subdev(dp,3),
X                                subdev(dp,4),subdev(dp,5));
X                if(n < 3){               /*if line was bad format or blank ...*/
X                        dp--;i--;                                  /*try again*/
X                        continue;}
X                if(n < MAXPDEV + 3)
X                        *subdev(dp, n - 3) = '\0';                 /*no string*/
X		cp=rindex(dp->lok,'/');
X		if(cp){
X			if(index(cp,'X')== 0)strcpy(cp,tmpnam);
X			mktemp(dp->lok);
X			}
X                }
X	fclose(lfp);
X        return i;       /*'i' is the # of lines read successfully*/
X}
/
echo 'x - rls.c'
sed 's/^X//' > rls.c << '/'
X/*
X * companion program to get
X *
X * see get.c for details of operation
X */
X/*
X * modified to support uucp
X * as follows
X *1)
X * if argv[0] == "uurls"
X * and lock file is owned by uucp
X * then release it anyway
X * even if real userid is not uucp
X *2)
X * also because uucp probably won't be logged in
X * if lock file is owned by uucp and argv[0] != "uurls"
X * then unless the lock file is at least 30 min old
X * tell user the uucp is logged in on NOWHERE
X * and refuse to rls device.
X *
X * to avoid inadvertant locking/unlocking
X * the uurls version should NOT be installed (uucico must fork and exec it
X * correctly)
X */
X
X#ifndef LOCKSFILE
X#define LOCKSFILE            "/etc/miscdirs/get/lokfilefile"
X#endif
X#define MAXSTLEN        40      /*much more than necessary*/
X#define NLOCKS          10      /* "    "     "      " */
X#define MAXPDEV         6       /* max # phys. devices associate with a name*/
X#define OWNERONLY       0600    /*protection mode for the devices*/
X
X#define Printf   if(! silent) printf
X#define subdev(LP,n)     (& ( (LP)->physdev[n][0]))         /*all dave's fault*/
X
X#include <utmp.h>
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <pwd.h>
X#include <signal.h>
X
XFILE *fopen();
Xstruct passwd *getpwuid();
X
Xtypedef struct {
X        char link[MAXSTLEN],    /*file to link to*/
X             lok[MAXSTLEN],     /*link (lok, link)*/
X             dev[MAXSTLEN],     /* what the user calls it(get dev) */
X             physdev[MAXPDEV][MAXSTLEN]; /* /dev/dev */
X        }dev_lk;
X
Xdev_lk locks[NLOCKS];
Xstruct stat st_buf;
X
Xint silent = 0;         /*set if the -s options is used*/
Xint yes = 0;		/* set if a -y or a -s flag is used */
Xint uurls=0;		/* set if called from uucp */
Xint uuid,ugid;		/* uucp's uid/gid */
Xint myuid,mygid;	/* my real uid/gid */
Xint Rootuid,Rootgid;	/* ROOT uid/gid */
X
Xmain(argc,argv)
Xint   argc;
Xchar *argv[];
X{
X        register int nlock, i;
X        register dev_lk *lkp;
X        register char **argp ;
X        int nerrs = 0;
X	struct passwd *uups;
X	struct stat *statbuf;
X	statbuf=malloc((sizeof *statbuf));
X	uups=getpwname("uucp");
X	endpwent();
X	if(uups){
X		uuid=uups->pw_uid;
X		ugid=uups->pw_gid;
X	}
X	else uuid=ugid = -1;
X	free(uups);
X	uurls= strcmp("uurls",argv[0])== 0;
X	Rootuid=geteuid();
X	Rootgid=getegid();
X	myuid=getuid();
X	mygid=getgid();
X
X        argp = &argv[1];        /* **argp is 0 if no args */
X
X	if( (**argp) == '-'){
X	    switch( *((*argp)+1)){
X		case 's':
X		case 'S':
X		    silent++;
X		case 'y':
X		case 'Y':
X		    yes++;
X		    break;
X		default:
X		    break;
X		}
X	    argc --;
X	    argp ++;
X	}
X        if((nlock = read_loks(LOCKSFILE, locks)) <= 0){
X	    Printf("%s: %s unreadable or non-existant",argv[0],LOCKSFILE);
X	    exit(-2);
X	}
X        /*now we go to work, and we don't want to be interrupted so...*/
X        for(i = 1;i < NSIG; signal(i++, SIG_IGN));
X                                /*if no arguments (beside possible -s or -y)*/
X        if( argc <= 1){         /*release anything that the user owns*/
X		    i=rlsall(nlock);
X		    Printf("%d device%s released\n", i,i!=1?"s":"" );
X                exit(0);}
X        /*else*/
X        for(argc--;argc--;argp++){
X                for(i=0; i < nlock; i++)
X                        if( ! strcmp (locks[i].dev, *argp) )  break;
X                if(i >= nlock){
X                        Printf("I don't know how to release %s\n",*argp);
X                        nerrs++;
X                        continue;}
X                lkp = &locks[i];
X                if (access(lkp->link,0) < 0){
X                        Printf("%s isn't in use.\n",lkp->dev);
X                        continue;}
X                stat(lkp->link,&st_buf);
X                if ((uurls?uuid:myuid) != (st_buf.st_uid) &&
X                                myuid != Rootuid && !confirm(lkp)){
X                        Printf("%s not released.\n", lkp->dev);
X                        nerrs++;
X                        continue;
X		}
X                restore(lkp);
X                Printf("%s released.\n",lkp->dev);
X                }
X        if(nerrs) exit(-1);
X}
X
Xint             /* returns 1 if owner of device is logged in, else 0*/
Xconfirm(lkp)
Xdev_lk *lkp;
X{
X        struct utmp u_buf;
X        register struct passwd *pw_ptr;
X        register FILE *uf;
X	long tod;
X        int logged_on = 0;
X
X        pw_ptr = getpwuid(st_buf.st_uid);
X        Printf("%s is owned by %s", lkp->dev, pw_ptr->pw_name);
X
X	time(&tod);
X	if(uuid == st_buf.st_uid && tod < st_buf.st_ctime+1000){
X		logged_on++;
X		strcpy(u_buf.ut_line,"NOWHERE");
X	}
X	if(!logged_on){
X		uf = fopen( "/etc/utmp", "r");
X		if(uf == NULL){
X			Printf("can't open /etc/utmp.\n");
X			return 0;
X		}
X
X		while( fread(&u_buf, sizeof(struct utmp), 1, uf)){
X			if( ! strncmp(u_buf.ut_name, pw_ptr->pw_name, 8)){
X				logged_on++;
X				break;
X			}
X		}
X		fclose(uf);
X	}
X        if(logged_on) {
X                Printf(" who is logged-in on %-.8s.\n",u_buf.ut_line);}
X        else{
X                Printf("\n but he's not on now so...\n");
X                if( ! silent )
X                        return prompt(lkp);
X                }
X        return (! logged_on);
X}
X
Xrestore(lkp)       /*restores ownership and protections for resources unlocked*/
Xregister dev_lk *lkp;
X{
X        register int pdev;
X
X        for(pdev = 0;pdev < MAXPDEV && (*subdev(lkp,pdev));pdev++){
X                chown( subdev(lkp,pdev),Rootuid,Rootgid );
X                chmod( subdev(lkp,pdev),OWNERONLY);
X		}
X        unlink(lkp->link);
X	unlink(lkp->lok);
X}
X
Xint
Xread_loks(lf, lks)
Xchar *lf;
Xregister dev_lk lks[];
X{
X        register FILE *lfp;
X        register dev_lk *dp;
X        register int i;
X        int n;
X	char *cp,*tmpfil="/RLSXXXXXX";
X        char line[132];
X
X        lfp = fopen(lf, "r");
X        if(lfp == NULL)
X                return -1;      /*error*/
X
X        /*now read in the entries*/
X        for(dp = lks,i=0; i < NLOCKS ;dp++, i++){
X                if( fgets(line,sizeof(line),lfp) == NULL)            /* if EOF*/
X                        break;
X                                  /*read at most 3 + MAXPDEV entries from line*/
X                n = sscanf(line,"%s%s%s %s%s%s%s%s%s",dp->link,dp->lok,dp->dev,
X                                subdev(dp,0),subdev(dp,1),
X                                subdev(dp,2),subdev(dp,3),
X                                subdev(dp,4),subdev(dp,5));
X
X                if(n < 3){               /*if line was bad format or blank ...*/
X                        dp--;i--;                                  /*try again*/
X                        continue;}
X                if(n < MAXPDEV + 3)
X                        *subdev(dp, n - 3) = '\0';                 /*no string*/
X		cp=rindex(dp->lok,'/');
X		if(cp){
X			if(index(cp,'X')== 0)strcpy(cp,tmpfil);
X			mktemp(dp->lok);
X			}
X                }
X        return i;       /*'i' is the # of lines read successfully*/
X}
X
Xint
Xrlsall(nlock)
Xregister int nlock;
X{
X        register dev_lk *lkp;
X        extern dev_lk locks[];
X        register int rlscnt = 0;
X        for(lkp = locks;nlock --;lkp++){
X                stat(lkp->link,&st_buf);
X		unlink(lkp->lok);
X		close(creat(lkp->lok,000));
X                if(!link(lkp->lok,lkp->link)){/*was free*/
X                        restore(lkp);
X                        continue;}
X                if( myuid==Rootuid || uurls?uuid:myuid==st_buf.st_uid ){
X                        if(silent || prompt(lkp)){
X                                rlscnt ++;
X                                restore(lkp);
X				}
X			}
X		else unlink(lkp->lok);
X                }/*endfor*/
X        return rlscnt;
X}
X
Xprompt(lkp)
Xregister dev_lk *lkp;
X{
X        char inch[MAXSTLEN];
X	if(yes){
X	    Printf("releasing %s\n",lkp->dev);
X	    return(yes);
X	}
X        printf("release %s?(y/n)[n]",lkp->dev);
X        return scanf("%s",inch) > 0 && (*inch =='y' || *inch =='Y');
X}
/
echo 'x - get.1'
sed 's/^X//' > get.1 << '/'
X.TH get 1 local
X.SH NAME
Xget \\- a program to reserve exclusive use of a device
X.SH SYNOPSIS
X.I
Xget
X[\-s] dev
X.SH DESCRIPTION
XGet will reserve exclusive use of a device by creating a lock file, changing
Xownership of the device to your current user id and setting the device to
Xmode 600 (rw by you, nothing to others).
XIn the event that a device is in
Xuse by another user you will be notified of this, and 
X.I
Xnot
Xbe given control.
XThe
X.I
X\-s
Xswitch causes
X.I
Xget
Xto perform its work silently.
XGet returns a nonzero return code to indicate failure.
X.PP
XCurrently known devices are:
X.TP 8
Xtape
XThe magtape; all 6 logical devices 800 BPI: (mt0, rmt0, nrmt0)
Xand 1600 BPI: (mt1, rmt1, nrmt1).
X.TP 8
Xflop0
XDrive 0 of the RX02 Floppy disk.
X.TP 8
Xflop1
XDrive 1 of the RX02 Floppy disk.
X.TP 8
Xcul0
XThe auto-dialing modem (for originating calls).
X.TP 8
Xrsx[0-2]
XLines rsx0, rsx1, and rsx2 to the 11/23 (RSX-11M) system.
X.TP 8
Xrt
XThe line to the 11/34 (RT-11) system.
X.SH FILES
X.TP 30
X/etc/miscdirs/get/lokfilefile
Xfor device names, lock file names, and /dev/minordev names.
X.TP 30
X/etc/utmp
Xfor list of current users.
X.SH SEE ALSO
Xrls(1)
Xlock(7)
X.SH DIAGNOSTICS
X.nf
Xdev is in use. Try again later.
X	(or try 'rls dev').
X
XI don't know how to get dev.
X.fi
X.SH BUGS
XLocking will fail if your userid is not the same as your login userid
X(e.i.
X.I
Xsu name
Xbefore get
Xcan cause problems).
/
echo 'x - rls.1'
sed 's/^X//' > rls.1 << '/'
X.TH rls 1 local
X.SH NAME
Xrls \- a program to release an exclusively reserved device.
X.SH SYNOPSIS
X.I
Xrls
X[\-s] [\-y] [dev ... devn]
X.SH DESCRIPTION
X.I
Xrls
Xis the inverse of
X.I
Xget
X(1) in that it releases a device that you have taken exclusive use of.
XIt may also be used to release a device that another user (who is no
Xlonger logged in) has reserved.
X.PP
XIf no devices are specified all devices reserved by the invoker are released.
XIf the invoker is the
X.I
Xsuperuser
Xand
X.I no
Xdevices are specified, and the \-s switch is set
Xall devices are released no matter who owns them.
XThe \-s switch causes rls to perform its work silently.
XThe \-y switch causes rls to relase without asking permission.
X.PP
XEach device in the list is looked up and if it is 1) reserved and 2) either
Xa) owned by the invoker or b) the owner is 
X.I
Xnot
Xlogged in the invoker will be asked if he wants the device released (or
Xif -s was specified the device is released silently).
X.PP
XSee get(1) for a list of currently known devices.
X.SH FILES
X.TP 30
X/etc/miscdirs/get/lokfilefile
Xfor device names, lock file names, and /dev/minordev names.
X.TP 30
X/etc/utmp
Xfor list of current users.
X.SH SEE ALSO
Xget(1)
Xlock(7)
X.SH DIAGNOSTICS
X.nf
XDEV is owned by USER who is logged-in on ttyNN.
XDEV not released.
X
XI don't know how to release DEV
X.fi
X.SH BUGS
XUsers that have
X.I
Xsu'd
Xto another userid (different than their login id) before getting a
Xdevice are treated as if
Xthey are
X.I
Xnot
Xlogged in.
/
echo 'x - lock.7'
sed 's/^X//' > lock.7 << '/'
X.TH lock 7 local
X.SH NAME
Xlokfilefile   - the discription file for the device locking system.
X.SH DESCRIPTION
Xformat of working file (lokfilefile):
X
Xlock_file linkto_file device minor0 minor1 ... minorN
X
XFull names of files must include paths (in great detail, starting with / )
XLinkto name should be of a form compatable with mktemp(3).
XThere may be as many as 6 minor devices associated with name_of_device.
XNote that name_of_device need not be the same as any minor device.
X.nf
Xexamples:
X/etc/tape.lock /etc/lck0tXXXXXX tape /dev/mt0 /dev/rmt0 /dev/nrmt0
X/usr/spool/uucp/LCK..cul0 /usr/spool/uucp/cul0XXXXXX cul0 /dev/cul0
X.fi
X.SH FILES
X/etc/miscdirs/get/lokfilefile (this file).
X.SH SEE ALSO
Xget(1)
Xrls(1)
Xmktemp(3)
X.SH DIAGNOSTICS
Xnone
X.SH BUGS
XThere is an arbitrary limit of 6 minor devices per lock.
/
echo 'x - lokfilefile'
sed 's/^X//' > lokfilefile << '/'
X/etc/miscdirs/get/rt.lok /etc/miscdirs/get/rtXXXXXX rt /dev/rt
X/etc/miscdirs/get/LCK..rsx1 /etc/miscdirs/get/rsx1XXXXXX rsx1 /dev/rsx1
X/etc/miscdirs/get/LCK..rsx2 /etc/miscdirs/get/rsx2XXXXXX rsx2 /dev/rsx2
X/etc/miscdirs/get/LCK..rsx3 /etc/miscdirs/get/rsx3XXXXXX rsx3 /dev/rsx3
X/usr/spool/uucp/LCK..cul0 /usr/spool/uucp/cul0XXXXXX cul0 /dev/cul0
X/etc/miscdirs/get/tape.lok /etc/miscdirs/get/tapeXXXXXX tape /dev/mt0 /dev/mt1 /dev/rmt0 /dev/rmt1 /dev/nrmt0 /dev/nrmt1
X/etc/miscdirs/get/flop0.lok /etc/miscdirs/get/flop0XXXXXX flop0 /dev/sd0 /dev/dd0 /dev/rsd0 /dev/rdd0
X/etc/miscdirs/get/flop1.lok /etc/miscdirs/get/flop1XXXXXX flop1 /dev/sd1 /dev/dd1 /dev/rsd1 /dev/rdd1
X/etc/miscdirs/get/rl1.lok /etc/miscdirs/get/rl1XXXXXX rl1 /dev/rl1 /dev/rrl1
/
echo 'Part 01 of lock.shar complete.'
exit
-- 
Stephen C. Woods (VA Wadsworth Med Ctr./UCLA Dept. of Neurology)
uucp:	{ {ihnp4, uiucdcs}!bradley, hao, trwrb}!cepu!scw
ARPA: cepu!scw at ucla-cs location: N 34 3' 9.1" W 118 27' 4.3"



More information about the Comp.sources.unix mailing list