diff options
author | Michael R Sweet <michaelrsweet@gmail.com> | 2017-11-01 12:15:35 -0400 |
---|---|---|
committer | Michael R Sweet <michaelrsweet@gmail.com> | 2017-11-01 12:15:35 -0400 |
commit | d0df9cd33768b02cf5327c9d625568d21ced0297 (patch) | |
tree | aac4996063ea10fd8b5476ea8d6d38196be54c5b /systemv | |
parent | b00c84094b1750612e7172251ab95a69627e044b (diff) | |
download | cups-d0df9cd33768b02cf5327c9d625568d21ced0297.tar.gz |
Update lpadmin documentation and show a meaningful error message for interface scripts (Issue #5111)
Diffstat (limited to 'systemv')
-rw-r--r-- | systemv/lpadmin.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/systemv/lpadmin.c b/systemv/lpadmin.c index c608c2d30..b36ea48c4 100644 --- a/systemv/lpadmin.c +++ b/systemv/lpadmin.c @@ -1,7 +1,7 @@ /* * "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 @@ -218,6 +218,25 @@ main(int argc, /* I - Number of command-line arguments */ 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 */ |