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
a8b6966a
Commit
a8b6966a
authored
Apr 12, 2023
by
Torge Matthies
Committed by
Alexandre Julliard
May 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Handle hidden file names inside get_file_info instead of after it.
Signed-off-by:
Torge Matthies
<
tmatthies@codeweavers.com
>
parent
4ad75758
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
file.c
dlls/ntdll/unix/file.c
+14
-16
No files found.
dlls/ntdll/unix/file.c
View file @
a8b6966a
...
@@ -1292,18 +1292,22 @@ static BOOLEAN get_dir_case_sensitivity( const char *dir )
...
@@ -1292,18 +1292,22 @@ static BOOLEAN get_dir_case_sensitivity( const char *dir )
/***********************************************************************
/***********************************************************************
* is_hidden_file
* is_hidden_file
*
*
* Check if the specified file should be hidden based on its
name
and the show dot files option.
* Check if the specified file should be hidden based on its
unix path
and the show dot files option.
*/
*/
static
BOOL
is_hidden_file
(
const
UNICODE_STRING
*
name
)
static
BOOL
is_hidden_file
(
const
char
*
name
)
{
{
WCHAR
*
p
,
*
end
;
const
char
*
p
;
if
(
show_dot_files
)
return
FALSE
;
if
(
show_dot_files
)
return
FALSE
;
end
=
p
=
name
->
Buffer
+
name
->
Length
/
sizeof
(
WCHAR
);
p
=
name
+
strlen
(
name
);
while
(
p
>
name
->
Buffer
&&
p
[
-
1
]
==
'\\'
)
p
--
;
while
(
p
>
name
&&
p
[
-
1
]
==
'/'
)
p
--
;
while
(
p
>
name
->
Buffer
&&
p
[
-
1
]
!=
'\\'
)
p
--
;
while
(
p
>
name
&&
p
[
-
1
]
!=
'/'
)
p
--
;
return
(
p
<
end
&&
*
p
==
'.'
);
if
(
*
p
++
!=
'.'
)
return
FALSE
;
if
(
!*
p
||
*
p
==
'/'
)
return
FALSE
;
/* "." directory */
if
(
*
p
++
!=
'.'
)
return
FALSE
;
if
(
!*
p
||
*
p
==
'/'
)
return
FALSE
;
/* ".." directory */
return
TRUE
;
}
}
...
@@ -1677,6 +1681,9 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
...
@@ -1677,6 +1681,9 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
}
}
*
attr
|=
get_file_attributes
(
st
);
*
attr
|=
get_file_attributes
(
st
);
if
(
is_hidden_file
(
path
))
*
attr
|=
FILE_ATTRIBUTE_HIDDEN
;
attr_len
=
xattr_get
(
path
,
SAMBA_XATTR_DOS_ATTRIB
,
attr_data
,
sizeof
(
attr_data
)
-
1
);
attr_len
=
xattr_get
(
path
,
SAMBA_XATTR_DOS_ATTRIB
,
attr_data
,
sizeof
(
attr_data
)
-
1
);
if
(
attr_len
!=
-
1
)
if
(
attr_len
!=
-
1
)
*
attr
|=
parse_samba_dos_attrib_data
(
attr_data
,
attr_len
);
*
attr
|=
parse_samba_dos_attrib_data
(
attr_data
,
attr_len
);
...
@@ -2252,11 +2259,6 @@ static NTSTATUS get_dir_data_entry( struct dir_data *dir_data, void *info_ptr, I
...
@@ -2252,11 +2259,6 @@ static NTSTATUS get_dir_data_entry( struct dir_data *dir_data, void *info_ptr, I
if
(
class
!=
FileNamesInformation
)
if
(
class
!=
FileNamesInformation
)
{
{
if
(
st
.
st_dev
!=
dir_data
->
id
.
dev
)
st
.
st_ino
=
0
;
/* ignore inode if on a different device */
if
(
st
.
st_dev
!=
dir_data
->
id
.
dev
)
st
.
st_ino
=
0
;
/* ignore inode if on a different device */
if
(
!
show_dot_files
&&
names
->
long_name
[
0
]
==
'.'
&&
names
->
long_name
[
1
]
&&
(
names
->
long_name
[
1
]
!=
'.'
||
names
->
long_name
[
2
]))
attributes
|=
FILE_ATTRIBUTE_HIDDEN
;
fill_file_info
(
&
st
,
attributes
,
info
,
class
);
fill_file_info
(
&
st
,
attributes
,
info
,
class
);
}
}
...
@@ -4218,7 +4220,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
...
@@ -4218,7 +4220,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
info
->
AllocationSize
=
std
.
AllocationSize
;
info
->
AllocationSize
=
std
.
AllocationSize
;
info
->
EndOfFile
=
std
.
EndOfFile
;
info
->
EndOfFile
=
std
.
EndOfFile
;
info
->
FileAttributes
=
basic
.
FileAttributes
;
info
->
FileAttributes
=
basic
.
FileAttributes
;
if
(
is_hidden_file
(
attr
->
ObjectName
))
info
->
FileAttributes
|=
FILE_ATTRIBUTE_HIDDEN
;
}
}
free
(
unix_name
);
free
(
unix_name
);
}
}
...
@@ -4249,10 +4250,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
...
@@ -4249,10 +4250,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
else
if
(
!
S_ISREG
(
st
.
st_mode
)
&&
!
S_ISDIR
(
st
.
st_mode
))
else
if
(
!
S_ISREG
(
st
.
st_mode
)
&&
!
S_ISDIR
(
st
.
st_mode
))
status
=
STATUS_INVALID_INFO_CLASS
;
status
=
STATUS_INVALID_INFO_CLASS
;
else
else
{
status
=
fill_file_info
(
&
st
,
attributes
,
info
,
FileBasicInformation
);
status
=
fill_file_info
(
&
st
,
attributes
,
info
,
FileBasicInformation
);
if
(
is_hidden_file
(
attr
->
ObjectName
))
info
->
FileAttributes
|=
FILE_ATTRIBUTE_HIDDEN
;
}
free
(
unix_name
);
free
(
unix_name
);
}
}
else
WARN
(
"%s not found (%x)
\n
"
,
debugstr_us
(
attr
->
ObjectName
),
status
);
else
WARN
(
"%s not found (%x)
\n
"
,
debugstr_us
(
attr
->
ObjectName
),
status
);
...
...
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