Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!usc!samsung!umich!terminator!pisa.ifs.umich.edu!rees From: rees@pisa.ifs.umich.edu (Jim Rees) Newsgroups: comp.sys.apollo Subject: Re: Adopt and UID's Message-ID: <1990Aug28.110115@pisa.ifs.umich.edu> Date: 28 Aug 90 15:15:19 GMT References: <9008272051.AA01513@vlsi-mentor.jpl.nasa.gov> Sender: usenet@terminator.cc.umich.edu (usenet news) Reply-To: rees@citi.umich.edu (Jim Rees) Organization: University of Michigan IFS Project Lines: 106 In article <9008272051.AA01513@vlsi-mentor.jpl.nasa.gov>, root@VLSI-MENTOR.JPL.NASA.GOV (The vlsi-mentor SysAdmin) writes: Does ANYONE on this list know how to use edrgy's ADOPT command to restore the person name <=> UID relationships that the registry normally knows about? What I need is a way to print the acl UID's of a file and plug that number into the ADOPT command so that person X's acls will be ok. Adopt works as advertised. The trick is to get the uid of the person who owns the file. I don't know of any released program that will give this to you. Here's a program that will. Unfortunately I can't give out the include files it uses, since they are Apollo licensed, but anyone who is sufficiently determined ought to be able to determine the layout of the file_$attributes_t struct. As always, use unreleased calls at your own risk. This program could break at any future release of Domain/OS, and you would have no one to blame but yourself. Note the use of ErrMsg(). This is a useful little routine all by itself. # The rest of this file is a shell script which will extract: # luids.c errmsg.c echo x - luids.c cat >luids.c <<'Godfather_Of_Soul' #include "/us/ins/ubase.ins.c" #include "/us/ins/name.ins.c" #include "/us/ins/file.ins.c" #include extern char *ErrMsg(); main(ac, av) int ac; char *av[]; { int i; for (i = 1; i < ac; i++) luids(av[i]); exit(0); } luids(name) char *name; { uid_$t uid; file_$attributes_t vh; obj_info_$t oi; status_$t st; name_$resolve(*name, (short) strlen(name), uid, st); if (st.all != status_$ok) { fprintf(stderr, "%s: can't resolve: %s\n", name, ErrMsg(st)); return; } printf("%s:\n", name); printf("Object: %08x.%08x\n", uid.high, uid.low); file_$get_attr_info(uid, file_$get_activ_mask, (short) sizeof vh, oi, vh, st); if (st.all != status_$ok) { fprintf(stderr, "%s: can't get attributes: %s\n", name, ErrMsg(st)); return; } printf("Type: %08x.%08x\n", vh.type_uid.high, vh.type_uid.low); printf("Parent: %08x.%08x\n", vh.dir_uid.high, vh.dir_uid.low); printf("User: %08x.%08x\n", vh.owner.high, vh.owner.low); printf("Group: %08x.%08x\n", vh.group.high, vh.group.low); printf("Org: %08x.%08x\n", vh.org.high, vh.org.low); } Godfather_Of_Soul echo x - errmsg.c cat >errmsg.c <<'Godfather_Of_Soul' #include #include "/sys/ins/base.ins.c" char * ErrMsg(st) status_$t st; { static char msg[120]; short n; extern std_$call error_$get_string(); error_$get_string(st, msg, (short) (sizeof msg - 1), n); msg[n] = '\0'; return msg; } ErrPrint(s, st) char *s; status_$t st; { fprintf(stderr, "%s: %s\n", s, ErrMsg(st)); } Godfather_Of_Soul