Changeset 1677:c612f3f882df
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r1672
|
r1677
|
|
| 66 | 66 | if not DSA.is_key_ssh(keys): |
| 67 | 67 | return |
| | 68 | |
| | 69 | # Use a single \n as a delimiter |
| 68 | 70 | 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" |
| 71 | 73 | key_string += keys |
| 72 | 74 | self.__ssh_public_key_string = key_string |
| … |
… |
|
| 90 | 92 | for fn in ssh_fns + (self.__options.PublicKeyFileName,): |
| 91 | 93 | 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") |
| 92 | 97 | if self.__ssh_public_key_string == "": |
| 93 | 98 | raise Exception( |