add a chdir call
This commit is contained in:
parent
86cc88f6bf
commit
aab8672229
3
esgd.py
3
esgd.py
|
@ -188,6 +188,7 @@ class GopherHandler(socketserver.BaseRequestHandler, GopherServerLogic):
|
||||||
log = Logger()
|
log = Logger()
|
||||||
host = "localhost"
|
host = "localhost"
|
||||||
port = 70
|
port = 70
|
||||||
|
location = "/tmp/test"
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
switchgrp = grp.getgrnam("nobody").gr_gid
|
switchgrp = grp.getgrnam("nobody").gr_gid
|
||||||
|
@ -196,4 +197,6 @@ if __name__ == "__main__":
|
||||||
os.setgid(switchgrp)
|
os.setgid(switchgrp)
|
||||||
os.seteuid(switchusr)
|
os.seteuid(switchusr)
|
||||||
log.log("switch user successful")
|
log.log("switch user successful")
|
||||||
|
os.chdir(location)
|
||||||
|
log.log("change directory successful")
|
||||||
server.serve_forever()
|
server.serve_forever()
|
||||||
|
|
Loading…
Reference in New Issue