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
16525e3f
Commit
16525e3f
authored
Feb 07, 2012
by
Eric W. Biederman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userns: Convert hfsplus to use kuid and kgid where appropriate
Signed-off-by:
Eric W. Biederman
<
ebiederm@xmission.com
>
parent
43b5e4cc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
12 deletions
+20
-12
fs/hfsplus/catalog.c
fs/hfsplus/catalog.c
+2
-2
fs/hfsplus/hfsplus_fs.h
fs/hfsplus/hfsplus_fs.h
+2
-2
fs/hfsplus/inode.c
fs/hfsplus/inode.c
+4
-4
fs/hfsplus/options.c
fs/hfsplus/options.c
+12
-3
init/Kconfig
init/Kconfig
+0
-1
No files found.
fs/hfsplus/catalog.c
View file @
16525e3f
...
...
@@ -80,8 +80,8 @@ void hfsplus_cat_set_perms(struct inode *inode, struct hfsplus_perm *perms)
perms
->
userflags
=
HFSPLUS_I
(
inode
)
->
userflags
;
perms
->
mode
=
cpu_to_be16
(
inode
->
i_mode
);
perms
->
owner
=
cpu_to_be32
(
i
node
->
i_uid
);
perms
->
group
=
cpu_to_be32
(
i
node
->
i_gid
);
perms
->
owner
=
cpu_to_be32
(
i
_uid_read
(
inode
)
);
perms
->
group
=
cpu_to_be32
(
i
_gid_read
(
inode
)
);
if
(
S_ISREG
(
inode
->
i_mode
))
perms
->
dev
=
cpu_to_be32
(
inode
->
i_nlink
);
...
...
fs/hfsplus/hfsplus_fs.h
View file @
16525e3f
...
...
@@ -149,8 +149,8 @@ struct hfsplus_sb_info {
u32
type
;
umode_t
umask
;
uid_t
uid
;
gid_t
gid
;
k
uid_t
uid
;
k
gid_t
gid
;
int
part
,
session
;
unsigned
long
flags
;
...
...
fs/hfsplus/inode.c
View file @
16525e3f
...
...
@@ -233,12 +233,12 @@ static void hfsplus_get_perms(struct inode *inode,
mode
=
be16_to_cpu
(
perms
->
mode
);
i
node
->
i_uid
=
be32_to_cpu
(
perms
->
owner
);
if
(
!
i
node
->
i_uid
&&
!
mode
)
i
_uid_write
(
inode
,
be32_to_cpu
(
perms
->
owner
)
);
if
(
!
i
_uid_read
(
inode
)
&&
!
mode
)
inode
->
i_uid
=
sbi
->
uid
;
i
node
->
i_gid
=
be32_to_cpu
(
perms
->
group
);
if
(
!
i
node
->
i_gid
&&
!
mode
)
i
_gid_write
(
inode
,
be32_to_cpu
(
perms
->
group
)
);
if
(
!
i
_gid_read
(
inode
)
&&
!
mode
)
inode
->
i_gid
=
sbi
->
gid
;
if
(
dir
)
{
...
...
fs/hfsplus/options.c
View file @
16525e3f
...
...
@@ -135,14 +135,22 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi)
printk
(
KERN_ERR
"hfs: uid requires an argument
\n
"
);
return
0
;
}
sbi
->
uid
=
(
uid_t
)
tmp
;
sbi
->
uid
=
make_kuid
(
current_user_ns
(),
(
uid_t
)
tmp
);
if
(
!
uid_valid
(
sbi
->
uid
))
{
printk
(
KERN_ERR
"hfs: invalid uid specified
\n
"
);
return
0
;
}
break
;
case
opt_gid
:
if
(
match_int
(
&
args
[
0
],
&
tmp
))
{
printk
(
KERN_ERR
"hfs: gid requires an argument
\n
"
);
return
0
;
}
sbi
->
gid
=
(
gid_t
)
tmp
;
sbi
->
gid
=
make_kgid
(
current_user_ns
(),
(
gid_t
)
tmp
);
if
(
!
gid_valid
(
sbi
->
gid
))
{
printk
(
KERN_ERR
"hfs: invalid gid specified
\n
"
);
return
0
;
}
break
;
case
opt_part
:
if
(
match_int
(
&
args
[
0
],
&
sbi
->
part
))
{
...
...
@@ -215,7 +223,8 @@ int hfsplus_show_options(struct seq_file *seq, struct dentry *root)
if
(
sbi
->
type
!=
HFSPLUS_DEF_CR_TYPE
)
seq_printf
(
seq
,
",type=%.4s"
,
(
char
*
)
&
sbi
->
type
);
seq_printf
(
seq
,
",umask=%o,uid=%u,gid=%u"
,
sbi
->
umask
,
sbi
->
uid
,
sbi
->
gid
);
from_kuid_munged
(
&
init_user_ns
,
sbi
->
uid
),
from_kgid_munged
(
&
init_user_ns
,
sbi
->
gid
));
if
(
sbi
->
part
>=
0
)
seq_printf
(
seq
,
",part=%u"
,
sbi
->
part
);
if
(
sbi
->
session
>=
0
)
...
...
init/Kconfig
View file @
16525e3f
...
...
@@ -943,7 +943,6 @@ config UIDGID_CONVERTED
depends on CODA_FS = n
depends on FUSE_FS = n
depends on GFS2_FS = n
depends on HFSPLUS_FS = n
depends on HPFS_FS = n
depends on ISO9660_FS = n
depends on JFFS2_FS = n
...
...
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