|
a/Allura/ldap-userconfig.py |
|
b/Allura/ldap-userconfig.py |
|
... |
|
... |
20 |
os.chmod(ssh, 0700)
|
20 |
os.chmod(ssh, 0700)
|
21 |
os.chown(home, u.pw_uid, g.gr_gid)
|
21 |
os.chown(home, u.pw_uid, g.gr_gid)
|
22 |
os.chown(ssh, u.pw_uid, g.gr_gid)
|
22 |
os.chown(ssh, u.pw_uid, g.gr_gid)
|
23 |
|
23 |
|
24 |
def upload(uname, pubkey):
|
24 |
def upload(uname, pubkey):
|
25 |
keyfile = os.path.join('/home', uname, '.ssh', 'authorized_keys2')
|
25 |
keyfile = os.path.join('/home', uname, '.ssh', 'authorized_keys')
|
26 |
u = pwd.getpwnam(uname)
|
26 |
u = pwd.getpwnam(uname)
|
27 |
g = grp.getgrnam('scm')
|
27 |
g = grp.getgrnam('scm')
|
28 |
with open(keyfile, 'w') as fp:
|
28 |
with open(keyfile, 'w') as fp:
|
29 |
fp.write(pubkey)
|
29 |
fp.write(pubkey)
|
30 |
os.chown(keyfile, u.pw_uid, g.gr_gid)
|
30 |
os.chown(keyfile, u.pw_uid, g.gr_gid)
|