<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>7368</bug_id>
          
          <creation_ts>2005-07-14 23:04:50 +0400</creation_ts>
          <short_desc>mkdir -p builtin fails when a part of the path is a symlink</short_desc>
          <delta_ts>2005-08-26 12:10:18 +0400</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>zsh</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Fr. Br. George">george</reporter>
          <assigned_to name="Fr. Br. George">george</assigned_to>
          <cc>arseny</cc>
    
    <cc>george</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>27291</commentid>
    <comment_count>0</comment_count>
    <who name="Fr. Br. George">george</who>
    <bug_when>2005-07-14 23:04:50 +0400</bug_when>
    <thetext>Zsh have &quot;files&quot; plugin includeing &quot;mkdir&quot; buiiltin.
When using mkdir -p then, the builtin version fails on partially symlik-ed path.
E. g. when /home  is symlink-&gt; /var/home, any first completion spams a
&quot;_store_cache:mkdir:16: cannot make directory `/home&apos;: file exists&quot; message when
trying to create $HOME/.zcompcache.

Look at this part of zsh-4.3.0-20050611/Src/Modules/files.c:

    121 domkdir(char *nam, char *path, mode_t mode, int p)
    122 {
    123     int err;
    124     mode_t oumask;
    125     char const *rpath = unmeta(path);
    126 
    127     if(p) {
    128         struct stat st;
    129 
    130         if(!lstat(rpath, &amp;st) &amp;&amp; S_ISDIR(st.st_mode))
    131             return 0;
    132     }

Here must be &quot;stat&quot; instead of &quot;lstat&quot;, mustn&apos;t it?
Steps to Reproduce:
0. mv /home /var/home; ln -s /var/home /home # do it carefully :)
1. rm -rf ~/.zcompcache
2. apt-cache search a&lt;TAB&gt;

Actual Results:  
see message, no ~/.zcompcache is created

Expected Results:  
see no messages, ~/.zcompcache is created</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27571</commentid>
    <comment_count>1</comment_count>
    <who name="at@altlinux.org">at</who>
    <bug_when>2005-07-21 23:35:59 +0400</bug_when>
    <thetext>Fixed in zsh-4.3.0-alt0.2.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>