VirtualBox

Changeset 36166 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 4, 2011 11:54:53 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70356
Message:

Runtime/r3/posix: RTDirCreate should fail when creating a directory where a file exists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp

    r35935 r36166  
    101101                    ||  rc == EACCES)
    102102                {
    103                     struct stat st;
    104                     if (!stat(pszNativePath, &st))
    105                         rc = EEXIST;
     103                    rc = EEXIST;
    106104                }
    107105#endif
    108106                rc = RTErrConvertFromErrno(rc);
     107                if (rc == VERR_ALREADY_EXISTS)
     108                {
     109                    /*
     110                     * Verify that it really exists as a directory.
     111                     */
     112                    struct stat st;
     113                    if (!stat(pszNativePath, &st) && !S_ISDIR(st.st_mode))
     114                        rc = VERR_IS_A_FILE;
     115                }
    109116            }
    110117        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette