Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Insecure tempfile creation



On Dec 22,  8:36pm, Daniel Shahaf wrote:
}
} Of course, once we decide what to do with edit-command-line, it would be
} good to go through all the other instances and fix them too.

Question related to this:  Is there some reason the following does NOT
work?  Does zftp fail in the subshell?

diff --git a/Functions/Zftp/zffcache b/Functions/Zftp/zffcache
index 48afdcb..b609c21 100644
--- a/Functions/Zftp/zffcache
+++ b/Functions/Zftp/zffcache
@@ -19,8 +19,5 @@ fi
 if [[ $1 = -d ]]; then
   unset $fcache_name
 elif (( ${(P)#fcache_name} == 0 )); then
-  local tmpf=${TMPPREFIX}zffcache$$
-  zftp ls >$tmpf
-  eval "$fcache_name=(\${(f)\"\$(<\$tmpf)\"})"
-  rm -f $tmpf
+  eval "$fcache_name=(\${(f)\"\$(zftp ls)\"})"
 fi



Messages sorted by: Reverse Date, Date, Thread, Author