/usr/lib/cups/driver/m2300w is in printer-driver-m2300w 0.51-12.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | #!/usr/bin/env python3
# compressor.py
from subprocess import Popen, PIPE
def compress(value):
"""Compresses a byte array with the xz binary"""
process = Popen(["xz", "--compress", "--force"], stdin=PIPE, stdout=PIPE)
return process.communicate(value)[0]
def decompress(value):
"""Decompresses a byte array with the xz binary"""
process = Popen(["xz", "--decompress", "--stdout", "--force"],
stdin=PIPE, stdout=PIPE)
return process.communicate(value)[0]
def compress_file(path):
"""Compress the file at 'path' with the xz binary"""
process = Popen(["xz", "--compress", "--force", "--stdout", path], stdout=PIPE)
return process.communicate()[0]
# compressor.py
import os
import sys
from optparse import OptionParser
from sys import argv
import base64
try:
import cPickle as pickle
except ImportError:
import pickle
from io import BytesIO
from os.path import basename
from errno import EPIPE
def load():
ppds_compressed = base64.b64decode(ppds_compressed_b64)
ppds_decompressed = decompress(ppds_compressed)
ppds = pickle.loads(ppds_decompressed)
return ppds
def ls():
binary_name = basename(argv[0])
ppds = load()
for key, value in ppds.items():
if key == 'ARCHIVE': continue
for ppd in value[2]:
try:
print(ppd.replace('"', '"' + binary_name + ':', 1))
except IOError as e:
# Errors like broken pipes (program which takes the standard
# output terminates before this program terminates) should not
# generate a traceback.
if e.errno == EPIPE: exit(0)
raise
def cat(ppd):
# Ignore driver's name, take only PPD's
ppd = ppd.split(":")[-1]
# Remove also the index
ppd = "0/" + ppd[ppd.find("/")+1:]
ppds = load()
ppds['ARCHIVE'] = BytesIO(decompress(ppds['ARCHIVE']))
if ppd in ppds:
start = ppds[ppd][0]
length = ppds[ppd][1]
ppds['ARCHIVE'].seek(start)
return ppds['ARCHIVE'].read(length)
def main():
usage = "usage: %prog list\n" \
" %prog cat URI"
version = "%prog 1.0.2\n" \
"Copyright (c) 2013 Vitor Baptista.\n" \
"This is free software; see the source for copying conditions.\n" \
"There is NO warranty; not even for MERCHANTABILITY or\n" \
"FITNESS FOR A PARTICULAR PURPOSE."
parser = OptionParser(usage=usage,
version=version)
(options, args) = parser.parse_args()
if len(args) == 0 or len(args) > 2:
parser.error("incorrect number of arguments")
if args[0].lower() == 'list':
ls()
elif args[0].lower() == 'cat':
if not len(args) == 2:
parser.error("incorrect number of arguments")
ppd = cat(args[1])
if not ppd:
parser.error("Printer '%s' does not have default driver!" % args[1])
try:
# avoid any assumption of encoding or system locale; just print the
# bytes of the PPD as they are
if sys.version_info.major < 3:
sys.stdout.write(ppd)
else:
sys.stdout.buffer.write(ppd)
except IOError as e:
# Errors like broken pipes (program which takes the standard output
# terminates before this program terminates) should not generate a
# traceback.
if e.errno == EPIPE: exit(0)
raise
else:
parser.error("argument " + args[0] + " invalid")
# PPDs Archive
ppds_compressed_b64 = b"/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4BCdDeVdAEAAyynXgKBkKGHGv/boY8ub5cGszSMirlh+/5lClAhJ1UkeYmWN2vr6Pxsec2idBocDT8NcpNQdR0sthXH2iF3UnRiB48+C/vX/aWVj9YADlRMaOOAH/m2xhttooTRdRgLBZhCfB+u6rNssrY7NbOw3OBfuDnosJ05q0YN5Lb5vQ/1BOOcuty2fQ8ofLkSkR6fgwb4bY9qQgnVui2AaljFHAOazZNhiLXQhAWn7BYBge1BXdEcbJYb9W4AR6jdof9E+4d049+QhGC/CWt0XLpoIundZi8VIAG2TnZ/6PqtXel8S5zLJyCrlWtak1RkdPwsL8mQzYuu5z2Z/R+WsXbAZ34aSCueAtlz0Vb9YU1ZV6BV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GsRwUlBaFSgt0RQal33rCE337qwl2ggvWNnG6F+RikMeTByv+SOuI3HzAAAAAFNXSBIlhR+AAAGBHJ4hAABj07nXscRn+wIAAAAABFla"
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
# We don't want a KeyboardInterrupt throwing a
# traceback into stdout.
pass
|