} else if (cred_add_krb4(getuid(), &krbdata.c) == NULL) {
} else if (cred_add_krb4(getuid(), getuid(), &krbdata.c) == NULL) {
main (int argc, char **argv){    PROCESS kernelpid;    int error;    int optind = 0;    char *default_log_file;    char fpriofile[MAXPATHLEN];    set_progname (argv[0]);    if (getarg (args, argc, argv, &optind, ARG_GNUSTYLE))	usage (1);    argc -= optind;    argv += optind;    if (help_flag)	usage (0);    if (version_flag)	errx (1, "%s", arla_version);        if (argc > 0) {	device_file = *argv;	argc--;	argv++;    }    if (argc != 0)	usage (1);    if (temp_sysname == NULL)	temp_sysname = arla_getsysname ();    if (temp_sysname != NULL) {        strncpy(arlasysname, temp_sysname, SYSNAMEMAXLEN - 1);	arlasysname[SYSNAMEMAXLEN - 1] = '\0';    }#ifdef KERBEROS    rxkad_min_level = parse_rxkad_level (rxkad_level_string);    if (rxkad_min_level < 0)	errx (1, "bad rxkad level `%s'", rxkad_level_string);#endif    signal (SIGINT, sigint);    signal (SIGTERM, sigint);    signal (SIGHUP, sighup);    umask (S_IRWXG|S_IRWXO); /* 077 */    if (!test_flag && !no_fork) {	default_log_file = "syslog";    } else {	default_log_file = "/dev/stderr";    }    if (log_file == NULL)	log_file = default_log_file;    arla_loginit(log_file);         if (debug_levels != NULL) {	if (arla_log_set_level (debug_levels) < 0) {	    warnx ("bad debug levels: `%s'", debug_levels);	    arla_log_print_levels (stderr);	    exit (1);	}    }    if (connected_mode_string != NULL) {	int tmp = set_connected_mode (connected_mode_string);	if (tmp < 0)	    errx (1, "bad connected mode: `%s'", connected_mode_string);	connected_mode = tmp;    }    read_conffile(conf_file, conf_params);    if (!test_flag && !no_fork)	daemonify ();    if (cache_dir == NULL)	cache_dir = ARLACACHEDIR;    mkdir (cache_dir, 0777);    if (chdir (cache_dir) < 0)	arla_err (1, ADEBERROR, errno, "chdir %s", cache_dir);    snprintf(fpriofile, sizeof(fpriofile), "%s/%s", cache_dir, "fprio");    /*     * Init     */     arla_warnx (ADEBINIT,"Arlad booting sequence:");    arla_warnx (ADEBINIT, "connected mode: %s",		connected_levels[connected_mode]);    arla_warnx (ADEBINIT, "initports");    initports ();    arla_warnx (ADEBINIT, "conn_init numconns = %u", numconns);    conn_init (numconns);    arla_warnx (ADEBINIT, "cellcache");    cell_init (0);    arla_warnx (ADEBINIT, "fprio");    fprio_init(fpriofile);    arla_warnx (ADEBINIT, "volcache numvols = %u", numvols);    volcache_init (numvols, recover);    if (root_volume != NULL)	volcache_set_rootvolume (root_volume);    arla_warnx (ADEBINIT, "rx");    initrx (client_port);#ifdef KERBEROS    arla_warnx (ADEBINIT, "using rxkad level %s",		rxkad_level_units[rxkad_min_level]);#endif    /*     * Credential cache     */    arla_warnx (ADEBINIT, "credcache numcreds = %u", numcreds);    cred_init (numcreds);    arla_warnx (ADEBINIT,		"fcache low_vnodes = %u, high_vnodes = %u"		"low_bytes = %u, high_bytes = %u",		low_vnodes, high_vnodes,		low_bytes, high_bytes);    fcache_init (low_vnodes, high_vnodes,		 low_bytes, high_bytes, recover);    arla_warnx (ADEBINIT, "cmcb");    cmcb_init ();    arla_warnx(ADEBINIT, "cm");    cm_init ();    arla_warnx(ADEBINIT, "arla init done.");    if (test_flag) {#ifdef KERBEROS	{	    krbstruct krbdata;	    int ret;	    const char *this_cell = cell_getthiscell ();	    const char *db_server = cell_findnamedbbyname (this_cell);	    char *realm = krb_realmofhost (db_server);	    	    ret = get_cred("afs", this_cell, realm, &krbdata.c);	    if (ret)		ret = get_cred("afs", "", realm, &krbdata.c);	    if (ret) {		arla_warnx (ADEBWARN,			    "getting ticket for %s: %s",			    this_cell,			    krb_get_err_text (ret));	    } else if (cred_add_krb4(getuid(), &krbdata.c) == NULL) {		arla_warnx (ADEBWARN, "Could not insert tokens to arla");	    }	}#endif	tmpce = cred_get (0, getuid(), CRED_ANY);	 	arla_warnx (ADEBINIT, "Getting root...");	error = getroot (&rootcwd, tmpce);	if (error)	    arla_err (1, ADEBERROR, error, "getroot");	cwd = rootcwd;	arla_warnx(ADEBINIT, "arla loop started");	sl_loop(cmds, "arla> ");	store_state ();    } else {	xfs_message_init ();	if (LWP_CreateProcess (kernel_interface, KERNEL_STACKSIZE, 1,			       device_file, "Kernel-interface", &kernelpid))	    arla_errx (1, ADEBERROR,		       "Cannot create kernel-interface process");	LWP_WaitProcess ((char *)main);	abort ();    }    return 0;}