--- src/jk_lsh.c.orig 2005-04-11 09:14:09.000000000 +0000 +++ src/jk_lsh.c 2006-03-17 07:36:33.490471409 +0000 @@ -126,6 +126,7 @@ DEBUG_MSG(PROGRAMNAME" log started\n"); /* start the config parser */ parser = new_iniparser(CONFIGFILE); + if (!parser) { syslog(LOG_ERR, "configfile "CONFIGFILE" is not available"); DEBUG_MSG(PROGRAMNAME" configfile missing\n"); @@ -133,11 +134,29 @@ } /* check if this user has a section */ { - struct group *gr = getgrgid(getgid()); char *groupsec; - pw = getpwuid(getuid()); - if (!pw || !gr) { - syslog(LOG_ERR, "uid %d or gid %d does not have a name", getuid(), getgid()); + FILE *in; + in = fopen("/etc/passwd", "r"); + while ((pw = fgetpwent(in)) != NULL) { + if (pw->pw_uid == getuid()) break; + } + fclose(in); + + if (!pw) { + syslog(LOG_ERR, "uid %d does not have a name %d", getuid(), errno); + DEBUG_MSG(PROGRAMNAME" cannot get user or group info for %d:%d\n", getuid(),getgid()); + exit(2); + } + + struct group *gr; + in = fopen("/etc/group", "r"); + while ((gr = fgetgrent(in)) != NULL) { + if (gr->gr_gid == getgid()) break; + } + fclose(in); + + if (!gr) { + syslog(LOG_ERR, "gid %d does not have a name %d", getgid(), errno); DEBUG_MSG(PROGRAMNAME" cannot get user or group info for %d:%d\n", getuid(),getgid()); exit(2); }