diff --git a/test.py b/test.py index 3a0770c3c08983ae9be258eeeeb66b3797278d4e..58ec409eb31235f7f5b15185da09b246b590cb30 100755 --- a/test.py +++ b/test.py @@ -6,6 +6,9 @@ import os alive_url = "http://bcda.xray.aps.anl.gov/cgi-bin/alivexml.cgi" +#!os.setgid(104) +#!os.setegid(104) + # function for troubleshooting def get_xml(alive_url): # Get the xml file @@ -22,6 +25,15 @@ def get_xml(alive_url): f.close() return xml_string +def curl_xml(alive_url): + # Get the xml file + print "Curling URL" + command = "curl -s %s" % alive_url + p = os.popen(command, 'r') + xml_string = p.read() + p.close() + return xml_string + def open_xml(xml_string): try: root = ET.fromstring(xml_string) @@ -35,9 +47,14 @@ def open_xml(xml_string): return retval def xml_test(alive_url): - xml_string = get_xml(alive_url) + #!xml_string = get_xml(alive_url) + xml_string = curl_xml(alive_url) if xml_string != None: print open_xml(xml_string) print "uid = %i, gid = %i" % (os.getuid(), os.getgid()) + print "euid = %i, egid = %i" % (os.geteuid(), os.getegid()) + #!print + #!print os.system("env | sort") + #!print xml_test(alive_url)