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
7a1f6754
Commit
7a1f6754
authored
20 years ago
by
Steve French
Committed by
Steve French
20 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CIFS] xattr support for cifs filesystem part 5 of 5, add removexattr capability
Signed-off-by: Steve French (sfrench@us.ibm.com)
parent
486326cf
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
2 deletions
+66
-2
fs/Kconfig
fs/Kconfig
+16
-0
fs/cifs/CHANGES
fs/cifs/CHANGES
+5
-0
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+2
-1
fs/cifs/xattr.c
fs/cifs/xattr.c
+43
-1
No files found.
fs/Kconfig
View file @
7a1f6754
...
...
@@ -1652,6 +1652,22 @@ config CIFS_STATS
Enabling this option will cause statistics for each server share
mounted by the cifs client to be displayed in /proc/fs/cifs/Stats
config CIFS_XATTR
bool "CIFS extended attributes (EXPERIMENTAL)"
depends on CIFS
help
Extended attributes are name:value pairs associated with inodes by
the kernel or by users (see the attr(5) manual page, or visit
<http://acl.bestbits.at/> for details). CIFS maps the name of
extended attributes beginning with the user namespace prefix
to SMB/CIFS EAs. EAs are stored on Windows servers without the
user namespace prefix, but their names are seen by Linux cifs clients
prefaced by the user namespace prefix. The system namespace
(used by some filesystems to store ACLs) is not supported at
this time.
If unsure, say N.
config CIFS_POSIX
bool "CIFS POSIX Extensions (EXPERIMENTAL)"
depends on CIFS
...
...
This diff is collapsed.
Click to expand it.
fs/cifs/CHANGES
View file @
7a1f6754
Version 1.22
------------
Add config option to enable XATTR (extended attribute) support, mapping
xattr names in the "user." namespace space to SMB/CIFS EAs.
Version 1.21
------------
Add new mount parm to control whether mode check (vfs_permission) is done on
...
...
This diff is collapsed.
Click to expand it.
fs/cifs/cifssmb.c
View file @
7a1f6754
...
...
@@ -3370,7 +3370,8 @@ CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon, const char *fileName,
/*BB add length check that it would fit in negotiated SMB buffer size BB */
/* if(ea_value_len > buffer_size - 512 (enough for header)) */
memcpy
(
parm_data
->
list
[
0
].
name
+
name_len
+
1
,
ea_value
,
ea_value_len
);
if
(
ea_value_len
)
memcpy
(
parm_data
->
list
[
0
].
name
+
name_len
+
1
,
ea_value
,
ea_value_len
);
pSMB
->
TotalDataCount
=
pSMB
->
DataCount
;
pSMB
->
ParameterCount
=
cpu_to_le16
(
pSMB
->
ParameterCount
);
...
...
This diff is collapsed.
Click to expand it.
fs/cifs/xattr.c
View file @
7a1f6754
...
...
@@ -34,9 +34,51 @@
/* also note could add check for security prefix XATTR_SECURITY_PREFIX */
int
cifs_removexattr
(
struct
dentry
*
direntry
,
const
char
*
name
)
int
cifs_removexattr
(
struct
dentry
*
direntry
,
const
char
*
ea_
name
)
{
int
rc
=
-
EOPNOTSUPP
;
#ifdef CONFIG_CIFS_XATTR
int
xid
;
struct
cifs_sb_info
*
cifs_sb
;
struct
cifsTconInfo
*
pTcon
;
struct
super_block
*
sb
;
char
*
full_path
;
if
(
direntry
==
NULL
)
return
-
EIO
;
if
(
direntry
->
d_inode
==
NULL
)
return
-
EIO
;
sb
=
direntry
->
d_inode
->
i_sb
;
if
(
sb
==
NULL
)
return
-
EIO
;
xid
=
GetXid
();
cifs_sb
=
CIFS_SB
(
sb
);
pTcon
=
cifs_sb
->
tcon
;
down
(
&
sb
->
s_vfs_rename_sem
);
full_path
=
build_path_from_dentry
(
direntry
);
up
(
&
sb
->
s_vfs_rename_sem
);
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
return
-
ENOMEM
;
}
if
(
ea_name
==
NULL
)
{
cFYI
(
1
,(
"Null xattr names not supported"
));
}
else
if
(
strncmp
(
ea_name
,
CIFS_XATTR_USER_PREFIX
,
5
))
{
cFYI
(
1
,(
"illegal xattr namespace %s (only user namespace supported)"
,
ea_name
));
/* BB what if no namespace prefix? */
/* Should we just pass them to server, except for
system and perhaps security prefixes? */
}
else
{
ea_name
+=
5
;
/* skip past user. prefix */
rc
=
CIFSSMBSetEA
(
xid
,
pTcon
,
full_path
,
ea_name
,
0
,
(
__u16
)
0
,
cifs_sb
->
local_nls
);
}
if
(
full_path
)
kfree
(
full_path
);
FreeXid
(
xid
);
#endif
return
rc
;
}
...
...
This diff is collapsed.
Click to expand it.
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