You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Enable file: device support for /dev/ttySOMETHING...
3678
+
*/
3679
+
3680
+
value="^/dev/tty[A-Za-z0-9._]+$";
3681
+
}
3682
+
elseif (*value!='^')
3683
+
{
3684
+
cupsdLogMessage(CUPSD_LOG_ERROR, "Unsupported FileDevice \"%s\" on line %d of %s.", value, linenum, CupsFilesFile);
3685
+
if (FatalErrors&CUPSD_FATAL_CONFIG)
3686
+
return (0);
3687
+
}
3688
+
3689
+
/*
3690
+
* Try compiling the regular expression in "value"...
3691
+
*/
3692
+
3693
+
if ((FileDevice=calloc(1, sizeof(regex_t))) ==NULL)
3694
+
{
3695
+
cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to create FileDevice regular expression \"%s\" on line %d of %s.", value, linenum, CupsFilesFile);
3696
+
if (FatalErrors&CUPSD_FATAL_CONFIG)
3697
+
return (0);
3698
+
}
3699
+
3700
+
if ((r=regcomp(FileDevice, value, REG_EXTENDED | REG_NOSUB)) !=0)
3701
+
{
3702
+
regerror(r, FileDevice, rerror, sizeof(rerror));
3703
+
free(FileDevice);
3704
+
FileDevice=NULL;
3705
+
3706
+
cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to compile FileDevice regular expression \"%s\" on line %d of %s: %s", value, linenum, CupsFilesFile, rerror);
send_ipp_status(con, IPP_STATUS_ERROR_NOT_POSSIBLE, _("File device URI \"%s\" is not allowed."), ippGetString(attr, 0, NULL));
2303
+
if (!modify)
2304
+
cupsdDeletePrinter(printer, 0);
2307
2305
2308
-
return;
2306
+
return;
2307
+
}
2308
+
elseif (!FileDevice)
2309
+
{
2310
+
/*
2311
+
* File devices are disabled and the URL is not file:///dev/null...
2312
+
*/
2313
+
2314
+
send_ipp_status(con, IPP_STATUS_ERROR_NOT_POSSIBLE, _("File device URIs have been disabled. To enable, see the FileDevice directive in \"%s/cups-files.conf\"."), ServerRoot);
2315
+
if (!modify)
2316
+
cupsdDeletePrinter(printer, 0);
2317
+
2318
+
return;
2319
+
}
2309
2320
}
2310
2321
}
2311
2322
else
@@ -5483,7 +5494,7 @@ create_local_printer(
5483
5494
* Require local access to create a local printer...
5484
5495
*/
5485
5496
5486
-
if (!httpAddrLocalhost(httpGetAddress(con->http)))
5497
+
if (httpAddrGetFamily(httpGetAddress(con->http))!=AF_LOCAL)
5487
5498
{
5488
5499
send_ipp_status(con, IPP_STATUS_ERROR_FORBIDDEN, _("Only local users can create a local printer."));
5489
5500
return;
@@ -5543,9 +5554,9 @@ create_local_printer(
5543
5554
5544
5555
ptr=ippGetString(device_uri, 0, NULL);
5545
5556
5546
-
if (!ptr|| !ptr[0])
5557
+
if (!ptr|| !ptr[0]|| (strncmp(ptr, "ipp://", 6) &&strncmp(ptr, "ipps://", 7)))
5547
5558
{
5548
-
send_ipp_status(con, IPP_STATUS_ERROR_BAD_REQUEST, _("Attribute \"%s\" has empty value."), "device-uri");
0 commit comments