Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
8d81094b
Commit
8d81094b
authored
Dec 01, 2002
by
Andries E. Brouwer
Committed by
Linus Torvalds
Dec 01, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fix wrong permissions for vfat directories
This fixes the umask/fmask/dmask confusion in vfat.
parent
bcbcf54d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
7 deletions
+17
-7
fs/fat/inode.c
fs/fat/inode.c
+13
-5
fs/umsdos/ioctl.c
fs/umsdos/ioctl.c
+3
-1
include/linux/msdos_fs_sb.h
include/linux/msdos_fs_sb.h
+1
-1
No files found.
fs/fat/inode.c
View file @
8d81094b
...
@@ -205,7 +205,7 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt)
...
@@ -205,7 +205,7 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt)
seq_printf
(
m
,
",uid=%d"
,
opts
->
fs_uid
);
seq_printf
(
m
,
",uid=%d"
,
opts
->
fs_uid
);
if
(
opts
->
fs_gid
!=
0
)
if
(
opts
->
fs_gid
!=
0
)
seq_printf
(
m
,
",gid=%d"
,
opts
->
fs_gid
);
seq_printf
(
m
,
",gid=%d"
,
opts
->
fs_gid
);
seq_printf
(
m
,
",
umask=%04o"
,
opts
->
fs_u
mask
);
seq_printf
(
m
,
",
fmask=%04o"
,
opts
->
fs_f
mask
);
seq_printf
(
m
,
",dmask=%04o"
,
opts
->
fs_dmask
);
seq_printf
(
m
,
",dmask=%04o"
,
opts
->
fs_dmask
);
if
(
sbi
->
nls_disk
)
if
(
sbi
->
nls_disk
)
seq_printf
(
m
,
",codepage=%s"
,
sbi
->
nls_disk
->
charset
);
seq_printf
(
m
,
",codepage=%s"
,
sbi
->
nls_disk
->
charset
);
...
@@ -267,7 +267,7 @@ static int parse_options(char *options, int is_vfat, int *debug,
...
@@ -267,7 +267,7 @@ static int parse_options(char *options, int is_vfat, int *debug,
opts
->
fs_uid
=
current
->
uid
;
opts
->
fs_uid
=
current
->
uid
;
opts
->
fs_gid
=
current
->
gid
;
opts
->
fs_gid
=
current
->
gid
;
opts
->
fs_
u
mask
=
opts
->
fs_dmask
=
current
->
fs
->
umask
;
opts
->
fs_
f
mask
=
opts
->
fs_dmask
=
current
->
fs
->
umask
;
opts
->
codepage
=
0
;
opts
->
codepage
=
0
;
opts
->
iocharset
=
NULL
;
opts
->
iocharset
=
NULL
;
if
(
is_vfat
)
if
(
is_vfat
)
...
@@ -333,7 +333,15 @@ static int parse_options(char *options, int is_vfat, int *debug,
...
@@ -333,7 +333,15 @@ static int parse_options(char *options, int is_vfat, int *debug,
else
if
(
!
strcmp
(
this_char
,
"umask"
))
{
else
if
(
!
strcmp
(
this_char
,
"umask"
))
{
if
(
!
value
||
!*
value
)
ret
=
0
;
if
(
!
value
||
!*
value
)
ret
=
0
;
else
{
else
{
opts
->
fs_umask
=
simple_strtoul
(
value
,
&
value
,
8
);
opts
->
fs_fmask
=
opts
->
fs_dmask
=
simple_strtoul
(
value
,
&
value
,
8
);
if
(
*
value
)
ret
=
0
;
}
}
else
if
(
!
strcmp
(
this_char
,
"fmask"
))
{
if
(
!
value
||
!*
value
)
ret
=
0
;
else
{
opts
->
fs_fmask
=
simple_strtoul
(
value
,
&
value
,
8
);
if
(
*
value
)
ret
=
0
;
if
(
*
value
)
ret
=
0
;
}
}
}
}
...
@@ -1119,7 +1127,7 @@ static int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
...
@@ -1119,7 +1127,7 @@ static int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
((
sbi
->
options
.
showexec
&&
((
sbi
->
options
.
showexec
&&
!
is_exec
(
de
->
ext
))
!
is_exec
(
de
->
ext
))
?
S_IRUGO
|
S_IWUGO
:
S_IRWXUGO
)
?
S_IRUGO
|
S_IWUGO
:
S_IRWXUGO
)
&
~
sbi
->
options
.
fs_
u
mask
)
|
S_IFREG
;
&
~
sbi
->
options
.
fs_
f
mask
)
|
S_IFREG
;
MSDOS_I
(
inode
)
->
i_start
=
CF_LE_W
(
de
->
start
);
MSDOS_I
(
inode
)
->
i_start
=
CF_LE_W
(
de
->
start
);
if
(
sbi
->
fat_bits
==
32
)
{
if
(
sbi
->
fat_bits
==
32
)
{
MSDOS_I
(
inode
)
->
i_start
|=
MSDOS_I
(
inode
)
->
i_start
|=
...
@@ -1253,7 +1261,7 @@ int fat_notify_change(struct dentry * dentry, struct iattr * attr)
...
@@ -1253,7 +1261,7 @@ int fat_notify_change(struct dentry * dentry, struct iattr * attr)
if
(
S_ISDIR
(
inode
->
i_mode
))
if
(
S_ISDIR
(
inode
->
i_mode
))
mask
=
sbi
->
options
.
fs_dmask
;
mask
=
sbi
->
options
.
fs_dmask
;
else
else
mask
=
sbi
->
options
.
fs_
u
mask
;
mask
=
sbi
->
options
.
fs_
f
mask
;
inode
->
i_mode
&=
S_IFMT
|
(
S_IRWXUGO
&
~
mask
);
inode
->
i_mode
&=
S_IFMT
|
(
S_IRWXUGO
&
~
mask
);
out:
out:
unlock_kernel
();
unlock_kernel
();
...
...
fs/umsdos/ioctl.c
View file @
8d81094b
...
@@ -430,7 +430,9 @@ new_dentry->d_parent->d_name.name, new_dentry->d_name.name);
...
@@ -430,7 +430,9 @@ new_dentry->d_parent->d_name.name, new_dentry->d_name.name);
*/
*/
dir
->
i_sb
->
u
.
msdos_sb
.
options
.
fs_uid
=
data
.
umsdos_dirent
.
uid
;
dir
->
i_sb
->
u
.
msdos_sb
.
options
.
fs_uid
=
data
.
umsdos_dirent
.
uid
;
dir
->
i_sb
->
u
.
msdos_sb
.
options
.
fs_gid
=
data
.
umsdos_dirent
.
gid
;
dir
->
i_sb
->
u
.
msdos_sb
.
options
.
fs_gid
=
data
.
umsdos_dirent
.
gid
;
dir
->
i_sb
->
u
.
msdos_sb
.
options
.
fs_umask
=
data
.
umsdos_dirent
.
mode
;
dir
->
i_sb
->
u
.
msdos_sb
.
options
.
fs_fmask
=
dir
->
i_sb
->
u
.
msdos_sb
.
options
.
fs_dmask
=
data
.
umsdos_dirent
.
mode
;
ret
=
0
;
ret
=
0
;
}
}
out:
out:
...
...
include/linux/msdos_fs_sb.h
View file @
8d81094b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
struct
fat_mount_options
{
struct
fat_mount_options
{
uid_t
fs_uid
;
uid_t
fs_uid
;
gid_t
fs_gid
;
gid_t
fs_gid
;
unsigned
short
fs_
u
mask
;
unsigned
short
fs_
f
mask
;
unsigned
short
fs_dmask
;
unsigned
short
fs_dmask
;
unsigned
short
codepage
;
/* Codepage for shortname conversions */
unsigned
short
codepage
;
/* Codepage for shortname conversions */
char
*
iocharset
;
/* Charset used for filename input/display */
char
*
iocharset
;
/* Charset used for filename input/display */
...
...
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