This file is indexed.

/usr/lib/python2.7/dist-packages/Pyro4/utils/flameserver.py is in python2-pyro4 4.63-1.

This file is owned by root:root, with mode 0o644.

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
"""
Pyro FLAME:  Foreign Location Automatic Module Exposer.
Easy but potentially very dangerous way of exposing remote modules and builtins.
This is the commandline server.

You can start this module as a script from the command line, to easily get a
flame server running:

  :command:`python -m Pyro4.utils.flameserver`
  or simply: :command:`pyro4-flameserver`

You have to explicitly enable Flame first though by setting the FLAME_ENABLED config item.

Pyro - Python Remote Objects.  Copyright by Irmen de Jong (irmen@razorvine.net).
"""

from __future__ import print_function
import sys
from Pyro4.configuration import config
from Pyro4 import core
from Pyro4.utils import flame


def main(args=None, returnWithoutLooping=False):
    from optparse import OptionParser

    parser = OptionParser()
    parser.add_option("-H", "--host", default="localhost", help="hostname to bind server on (default=%default)")
    parser.add_option("-p", "--port", type="int", default=0, help="port to bind server on")
    parser.add_option("-u", "--unixsocket", help="Unix domain socket name to bind server on")
    parser.add_option("-q", "--quiet", action="store_true", default=False, help="don't output anything")
    parser.add_option("-k", "--key", help="the HMAC key to use")
    options, args = parser.parse_args(args)

    if not options.quiet:
        print("Starting Pyro Flame server.")

    hmac = (options.key or "").encode("utf-8")
    if not hmac and not options.quiet:
        print("Warning: HMAC key not set. Anyone can connect to this server!")

    config.SERIALIZERS_ACCEPTED = {"pickle"}  # flame requires pickle serializer, doesn't work with the others.

    daemon = core.Daemon(host=options.host, port=options.port, unixsocket=options.unixsocket)
    if hmac:
        daemon._pyroHmacKey = hmac
    uri = flame.start(daemon)
    if not options.quiet:
        print("server uri: %s" % uri)
        print("server is running.")

    if returnWithoutLooping:
        return daemon, uri  # for unit testing
    else:
        daemon.requestLoop()
    daemon.close()
    return 0


if __name__ == "__main__":
    sys.exit(main())