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
066a0e3d
Commit
066a0e3d
authored
Feb 07, 2004
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Bugfixes for the NFSv4 client name to uid mapper.
Fixes a memory-scribble problem.
parent
530eb115
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
14 deletions
+6
-14
fs/nfs/idmap.c
fs/nfs/idmap.c
+2
-10
fs/nfs/nfs4xdr.c
fs/nfs/nfs4xdr.c
+4
-4
No files found.
fs/nfs/idmap.c
View file @
066a0e3d
...
@@ -146,7 +146,8 @@ nfs_idmap_id(struct nfs_server *server, u_int8_t type, char *name,
...
@@ -146,7 +146,8 @@ nfs_idmap_id(struct nfs_server *server, u_int8_t type, char *name,
struct
idmap
*
idmap
=
server
->
idmap
;
struct
idmap
*
idmap
=
server
->
idmap
;
struct
idmap_msg
*
im
;
struct
idmap_msg
*
im
;
DECLARE_WAITQUEUE
(
wq
,
current
);
DECLARE_WAITQUEUE
(
wq
,
current
);
int
ret
=
-
1
,
hashtype
=
IDMAP_HASH_TYPE_NAME
,
xnamelen
=
namelen
;
int
ret
=
-
1
,
hashtype
=
IDMAP_HASH_TYPE_NAME
;
u_int
xnamelen
=
namelen
;
if
(
idmap
==
NULL
)
if
(
idmap
==
NULL
)
return
(
-
1
);
return
(
-
1
);
...
@@ -169,15 +170,6 @@ nfs_idmap_id(struct nfs_server *server, u_int8_t type, char *name,
...
@@ -169,15 +170,6 @@ nfs_idmap_id(struct nfs_server *server, u_int8_t type, char *name,
memset
(
im
,
0
,
sizeof
(
*
im
));
memset
(
im
,
0
,
sizeof
(
*
im
));
memcpy
(
im
->
im_name
,
name
,
namelen
);
memcpy
(
im
->
im_name
,
name
,
namelen
);
/* Make sure the string is NULL terminated */
if
(
namelen
!=
xnamelen
)
{
/* We cannot fit a NULL character */
if
(
namelen
==
IDMAP_NAMESZ
)
{
ret
=
-
1
;
goto
out
;
}
im
->
im_name
[
namelen
]
=
'\0'
;
}
im
->
im_type
=
type
;
im
->
im_type
=
type
;
im
->
im_conv
=
IDMAP_CONV_NAMETOID
;
im
->
im_conv
=
IDMAP_CONV_NAMETOID
;
...
...
fs/nfs/nfs4xdr.c
View file @
066a0e3d
...
@@ -241,8 +241,8 @@ encode_attrs(struct xdr_stream *xdr, struct iattr *iap,
...
@@ -241,8 +241,8 @@ encode_attrs(struct xdr_stream *xdr, struct iattr *iap,
{
{
char
owner_name
[
256
];
char
owner_name
[
256
];
char
owner_group
[
256
];
char
owner_group
[
256
];
int
owner_namelen
=
0
;
int
owner_namelen
=
sizeof
(
owner_name
)
;
int
owner_grouplen
=
0
;
int
owner_grouplen
=
sizeof
(
owner_group
)
;
uint32_t
*
p
;
uint32_t
*
p
;
uint32_t
*
q
;
uint32_t
*
q
;
int
len
;
int
len
;
...
@@ -1476,7 +1476,7 @@ decode_getattr(struct xdr_stream *xdr, struct nfs4_getattr *getattr,
...
@@ -1476,7 +1476,7 @@ decode_getattr(struct xdr_stream *xdr, struct nfs4_getattr *getattr,
READ_BUF
(
dummy32
);
READ_BUF
(
dummy32
);
len
+=
(
XDR_QUADLEN
(
dummy32
)
<<
2
);
len
+=
(
XDR_QUADLEN
(
dummy32
)
<<
2
);
if
((
status
=
nfs_idmap_id
(
server
,
IDMAP_TYPE_USER
,
if
((
status
=
nfs_idmap_id
(
server
,
IDMAP_TYPE_USER
,
(
char
*
)
p
,
len
,
&
nfp
->
uid
))
==
-
1
)
{
(
char
*
)
p
,
dummy32
,
&
nfp
->
uid
))
==
-
1
)
{
dprintk
(
"read_attrs: gss_get_num failed!
\n
"
);
dprintk
(
"read_attrs: gss_get_num failed!
\n
"
);
/* goto out; */
/* goto out; */
nfp
->
uid
=
-
2
;
nfp
->
uid
=
-
2
;
...
@@ -1494,7 +1494,7 @@ decode_getattr(struct xdr_stream *xdr, struct nfs4_getattr *getattr,
...
@@ -1494,7 +1494,7 @@ decode_getattr(struct xdr_stream *xdr, struct nfs4_getattr *getattr,
READ_BUF
(
dummy32
);
READ_BUF
(
dummy32
);
len
+=
(
XDR_QUADLEN
(
dummy32
)
<<
2
);
len
+=
(
XDR_QUADLEN
(
dummy32
)
<<
2
);
if
((
status
=
nfs_idmap_id
(
server
,
IDMAP_TYPE_GROUP
,
if
((
status
=
nfs_idmap_id
(
server
,
IDMAP_TYPE_GROUP
,
(
char
*
)
p
,
len
,
&
nfp
->
gid
))
==
-
1
)
{
(
char
*
)
p
,
dummy32
,
&
nfp
->
gid
))
==
-
1
)
{
dprintk
(
"read_attrs: gss_get_num failed!
\n
"
);
dprintk
(
"read_attrs: gss_get_num failed!
\n
"
);
nfp
->
gid
=
-
2
;
nfp
->
gid
=
-
2
;
/* goto out; */
/* goto out; */
...
...
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