This file is indexed.

/usr/share/ofono/scripts/test-gnss is in ofono-scripts 1.12.bzr6858+14.04.20140318-0ubuntu1.

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
#!/usr/bin/python

from gi.repository import GLib
import sys
import os

import dbus
import dbus.service
import dbus.mainloop.glib

GNSS_INTERFACE = "org.ofono.AssistedSatelliteNavigation"
AGENT_INTERFACE = "org.ofono.PositioningRequestAgent"

class PositioningAgent(dbus.service.Object):
	@dbus.service.method(AGENT_INTERFACE,
					in_signature="", out_signature="")
	def Release(self):
		print("Release")
		mainloop.quit()

	@dbus.service.method(AGENT_INTERFACE,
					in_signature="s", out_signature="")
	def Request(self, xml):
		print("positioning data: %s" % (xml))

	@dbus.service.method(AGENT_INTERFACE,
					in_signature="", out_signature="")
	def ResetAssistanceData(self):
		print("Reset Assistance Data request received")

def print_menu():
	print("Select test case")
	print("-----------------------------------------------------------")
	print("[0] SendPositioningElement")
	print("[1] RegisterPositioningRequestAgent")
	print("[2] UnregisterPositioningRequestAgent")
	print("[x] Exit")
	print("-----------------------------------------------------------")

def stdin_handler(channel, condition, gnss, path):
	in_key = os.read(channel.unix_get_fd(), 160).rstrip().decode('UTF-8')
	if in_key == '0':
		xml = input('type the element and press enter: ')
		try:
			gnss.SendPositioningElement(dbus.String(xml))
			print("ok")
		except dbus.DBusException as e:
			print("Unable to send positioning element")

	elif in_key == '1':
		try:
			gnss.RegisterPositioningRequestAgent("/test/posagent")
			print("ok")
		except dbus.DBusException as e:
			print("Unable to register positioning agent")

	elif in_key == '2':
		try:
			gnss.UnregisterPositioningRequestAgent(path)
			print("ok")
		except dbus.DBusException as e:
			print("Unable to unregister positioning agent")
	elif in_key == 'x':
		sys.exit(1)

	return True

if __name__ == "__main__":
	if len(sys.argv) < 1:
		sys.exit(1)

	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
	bus = dbus.SystemBus()
	manager = dbus.Interface(bus.get_object('org.ofono', '/'),
							'org.ofono.Manager')

	modems = manager.GetModems()
	for path, properties in modems:
		if GNSS_INTERFACE not in properties["Interfaces"]:
			continue

		gnss = dbus.Interface(bus.get_object('org.ofono', path),
						GNSS_INTERFACE)

	path = "/test/posagent"
	agent = PositioningAgent(bus, path)

	print_menu()

	GLib.io_add_watch(GLib.IOChannel(filedes=sys.stdin.fileno()),
		   GLib.PRIORITY_DEFAULT, GLib.IO_IN, stdin_handler,
		   gnss, path)
	mainloop = GLib.MainLoop()
	mainloop.run()