projects
/
snf-image
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ce86d6c
)
Fix a bug in ChagePassword task
author
Nikos Skalkotos
<skalkoto@grnet.gr>
Tue, 5 Nov 2013 10:28:24 +0000
(12:28 +0200)
committer
Nikos Skalkotos
<skalkoto@grnet.gr>
Tue, 5 Nov 2013 10:28:24 +0000
(12:28 +0200)
In some cases the task removed some shadow/master.passwd entries by
accident because the grep pattern it used was more general than it
should be
snf-image-helper/tasks/50ChangePassword.in
patch
|
blob
|
history
diff --git
a/snf-image-helper/tasks/50ChangePassword.in
b/snf-image-helper/tasks/50ChangePassword.in
index
3f7616c
..
5d01667
100644
(file)
--- a/
snf-image-helper/tasks/50ChangePassword.in
+++ b/
snf-image-helper/tasks/50ChangePassword.in
@@
-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"