#pragma ident	"$Id: doautomount.c,v 1.3 2005/01/04 22:03:15 mikew Exp $"
/*
 * doautomount [args]
 * NOTE: This program should be suid root to work properly.
 */

#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>

int main(argc, argv)
	int argc;
	char **argv;
{
	char *comm;
	extern char *getenv();
	char *argv0[3] = {"/etc/init.d/autofs", "start", NULL};
/*
	if ((comm = getenv("AUTOMOUNT")) != NULL)
		*argv = comm;
	else {
		*argv = argv0;
*/
	(void)setuid(0);

	(void)execv(argv[0], &argv[0]);

	/* NOTREACHED */
	return 1;
}
