fixed bug in remove_monkeysphere_lines function
authorJameson Rollins <jrollins@finestructure.net>
Mon, 18 Oct 2010 01:40:35 +0000 (21:40 -0400)
committerJameson Rollins <jrollins@finestructure.net>
Mon, 18 Oct 2010 01:40:35 +0000 (21:40 -0400)
it was matching MonkeySphere strings as full lines and therefore not
actually removing monkeysphere lines.

I'm not sure exactly why, upon further consideration, why we actually
need to be removing all monkeysphere lines in update_authorized_keys.

src/share/common

index 34ac52da7f5dcfcdd2e893be3234ac400002b18c..5486eaa57b69d94923928ac186693a3bfc1e6a62 100644 (file)
@@ -376,8 +376,8 @@ remove_monkeysphere_lines() {
     tempfile=$(mktemp "${file}.XXXXXXX") || \
        failure "Could not make temporary file '${file}.XXXXXXX'."
 
-    egrep -v '^MonkeySphere[[:digit:]]{4}(-[[:digit:]]{2}){2}T[[:digit:]]{2}(:[[:digit:]]{2}){2}$' \
-       "$file" >"$tempfile"
+    egrep -v ' MonkeySphere[[:digit:]]{4}(-[[:digit:]]{2}){2}T[[:digit:]]{2}(:[[:digit:]]{2}){2} ' \
+       "$file" >"$tempfile" || true
     cat "$tempfile" > "$file"
     rm "$tempfile"
 }