refresh-auth
changeset 32 4059dbe9f26a
parent 30 98dbde5b13a1
equal deleted inserted replaced
31:d54720d47ca2 32:4059dbe9f26a
    34         ffn = os.path.join(root, fn)
    34         ffn = os.path.join(root, fn)
    35         if not ruleset.goodpath(ffn):
    35         if not ruleset.goodpath(ffn):
    36             # ignore any path that contains dodgy characters
    36             # ignore any path that contains dodgy characters
    37             continue
    37             continue
    38         keyname = ffn[5:]
    38         keyname = ffn[5:]
       
    39         if keyname == "root":
       
    40             # No key can claim root privileges
       
    41             continue
    39         p = subprocess.Popen(("ssh-keygen", "-i", "-f", ffn), 
    42         p = subprocess.Popen(("ssh-keygen", "-i", "-f", ffn), 
    40             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    43             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    41         newkey = p.communicate()[0]
    44         newkey = p.communicate()[0]
    42         if p.wait() == 0:
    45         if p.wait() == 0:
    43             klines = [l.strip() for l in newkey.split("\n")]
    46             klines = [l.strip() for l in newkey.split("\n")]