This file is indexed.

/usr/lib/cups/driver/ptouch is in printer-driver-ptouch 1.4.2-3.

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
#!/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
import json
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 = json.loads(ppds_decompressed.decode(encoding='ASCII'))
    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()
    # Encode to binary, decode base64, decompress and convert to bytes again
    ppds['ARCHIVE'] = BytesIO(decompress(base64.b64decode(ppds['ARCHIVE'].encode('ASCII'))))

    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+Wj4DK/GWBdAD2IggMSmC9yvK1X0OhgodAsc1PSFeh9k8ziWVwDQXz0hcJF32ggYFIkLLfiqwR6AVwQIO2qDFRmka+ZeqfOBtszI7rndJWopqKkRcRGViFIB96axYNSS1yZsG7RZXaI6xJY/RChXDZrO5WYudfzd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1b984kAituG2Dy4VdLbA7cXaKrXN3xOlodRpRTHnMj+0PXvuKveadwccPDqn9vVsEQ+iyS5CW2QMYtCm1vRONnUiutIsjbeqD4Kc8XZdDGWdbbyQoX3e4CzvVoKqghnYio0veWn4uoH1SX56UPpC/tOGP8S1iWcc+4Mw1gKPATj5JYSIEd1lN3pCrhBHI7OWRRzeLuy4bZkklgWKQVYr2Qy8srvpaFIHg9TNryHATTq7fHB0b7V0m1gST18XUFZjv/YQz4RjjItXChUnpuFTcxKFn20wIADFle3OMP9TY4QEQth+D/Qsd2Gt3saXSXEecDiBknYn3fbxp0X6unPM+2VzpV4ctiri5S9TZIYIdLkrt865A7kvIl9hj4xjJJdvpiFhSSdBWSDuivLqj3unJd+dpXckjiIKVtbFW33xVll6InxC+kTLQnw1rVIp6lF+/GLaUoNdyDN4YoI9cnwXoBz/eYIn+Pc+EVf+7zXpnw+AsMAZyXlWyoKcD2CpK31DVURPMXvd74/kgdU/P93s+deLELIpUI4bgDHIqjjwRFqSBcpNRzK/X3KP60VCvbud6ZkY5DhXRI56px6I5B+rH74h48F7YheDsZSKaUsqJYgfxeZaCwZGDf2N3e2Vwd6ACKpElIrwpVPzelTxoFFLssGuikRD2SD05/1uxnZsoxKlnUnarHk6NXP44Mua4nUxogvB1uz1K3yoM88KO4eevPE6LqghKggMbqMtjboK2UFeio+twrSUT0qoLyn9c5ramz5o+92x0zsOV0g5KnSfx4TxLbxckUQzAAcqstTSEMMnCS3x1xFeG7cFf8sM5SkaBKkC4x8fjgksLLkuvNfLp3a9oiC4EHcBNYJj/u6PlEZ3xC4ffGGO4jtWHm6NNhJvPlNWsdava254rxFjm/xH1iOIFnsu0qt0Hnc2ql1TnJVWH8KmevvTmDKvp5jZ9r0zJmQAAyNRuoiQqgawAAfwywGUAAJQBtUKxxGf7AgAAAAAEWVo="

if __name__ == "__main__":
    try:
        main()
    except KeyboardInterrupt:
        # We don't want a KeyboardInterrupt throwing a
        # traceback into stdout.
        pass