Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
17c775f1
Commit
17c775f1
authored
Sep 09, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take care to not close the file handle if there are outstanding locks
and the directory options don't match.
parent
bb8f36ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
fd.c
server/fd.c
+20
-13
No files found.
server/fd.c
View file @
17c775f1
...
...
@@ -954,18 +954,6 @@ struct fd *open_fd( struct fd *fd, const char *name, int flags, mode_t *mode,
fstat
(
fd
->
unix_fd
,
&
st
);
*
mode
=
st
.
st_mode
;
/* check directory options */
if
((
options
&
FILE_DIRECTORY_FILE
)
&&
!
S_ISDIR
(
st
.
st_mode
))
{
set_error
(
STATUS_NOT_A_DIRECTORY
);
goto
error
;
}
if
((
options
&
FILE_NON_DIRECTORY_FILE
)
&&
S_ISDIR
(
st
.
st_mode
))
{
set_error
(
STATUS_FILE_IS_A_DIRECTORY
);
goto
error
;
}
/* only bother with an inode for normal files and directories */
if
(
S_ISREG
(
st
.
st_mode
)
||
S_ISDIR
(
st
.
st_mode
))
{
...
...
@@ -981,6 +969,20 @@ struct fd *open_fd( struct fd *fd, const char *name, int flags, mode_t *mode,
fd
->
inode
=
inode
;
fd
->
closed
=
closed_fd
;
list_add_head
(
&
inode
->
open
,
&
fd
->
inode_entry
);
/* check directory options */
if
((
options
&
FILE_DIRECTORY_FILE
)
&&
!
S_ISDIR
(
st
.
st_mode
))
{
release_object
(
fd
);
set_error
(
STATUS_NOT_A_DIRECTORY
);
return
NULL
;
}
if
((
options
&
FILE_NON_DIRECTORY_FILE
)
&&
S_ISDIR
(
st
.
st_mode
))
{
release_object
(
fd
);
set_error
(
STATUS_FILE_IS_A_DIRECTORY
);
return
NULL
;
}
if
(
!
check_sharing
(
fd
,
access
,
sharing
))
{
release_object
(
fd
);
...
...
@@ -990,8 +992,13 @@ struct fd *open_fd( struct fd *fd, const char *name, int flags, mode_t *mode,
strcpy
(
closed_fd
->
unlink
,
unlink_name
);
if
(
flags
&
O_TRUNC
)
ftruncate
(
fd
->
unix_fd
,
0
);
}
else
else
/* special file */
{
if
(
options
&
FILE_DIRECTORY_FILE
)
{
set_error
(
STATUS_NOT_A_DIRECTORY
);
goto
error
;
}
if
(
unlink_name
[
0
])
/* we can't unlink special files */
{
set_error
(
STATUS_INVALID_PARAMETER
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment