support relative path in AuthorizedKeysFile

This commit is contained in:
Scott Moser 2012-05-22 13:50:30 -04:00
parent 807e27a00f
commit a23fca2f56
2 changed files with 4 additions and 0 deletions

View File

@ -1,3 +1,5 @@
0.6.4:
- support relative path in AuthorizedKeysFile (LP: #970071).
0.6.3: 0.6.3:
- add sample systemd config files [Garrett Holmstrom] - add sample systemd config files [Garrett Holmstrom]
- add Fedora support [Garrent Holstrom] (LP: #883286) - add Fedora support [Garrent Holstrom] (LP: #883286)

View File

@ -155,6 +155,8 @@ def setup_user_keys(keys, user, key_prefix, log=None):
akeys = ssh_cfg.get("AuthorizedKeysFile", "%h/.ssh/authorized_keys") akeys = ssh_cfg.get("AuthorizedKeysFile", "%h/.ssh/authorized_keys")
akeys = akeys.replace("%h", pwent.pw_dir) akeys = akeys.replace("%h", pwent.pw_dir)
akeys = akeys.replace("%u", user) akeys = akeys.replace("%u", user)
if not akeys.startswith('/'):
akeys = os.path.join(pwent.pw_dir, akeys)
authorized_keys = akeys authorized_keys = akeys
except Exception: except Exception:
authorized_keys = '%s/.ssh/authorized_keys' % pwent.pw_dir authorized_keys = '%s/.ssh/authorized_keys' % pwent.pw_dir