-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fd handling issues in start_job... #1559
Comments
CUPS.org User: mike Looks pretty good, although we need to FD_CLR the status FD before calling cupsdClosePipe(), since that function resets the file descriptors to -1... Also, the change introduced a file descriptor leak, which I'm tracking down now... |
CUPS.org User: mike Fixed in Subversion repository. |
"start_job.patch": Index: scheduler/job.c--- scheduler/job.c (revision 5390)
cupsdSetString(&job->dest, dest); @@ -442,15 +444,17 @@
FD_CLR(job->status_buffer->fd, InputSet);
- job->status_buffer->fd);
@@ -1532,6 +1536,12 @@ cupsdClosePipe(job->back_pipes);
if (job->status_buffer) FD_CLR(job->status_buffer->fd, InputSet);
- job->status_buffer->fd);
@@ -1979,6 +1985,8 @@
- "Unable to create status pipes - %s.", strerror(errno));- cupsdAddPrinterHistory(printer);
- "status pipes.");
- statusfds[0], statusfds[1]);-#ifdef FD_CLOEXEC
@@ -3144,7 +3152,7 @@
@@ -3271,6 +3279,13 @@
- !slot, filterfds[!slot][0], filterfds[!slot][1]);- cupsdClosePipe(filterfds[!slot]);
@@ -3292,17 +3300,21 @@
if (remote_job) cupsdLogMessage(CUPSD_LOG_DEBUG2,
- statusfds[1]);- close(statusfds[1]);
@@ -3348,8 +3354,8 @@ cupsdLogMessage(CUPSD_LOG_DEBUG2,
cupsArrayDelete(filters); Index: scheduler/job.h--- scheduler/job.h (revision 5390)
|
Version: 1.2-current
CUPS.org User: jlovell
There seems to be two fd handling issues in start_job:
These bugs manifest themselves by eventually causing select() to return EBADF.
This code is slightly tricky... I believe the attached patch is correct but please check.
Thanks!
The text was updated successfully, but these errors were encountered: