File mingetty-1.0.7s.dif of Package mingetty
--- revoke.c
+++ revoke.c 2008-07-21 12:39:32.913579091 +0200
@@ -231,7 +231,7 @@ void mkarray (char** arr, char* str)
static int sigfholder(const char *path, int sig)
{
- char buf[MAXNAMLEN], *ptr;
+ char buf[MAXNAMLEN+PATH_MAX], *ptr;
pid_t pid;
DIR *proc, *fds;
struct dirent *task, *fd;
@@ -260,15 +260,15 @@ static int sigfholder(const char *path,
warn("cannot open(%s): %s\n", buf, strerror(errno));
continue;
}
- while ((fgets(buf, MAXNAMLEN, fp))) {
- ptr = strrchr(buf, ' ');
- if (*(++ptr) == '/' && strncmp(path, ptr, strlen(ptr)-1) == 0) {
+ while ((fgets(buf, sizeof(buf)-1, fp))) {
+ if ((ptr = strchr(buf, '/')) == (char*)0)
+ continue;
+ if (strncmp(path, ptr, strlen(ptr)-1) == 0) {
kill(pid, sig);
cnt++;
- goto out_maps;
+ break;
}
}
- out_maps:
fclose(fp);
(void) strcpy(buf,"/proc/");
@@ -290,10 +290,9 @@ static int sigfholder(const char *path,
if (st.st_dev == lnk.st_dev && st.st_ino == lnk.st_ino) {
kill(pid, sig);
cnt++;
- goto out_fds;
+ break;
}
}
- out_fds:
closedir(fds);
}
closedir(proc);