diff -uNr a/lib/vfs/interface.c b/lib/vfs/interface.c
a
|
b
|
|
844 | 844 | |
845 | 845 | canonicalize_pathname (buffer); |
846 | 846 | |
847 | | if (lstat (buffer, &st) == 0) |
| 847 | /* Try to create directory */ |
| 848 | if (mkdir (buffer, S_IRWXU) != 0) |
848 | 849 | { |
849 | | /* Sanity check for existing directory */ |
850 | | if (!S_ISDIR (st.st_mode)) |
851 | | error = _("%s is not a directory\n"); |
852 | | else if (st.st_uid != getuid ()) |
853 | | error = _("Directory %s is not owned by you\n"); |
854 | | else if (((st.st_mode & 0777) != 0700) && (chmod (buffer, 0700) != 0)) |
855 | | error = _("Cannot set correct permissions for directory %s\n"); |
856 | | } |
857 | | else |
858 | | { |
859 | | /* Need to create directory */ |
860 | | if (mkdir (buffer, S_IRWXU) != 0) |
| 850 | if (errno == EEXIST && lstat (buffer, &st) == 0) |
861 | 851 | { |
| 852 | /* Sanity check for existing directory */ |
| 853 | if (!S_ISDIR (st.st_mode)) |
| 854 | error = _("%s is not a directory\n"); |
| 855 | else if (st.st_uid != getuid ()) |
| 856 | error = _("Directory %s is not owned by you\n"); |
| 857 | else if (((st.st_mode & 0777) != 0700) && (chmod (buffer, 0700) != 0)) |
| 858 | error = _("Cannot set correct permissions for directory %s\n"); |
| 859 | } else { |
862 | 860 | fprintf (stderr, |
863 | 861 | _("Cannot create temporary directory %s: %s\n"), |
864 | 862 | buffer, unix_error_string (errno)); |