Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.ARPA Path: utzoo!watmath!clyde!cbosgd!ulysses!ucbvax!cit-hamlet.arpa!ken From: ken@CIT-HAMLET.ARPA Newsgroups: fa.info-vax Subject: ACLs: Message-ID: <850907085111.013@Hamlet> Date: Sat, 7-Sep-85 11:52:00 EDT Article-I.D.: Hamlet.850907085111.013 Posted: Sat Sep 7 11:52:00 1985 Date-Received: Mon, 9-Sep-85 02:19:12 EDT Sender: daemon@ucbvax.ARPA Reply-To: info-vax@ucb-vax.berkeley.edu Organization: The ARPA Internet Lines: 68 Kevin and friends: I did not attend DECUS, but think the following code does what you want. This is used in our boot to grant identifiers to the "system" rather than to a "user". -----grantid.com----- $! $! Grant an identifier corresponding to this machine's name $! $ Set NoOn $ $ Node = F$GetSYI("NODENAME") $ Id := $CIT_System:Id $ If Node .Eqs. "HAMLET" Then Id -1 HAMLET Grant $ If Node .Eqs. "ROMEO" Then Id -1 CIT Grant $ If Node .Eqs. "ROMEO" Then Id -1 ROMEO Grant $ If Node .Eqs. "JULIET" Then Id -1 CIT Grant $ If Node .Eqs. "JULIET" Then Id -1 JULIET Grant $ If Node .Eqs. "TIMEVX" Then Id -1 CSS Grant $ If Node .Eqs. "WORDVX" Then Id -1 CSS Grant $ $ Exit $Status .Or. %X10000000 -----id.c----- #include ctype #include descrip #include stdio main(argc,argv) int argc; char *argv[]; { char c; int i; long pid, status, sys$grantid(), sys$revokid(); struct dsc$descriptor_s id_dsc; if (argc != 4) { fprintf(stderr,"Usage: %s pid identifier [r/g]\n",argv[0]); exit(0x10000000); } if (!strcmp("-1",argv[1])) { pid = -1; } else { if(!sscanf(argv[1],"%x",&pid)) { fprintf(stderr,"%s: error parsing pid\n",argv[0]); exit(0x10000000); } } id_dsc.dsc$w_length = strlen(id_dsc.dsc$a_pointer = argv[2]); id_dsc.dsc$b_dtype = DSC$K_DTYPE_T; id_dsc.dsc$b_class = DSC$K_CLASS_S; if ((c = _tolower(*argv[3])) == 'g') { status = sys$grantid(&pid,NULL,NULL,&id_dsc,NULL); } else if (c == 'r') { status = sys$revokid(&pid,NULL,NULL,&id_dsc,NULL); } else { fprintf(stderr,"%s: request must be grant or revoke",argv[0]); exit(0x10000000); } return(status); } ---------- -Ken