temp = (char *) alloca(strlen(ifaceConfig) + 7);
if (len > PATH_MAX) exit(1);  temp = (char *) alloca(len + 7);
main(int argc, char ** argv) {    char * ifaceConfig;    char * chptr;    char * cmd = NULL;    int report = 0;    char tmp;    if (argc != 3) usage();    if (!strcmp(argv[2], "up")) {	cmd = "./ifup";    } else if (!strcmp(argv[2], "down")) {	cmd = "./ifdown";    } else if (!strcmp(argv[2], "report")) {	report = 1;    } else {	usage();    }    if (chdir("/etc/sysconfig/network-scripts")) {	fprintf(stderr, "error switching to /etc/sysconfig/network-scripts: "		"%s\n", strerror(errno));	exit(1);    }    /* force the interface configuration to be in the current directory */    chptr = ifaceConfig = argv[1];    while (*chptr) {	if (*chptr == '/')	    ifaceConfig = chptr + 1;	chptr++;    }    /* automatically prepend "ifcfg-" if it is not specified */    if (strncmp(ifaceConfig, "ifcfg-", 6)) {	char *temp;	temp = (char *) alloca(strlen(ifaceConfig) + 7);	strcpy(temp, "ifcfg-");	/* strcat is safe because we got the length from strlen */	strcat(temp, ifaceConfig);	ifaceConfig = temp;    }        if(getuid() != 0)    switch (userCtl(ifaceConfig)) {	char *dash;	case NOT_FOUND:	    /* a `-' will be found at least in "ifcfg-" */	    dash = strrchr(ifaceConfig, '-');	    if (*(dash-1) != 'g') {		/* This was a clone configuration; ask the parent config */		tmp = *dash;		*dash = '\0';		if (userCtl(ifaceConfig) == FOUND_TRUE) {		    /* exit the switch; users are allowed to control */		    *dash = tmp;		    break;		}		*dash = tmp;	    }	    /* else fall through */	case FOUND_FALSE:	    if (! report)	        fprintf(stderr,			"Users are not allowed to control this interface.\n");	    exit(1);	    break;    }    /* looks good to me -- let's go for it if we are changing the interface,     * report good status to the user otherwise */    if (report)	exit(0);    /* pppd wants the real uid to be the same as the effective (god only       knows why when it works fine setuid out of the box) */    setuid(geteuid());    execle(cmd, cmd, ifaceConfig, NULL, safeEnviron);    fprintf(stderr, "exec of %s failed: %s\n", cmd, strerror(errno));        exit(1);}