-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
append reappends existing lines (or: exists() not passing use_sudo) #341
Comments
Jeff Forcier (bitprophet) posted: Unless that was you, there was another (unclear) report on IRC that sounds like the same issue. Will try to reproduce. on 2011-04-22 at 04:04pm EDT |
**** (dperetti) posted: OK, this is definitely a bug in fabric/contrib/files.py, line 306 : Instead of :
... we should have :
That was as simple as that ! on 2011-04-22 at 05:47pm EDT |
Michael Chan (mtchan888) posted: I notice that egrep wont match the text if characters '>' or '<' are escaped by re.escaped . Thus causing reappend as well.
on 2011-05-26 at 04:12am EDT |
nixon (nixon) posted: I ran into similar problems with trying to append lines containing double quotes and/or singles quotes and/or dollar signs:
on 2011-06-14 at 09:48pm EDT |
nixon (nixon) posted: One solution might be to use "egrep -f pattern_file" where "pattern_file" has the "text" parameter in it. So the "contains" command becomes something like: egrep -q -f pattern.txt filename 2>/dev/null It would need to be able to securely create the temporary pattern.txt file on the remote server and remove it afterwards. on 2011-06-15 at 10:52am EDT |
Jeff Forcier (bitprophet) posted: nixon nixon wrote:
Thanks, I like this idea, and there is already minor precedent (in May have to go into its own ticket though if Dominique's note above is accurate (i.e. there would be 2 different use cases where this bug appears and they should be documented separately.) on 2011-06-15 at 05:16pm EDT |
This happened on a file unreadable by an unprivileged user, for example /root/.ssh/authorized_keys when use_sudo was True. This fix passes along use_sudo to exists, so it can check if the file *really* exists before appending to it. Fixes issue fabric#341.
I've created a patch (to the original bug, not the other ones discussed here): |
Updated title to reflect core bug/problem. Sometime soon I will try to go through and pick up all the 'quick' fixes, including this one. Sorry for the delay. |
Still having this issue |
Description
...at least in my environment.
When run this multiple times :
I get :
...
# IPv6 local connections:
host all all ::1/128 ident
local all all trust
local all all trust
local all all trust
It's probably just me because it seems too big to be true, but I cannot find what I might be doing wrong.
Originally submitted by **** (dperetti) on 2011-04-22 at 03:08pm EDT
The text was updated successfully, but these errors were encountered: