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()
host = "localhost"
port = 70
location = "/tmp/test"
if __name__ == "__main__":
switchgrp = grp.getgrnam("nobody").gr_gid
@ -196,4 +197,6 @@ if __name__ == "__main__":
os.setgid(switchgrp)
os.seteuid(switchusr)
log.log("switch user successful")
os.chdir(location)
log.log("change directory successful")
server.serve_forever()