[2/2] server: Make sure that CreateFile(CREATE_ALWAYS) overwrites existing file attributes.

Alexandre Julliard julliard at winehq.org
Thu Mar 17 04:54:30 CDT 2011


Dmitry Timoshkov <dmitry at codeweavers.com> writes:

> @@ -1829,6 +1828,11 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
>                  return NULL;
>              }
>              ftruncate( fd->unix_fd, 0 );
> +            if (flags & O_CREAT)
> +            {
> +                fchmod( fd->unix_fd, *mode );
> +                fstat( fd->unix_fd, &st );
> +            }

You'd have to take umask into account. And I'd like to see some tests
for this at the ntdll level.

> @@ -178,7 +178,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si
>      switch(create)
>      {
>      case FILE_CREATE:       flags = O_CREAT | O_EXCL; break;
> -    case FILE_OVERWRITE_IF: /* FIXME: the difference is whether we trash existing attr or not */
> +    case FILE_OVERWRITE_IF: /* the difference is whether we trash existing attr or not */

It's still a FIXME.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list