[comp.sys.apollo] setuid with edsd C problem

mmuegel@camdev.comm.mot.com (Mike "Happy" Muegel) (10/26/90)

I have run into a problem on a C program I am writing and I am sure it has to
do with Domain/OS protected subsystems. Anyway, the program is supposed to
use /com/edsd to let a user modify his/her subscriber directory information
since we have the ACLs set so that only root can run edsd.

I initially tried just setting the setuid bit on the executable and changing
its owner to root. The program did indeed run as root; however, when it tried
to use edsd via execl, it apparently did not have the rights to do so.

Here is the whimpy function that calls edsd:

/* 
 * Changes the current mail forwarding scheme for login to address. This
 * function will NEVER return.
 */
void Change_Address (callee, login, address)
   char *callee;
   char *login;
   char *address;

{
   
   setuid (0);
   printf ("real = %d eff = %d\n", getuid (), geteuid ());
                     
   aclm_$up ();
   
   execl ("/com/edsd", "edsd", "-c", login, address, (char *) 0);
   aclm_$down ();
   fprintf (stderr, "%s: could not execute edsd\n", callee);
   exit (1);

} /* of Change_Address */

Here is the output I get:

83 bsd4.3 ~/src/tools % lsacl a.out
	root.%.%            	prwx-	setuid
	%.staff.%           	-r-x-
	%.%.none            	[Ignore]
	%.%.%               	-r-x-
	%.sys_admin.apollo  	-rwxk

84 bsd4.3 ~/src/tools % ./a.out mmuegel@unix
real = 0 eff = 0
Error modifying registry, User not authorized to perform operation (network computing system/Registry Server)


This error makes me think that protected subsystems come into play. However,
I can not find a subsystem for the registry. I looked in /sys/subsys on
our master rgy node and there is no subsystem manager for the registry.
aclm_$up stuff does not make any sense for the case of edsd since it is
not a data file!?!

Am I totally clueless (no flames, please) on this problem or does anyone
have any suggestions. This is my first real attempt at Domain/OS BSD C
and I could use all the help I can get.

Thanks,
-Mike
-- 
+-----------------------------------------------------------------------------+
| Mike Muegel                           | Internet: mmuegel@mot.com           |
| Software Tools Engineer               | UUCP:     uunet!motcid!muegel       |
| Fort Worth Research and Design Center | Voice:    (817) 232-6623            |
| Cellular Infrastructure Group         | Fax:      (817) 232-6030            |
| Radio Telephone and Systems Group     | Mail:     5555 North Beach St.      |
| Motorola, Inc.                        |           Fort Worth, TX  76137     |
+-----------------------------------------------------------------------------+