add a chdir call

This commit is contained in:
randomuser 2021-07-20 03:27:44 -05:00
parent 86cc88f6bf
commit aab8672229
1 changed files with 3 additions and 0 deletions

View File

@ -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()