Skip to content

Commit dbcebbe

Browse files
committed
libcupsfilters: Let filterExternalCUPS() return 1 if filter gets a signal
If the CUPS filter or backend called by the filterExternalCUPS() filter function stops on a signal (like for example signal 11, segmentation fault) filterExternalCUPS() returns 1 now and not a value > 256. Otherwise filterChain() will not see the failure (exit() only passes on the last byte of its argument as exit code) and returns 0 for success, making a job with a crashed filter appear as succeeded.
1 parent 3d0b543 commit dbcebbe

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cupsfilters/filter.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,6 @@ filterExternalCUPS(int inputfd, /* I - File descriptor input stream */
12361236
(params->is_backend ? "Backend" : "Filter") :
12371237
"Logging"),
12381238
wpid, WEXITSTATUS(wstatus));
1239-
status = WEXITSTATUS(wstatus);
12401239
} else {
12411240
/* Via signal */
12421241
if (log) log(ld, FILTER_LOGLEVEL_ERROR,
@@ -1246,8 +1245,8 @@ filterExternalCUPS(int inputfd, /* I - File descriptor input stream */
12461245
(params->is_backend ? "Backend" : "Filter") :
12471246
"Logging"),
12481247
wpid, WTERMSIG(wstatus));
1249-
status = 256 * WTERMSIG(wstatus);
12501248
}
1249+
status = 1;
12511250
} else {
12521251
if (log) log(ld, FILTER_LOGLEVEL_INFO,
12531252
"filterExternalCUPS (%s): %s (PID %d) exited with no errors.",

0 commit comments

Comments
 (0)