Skip to content

Commit 419ef01

Browse files
committed
Don't error out when scanning for PPDs (Issue #1416)
1 parent 50224f4 commit 419ef01

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ CHANGES - OpenPrinting CUPS
22
===========================
33

44

5+
Changes in CUPS v2.4.15 (YYYY-MM-DD)
6+
------------------------------------
7+
8+
- Fixed error recovery when scanning for PPDs in `cups-driverd` (Issue #1416)
9+
10+
511
Changes in CUPS v2.4.14 (2025-09-11)
612
------------------------------------
713

scheduler/cups-driverd.cxx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* created from driver information files, and dynamically generated PPD files
66
* using driver helper programs.
77
*
8-
* Copyright © 2020-2024 by OpenPrinting.
8+
* Copyright © 2020-2025 by OpenPrinting.
99
* Copyright © 2007-2019 by Apple Inc.
1010
* Copyright © 1997-2007 by Easy Software Products.
1111
*
@@ -175,7 +175,7 @@ static int load_drv(const char *filename, const char *name,
175175
static void load_ppd(const char *filename, const char *name,
176176
const char *scheme, struct stat *fileinfo,
177177
ppd_info_t *ppd, cups_file_t *fp, off_t end);
178-
static int load_ppds(const char *d, const char *p, int descend);
178+
static void load_ppds(const char *d, const char *p, int descend);
179179
static void load_ppds_dat(char *filename, size_t filesize,
180180
int verbose);
181181
static int load_tar(const char *filename, const char *name,
@@ -2359,7 +2359,7 @@ load_ppd(const char *filename, /* I - Real filename */
23592359
* 'load_ppds()' - Load PPD files recursively.
23602360
*/
23612361

2362-
static int /* O - 1 on success, 0 on failure */
2362+
static void
23632363
load_ppds(const char *d, /* I - Actual directory */
23642364
const char *p, /* I - Virtual path in name */
23652365
int descend) /* I - Descend into directories? */
@@ -2387,13 +2387,13 @@ load_ppds(const char *d, /* I - Actual directory */
23872387
fprintf(stderr, "ERROR: [cups-driverd] Unable to stat \"%s\": %s\n", d,
23882388
strerror(errno));
23892389

2390-
return (0);
2390+
return;
23912391
}
23922392
else if (cupsArrayFind(Inodes, &dinfo))
23932393
{
23942394
fprintf(stderr, "ERROR: [cups-driverd] Skipping \"%s\": loop detected!\n",
23952395
d);
2396-
return (1);
2396+
return;
23972397
}
23982398

23992399
/*
@@ -2415,7 +2415,7 @@ load_ppds(const char *d, /* I - Actual directory */
24152415

24162416
if (_cupsFileCheck(d, _CUPS_FILE_CHECK_DIRECTORY, !geteuid(),
24172417
_cupsFileCheckFilter, NULL))
2418-
return (0);
2418+
return;
24192419

24202420
if ((dir = cupsDirOpen(d)) == NULL)
24212421
{
@@ -2424,7 +2424,7 @@ load_ppds(const char *d, /* I - Actual directory */
24242424
"ERROR: [cups-driverd] Unable to open PPD directory \"%s\": %s\n",
24252425
d, strerror(errno));
24262426

2427-
return (0);
2427+
return;
24282428
}
24292429

24302430
fprintf(stderr, "DEBUG: [cups-driverd] Loading \"%s\"...\n", d);
@@ -2457,11 +2457,7 @@ load_ppds(const char *d, /* I - Actual directory */
24572457

24582458
if (descend)
24592459
{
2460-
if (!load_ppds(filename, name, 1))
2461-
{
2462-
cupsDirClose(dir);
2463-
return (1);
2464-
}
2460+
load_ppds(filename, name, 1);
24652461
}
24662462
else if ((ptr = filename + strlen(filename) - 14) > filename &&
24672463
!strcmp(ptr, ".printerDriver"))
@@ -2572,8 +2568,6 @@ load_ppds(const char *d, /* I - Actual directory */
25722568
}
25732569

25742570
cupsDirClose(dir);
2575-
2576-
return (1);
25772571
}
25782572

25792573

0 commit comments

Comments
 (0)