/usr/share/pyshared/MailPing/fileutil.py is in mailping 0.0.4ubuntu5+really0.0.4-3ubuntu1.
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 | import os, errno, time, socket, shutil
HOSTNAME = socket.gethostname().replace('/', r'\057').replace(':', r'\072')
PID = os.getpid()
def getTime(path):
try:
f=open(path)
except IOError, e:
if e.errno == errno.ENOENT:
return -1
else:
raise
l=f.readline()
return float(l)
def writeFile(path, content, temp=None):
if temp is None:
temp = '%s.%d.%s.%d.tmp' % (
path,
int((time.time())*10e6),
HOSTNAME,
PID,
)
f = file(temp, 'w')
f.write(content)
f.close()
shutil.move(temp, path)
|