From c3176b0ca35d88f522bdef80545d3fafc8bb27f9 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 28 Sep 2018 11:02:05 +0200 Subject: [PATCH] Do not set ownership in `create_certs` Most Authenticators do not have local users, so this doesn't make sense at this stage --- jupyterhub/spawner.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/jupyterhub/spawner.py b/jupyterhub/spawner.py index b777028f..cde0bdfa 100644 --- a/jupyterhub/spawner.py +++ b/jupyterhub/spawner.py @@ -744,19 +744,8 @@ class Spawner(LoggingConfigurable): paths = { "keyfile": notebook_key_pair['files']['key'], "certfile": notebook_key_pair['files']['cert'], - "cafile": self.internal_trust_bundles[notebook_component] + "cafile": self.internal_trust_bundles[notebook_component], } - - try: - user = pwd.getpwnam(self.user.name) - uid = user.pw_uid - gid = user.pw_gid - for f in ['keyfile', 'certfile']: - shutil.chown(paths[f], user=uid, group=gid) - except KeyError: - self.log.info("User {} not found on system, " - "unable to change ownership".format(self.user.name)) - return paths def move_certs(self, paths):