Your C code seems to meet the customer's need: shutting down A/UX without being root.
This additional code can be included in the poweroff.c to prevent a remote user from shutting down the system:
char *ttyname();
char *p;
char *d="/dev/ttyC";
p=ttyname(0);
if (strncmp(p, d, 9) != 0) {
fprintf(stderr, "%s: not a CommandShell type of window\\n", argv[0]);
exit(1);
}
Article Change History:
23 Sep 1994 - Reviewed.
31 Aug 1992 - Reviewed.
Support Information Services