24 #include <linux/slab.h>
25 #include <linux/xattr.h>
32 #define MAX_EA_VALUE_SIZE 65535
33 #define CIFS_XATTR_DOS_ATTRIB "user.DosAttrib"
34 #define CIFS_XATTR_CIFS_ACL "system.cifs_acl"
41 #ifdef CONFIG_CIFS_XATTR
47 char *full_path =
NULL;
57 cifs_sb = CIFS_SB(sb);
60 return PTR_ERR(tlink);
61 pTcon = tlink_tcon(tlink);
66 if (full_path ==
NULL) {
70 if (ea_name ==
NULL) {
71 cFYI(1,
"Null xattr names not supported");
75 "illegal xattr request %s (only user namespace supported)",
101 #ifdef CONFIG_CIFS_XATTR
109 if (direntry ==
NULL)
117 cifs_sb = CIFS_SB(sb);
120 return PTR_ERR(tlink);
121 pTcon = tlink_tcon(tlink);
126 if (full_path ==
NULL) {
137 cFYI(1,
"size of EA value too large");
142 if (ea_name ==
NULL) {
143 cFYI(1,
"Null xattr names not supported");
149 cFYI(1,
"attempt to set cifs inode metadata");
152 rc =
CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
161 rc =
CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
166 #ifdef CONFIG_CIFS_ACL
170 cFYI(1,
"%s: Can't allocate memory for ACL",
174 memcpy(pacl, ea_value, value_size);
178 CIFS_I(direntry->
d_inode)->time = 0;
182 cFYI(1,
"Set CIFS ACL not supported yet");
189 #ifdef CONFIG_CIFS_POSIX
192 ea_value, (
const int)value_size,
196 cFYI(1,
"set POSIX ACL rc %d", rc);
198 cFYI(1,
"set POSIX ACL not supported");
202 #ifdef CONFIG_CIFS_POSIX
205 ea_value, (
const int)value_size,
209 cFYI(1,
"set POSIX default ACL rc %d", rc);
211 cFYI(1,
"set default POSIX ACL not supported");
214 cFYI(1,
"illegal xattr request %s (only user namespace"
215 " supported)", ea_name);
234 #ifdef CONFIG_CIFS_XATTR
242 if (direntry ==
NULL)
250 cifs_sb = CIFS_SB(sb);
253 return PTR_ERR(tlink);
254 pTcon = tlink_tcon(tlink);
259 if (full_path ==
NULL) {
265 if (ea_name ==
NULL) {
266 cFYI(1,
"Null xattr names not supported");
273 cFYI(1,
"attempt to query cifs inode metadata");
290 #ifdef CONFIG_CIFS_POSIX
298 cFYI(1,
"Query POSIX ACL not supported yet");
302 #ifdef CONFIG_CIFS_POSIX
310 cFYI(1,
"Query POSIX default ACL not supported yet");
314 #ifdef CONFIG_CIFS_ACL
322 cERROR(1,
"%s: error %zd getting sec desc",
326 if (acllen > buf_size)
329 memcpy(ea_value, pacl, acllen);
335 cFYI(1,
"Query CIFS ACL not supported yet");
339 cFYI(1,
"Trusted xattr namespace not supported yet");
342 cFYI(1,
"Security xattr namespace not supported yet");
345 "illegal xattr request %s (only user namespace supported)",
367 #ifdef CONFIG_CIFS_XATTR
375 if (direntry ==
NULL)
383 cifs_sb = CIFS_SB(sb);
389 return PTR_ERR(tlink);
390 pTcon = tlink_tcon(tlink);
395 if (full_path ==
NULL) {