Changeset 1677:c612f3f882df

Show
Ignore:
Timestamp:
06/26/08 11:17:41 (2 months ago)
Author:
klai@…
Branch:
default
Message:

Make sure that each ssh key terminated by exactly one \n in authorized_keys file

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Tycoon/AuctioneerClient.py

    r1672 r1677  
    6666        if not DSA.is_key_ssh(keys): 
    6767            return 
     68 
     69        # Use a single \n as a delimiter 
    6870        key_string = self.__ssh_public_key_string 
    69         if (key_string != "" and key_string[-1] != "\n"): 
    70             key_string += "\n" 
     71        if key_string != "": 
     72            key_string = key_string.strip() + "\n" 
    7173        key_string += keys 
    7274        self.__ssh_public_key_string = key_string 
     
    9092        for fn in ssh_fns + (self.__options.PublicKeyFileName,): 
    9193            self.__read_ssh_keys(fn) 
     94        if self.__ssh_public_key_string != "": 
     95            self.__ssh_public_key_string = ( 
     96                self.__ssh_public_key_string.strip() + "\n") 
    9297        if self.__ssh_public_key_string == "": 
    9398            raise Exception(