summaryrefslogtreecommitdiff
path: root/Completion/Base/Utility/_store_cache
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base/Utility/_store_cache')
-rw-r--r--Completion/Base/Utility/_store_cache10
1 files changed, 8 insertions, 2 deletions
diff --git a/Completion/Base/Utility/_store_cache b/Completion/Base/Utility/_store_cache
index cb6e8d3b1..86e72e9a9 100644
--- a/Completion/Base/Utility/_store_cache
+++ b/Completion/Base/Utility/_store_cache
@@ -13,7 +13,11 @@ if zstyle -t ":completion:${curcontext}:" use-cache; then
if [[ -e "$_cache_dir" ]]; then
_message "cache-dir style points to a non-directory\!"
else
- (zmodload zsh/files 2>/dev/null; mkdir -p "$_cache_dir" )
+ # if module load fails, we *should* be okay using normal mkdir so
+ # we load feature b:mkdir instead of b:zf_mkdir; note that modules
+ # loaded in a sub-shell don't affect the parent.
+ ( zmodload -F zsh/files b:mkdir; mkdir -m 0700 -p "$_cache_dir"
+ ) 2>/dev/null
if [[ ! -d "$_cache_dir" ]]; then
_message "couldn't create cache-dir $_cache_dir"
return 1
@@ -27,7 +31,9 @@ if zstyle -t ":completion:${curcontext}:" use-cache; then
if [[ -e "$_cache_ident_dir" ]]; then
_message "cache ident dir points to a non-directory:$_cache_ident_dir"
else
- (zmodload zsh/files 2>/dev/null; mkdir -p "$_cache_ident_dir")
+ # See also rationale in zmodload above
+ ( zmodload -F zsh/files b:mkdir; mkdir -m 0700 -p "$_cache_ident_dir"
+ ) 2>/dev/null
if [[ ! -d "$_cache_ident_dir" ]]; then
_message "couldn't create cache-ident_dir $_cache_ident_dir"
return 1