Fix a bug in ChagePassword task
[snf-image] / snf-image-helper / tasks / 50ChangePassword.in
index 3f7616c..5d01667 100644 (file)
@@ -142,7 +142,7 @@ unix_password() {
         fi
 
         new_entry="$(${flavor}_change_shadow_entry "$entry" "$encrypted")"
-        grep -v "${users[$i]}" "$target${!shadow}" > "$tmp_shadow"
+        grep -v "^${users[$i]}:" "$target${!shadow}" > "$tmp_shadow"
         echo "$new_entry" >> "$tmp_shadow"
         cat "$tmp_shadow" > "$target${!shadow}"
         echo "done"