/*
* "lpadmin" command for CUPS.
*
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law. Distribution and use rights are outlined in the file "LICENSE.txt"
- * which should have been included with this file. If this file is
- * missing or damaged, see the license at "http://www.cups.org/".
+ * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
/*
file = argv[i];
}
+
+ if (*opt == 'i')
+ {
+ /*
+ * Check to see that the specified file is, in fact, a PPD...
+ */
+
+ cups_file_t *fp = cupsFileOpen(file, "r");
+ char line[256];
+
+ if (!cupsFileGets(fp, line, sizeof(line)) || strncmp(line, "*PPD-Adobe", 10))
+ {
+ _cupsLangPuts(stderr, _("lpadmin: System V interface scripts are no longer supported for security reasons."));
+ cupsFileClose(fp);
+ return (1);
+ }
+
+ cupsFileClose(fp);
+ }
break;
case 'E' : /* Enable the printer/enable encryption */
for (ptr = name; *ptr; ptr ++)
if (*ptr == '@')
break;
- else if ((*ptr >= 0 && *ptr <= ' ') || *ptr == 127 || *ptr == '/' ||
- *ptr == '#')
+ else if ((*ptr >= 0 && *ptr <= ' ') || *ptr == 127 || *ptr == '/' || *ptr == '\\' || *ptr == '?' || *ptr == '\'' || *ptr == '\"' || *ptr == '#')
return (0);
/*