Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!cs.utexas.edu!romp!auschs!awdprime!greenber.austin.ibm.com!jfh From: jfh@greenber.austin.ibm.com (John F Haugh II) Newsgroups: comp.unix.aix Subject: Re: sysck files for LPP's Message-ID: <5416@awdprime.UUCP> Date: 18 Feb 91 22:41:18 GMT References: <1991Feb15.141628.24143@odi.com> Sender: news@awdprime.UUCP Organization: Obfuscated Features "R" Us, LCC Austin Lines: 99 In article <1991Feb15.141628.24143@odi.com> benson@odi.com (Benson I. Margulies) writes: >A properly formatted lpp should include an inventory file which is a >complete set of sysck stanzas for all the files it installs. > >IBM dosen't seem to supply any automated means of generating this, >except for the awful crock I'm about to describe. The "inventory" file that IBM uses when v3 is built is manually mantained in stanza file format. There is/was no need to have a tool to convert XYZ format to "inventory" format. However, creating stanza files is pretty trivial - all you need is a command that spews out the appropriate chunks of the inode info for the files you are interested in. For example - -- #include #include #include #include #include #include main () { char buf[BUFSIZ]; struct stat sb; struct passwd *pwd; struct group *grp; while (gets (buf)) { if (stat (buf, &sb)) { perror (buf); continue; } printf ("%s:\n", buf); if (pwd = getpwuid (sb.st_uid)) printf ("\towner = %s\n", pwd->pw_name); else printf ("\towner = %d\n", sb.st_uid); if (grp = getgrgid (sb.st_gid)) printf ("\tgroup = %s\n", grp->gr_name); else printf ("\tgroup = %d\n", sb.st_gid); printf ("\tmode = "); if (sb.st_mode & 04000) printf ("SUID,"); if (sb.st_mode & 02000) printf ("SGID,"); if (sb.st_mode & 01000) printf ("SVTX,"); printf ("%0.3o\n", sb.st_mode & 0777); if (S_ISREG (sb.st_mode)) { printf ("\ttype = FILE\n"); printf ("\tsize = %d\n", sb.st_size); } else if (S_ISDIR (sb.st_mode)) { printf ("\ttype = DIRECTORY\n"); } else if (S_ISMPX (sb.st_mode)) { printf ("\ttype = MPX_DEV\n"); } else if (S_ISCHR (sb.st_mode)) { printf ("\ttype = CHAR_DEV\n"); } else if (S_ISBLK (sb.st_mode)) { printf ("\ttype = BLK_DEV\n"); } else if (S_ISFIFO (sb.st_mode)) { printf ("\ttype = FIFO\n"); } putchar ('\n'); } } -- >sysck -a seems to be the right thing, but there is no documented >control argument that writes the new stanza's into a file other than >/etc/security/sysck.cfg. That's correct. >Surely IBM has some tool with which it generates the gobs of sysck >stanzas on each and every installation tape. There is - but it input's stanzas in sysck format, and outputs stanzas in sysck format. >Surely there's a better way, or there should be. Try hacking on the above program. It should be suitable for your purposes, provided you aren't getting too exotic. You may want to add a line for the file class, if you wish to use more than just the default class the files will be installed with. ObDisclaimer - I speak for myself only. -- John F. Haugh II | I've Been Moved | MaBellNet: (512) 838-4340 SneakerNet: 809/1D064 | AGAIN ! | VNET: LCCB386 at AUSVMQ BangNet: ..!cs.utexas.edu!ibmchs!auschs!snowball.austin.ibm.com!jfh (e-i-e-i-o)