@@ -60,9 +60,10 @@ impl fuse::FuseHandlers for TestFS {
60
60
) {
61
61
self . requests . send ( format ! ( "{:#?}" , request) ) . unwrap ( ) ;
62
62
63
- let xattr_small = fuse:: XattrName :: from_bytes ( b"xattr_small" ) . unwrap ( ) ;
63
+ let xattr_small =
64
+ fuse:: XattrName :: from_bytes ( b"user.xattr_small" ) . unwrap ( ) ;
64
65
let xattr_toobig =
65
- fuse:: XattrName :: from_bytes ( b"xattr_toobig" ) . unwrap ( ) ;
66
+ fuse:: XattrName :: from_bytes ( b"user. xattr_toobig" ) . unwrap ( ) ;
66
67
67
68
if request. name ( ) == xattr_small {
68
69
let mut resp = fuse:: GetxattrResponse :: new ( request. size ( ) ) ;
@@ -104,10 +105,10 @@ fn getxattr_test(
104
105
fn getxattr_query_size ( ) {
105
106
let requests = getxattr_test ( |root| {
106
107
let path = path_cstr ( root. join ( "xattrs.txt" ) ) ;
107
- let xattr_name = ffi:: CString :: new ( "xattr_small" ) . unwrap ( ) ;
108
108
109
109
#[ cfg( target_os = "linux" ) ]
110
110
let rc = unsafe {
111
+ let xattr_name = ffi:: CString :: new ( "user.xattr_small" ) . unwrap ( ) ;
111
112
libc:: getxattr (
112
113
path. as_ptr ( ) ,
113
114
xattr_name. as_ptr ( ) ,
@@ -118,6 +119,7 @@ fn getxattr_query_size() {
118
119
119
120
#[ cfg( target_os = "freebsd" ) ]
120
121
let rc = unsafe {
122
+ let xattr_name = ffi:: CString :: new ( "xattr_small" ) . unwrap ( ) ;
121
123
libc:: extattr_get_file (
122
124
path. as_ptr ( ) ,
123
125
libc:: EXTATTR_NAMESPACE_USER ,
@@ -134,7 +136,7 @@ fn getxattr_query_size() {
134
136
let expect = r#"GetxattrRequest {
135
137
node_id: 2,
136
138
size: None,
137
- name: "xattr_small",
139
+ name: "user. xattr_small",
138
140
}"# ;
139
141
if let Some ( diff) = diff_str ( expect, & requests[ 0 ] ) {
140
142
println ! ( "{}" , diff) ;
@@ -146,12 +148,12 @@ fn getxattr_query_size() {
146
148
fn getxattr_small ( ) {
147
149
let requests = getxattr_test ( |root| {
148
150
let path = path_cstr ( root. join ( "xattrs.txt" ) ) ;
149
- let xattr_name = ffi:: CString :: new ( "xattr_small" ) . unwrap ( ) ;
150
151
151
152
let mut value = [ 0u8 ; 20 ] ;
152
153
153
154
#[ cfg( target_os = "linux" ) ]
154
155
let rc = unsafe {
156
+ let xattr_name = ffi:: CString :: new ( "user.xattr_small" ) . unwrap ( ) ;
155
157
libc:: getxattr (
156
158
path. as_ptr ( ) ,
157
159
xattr_name. as_ptr ( ) ,
@@ -162,6 +164,7 @@ fn getxattr_small() {
162
164
163
165
#[ cfg( target_os = "freebsd" ) ]
164
166
let rc = unsafe {
167
+ let xattr_name = ffi:: CString :: new ( "xattr_small" ) . unwrap ( ) ;
165
168
libc:: extattr_get_file (
166
169
path. as_ptr ( ) ,
167
170
libc:: EXTATTR_NAMESPACE_USER ,
@@ -179,7 +182,7 @@ fn getxattr_small() {
179
182
let expect = r#"GetxattrRequest {
180
183
node_id: 2,
181
184
size: Some(20),
182
- name: "xattr_small",
185
+ name: "user. xattr_small",
183
186
}"# ;
184
187
if let Some ( diff) = diff_str ( expect, & requests[ 0 ] ) {
185
188
println ! ( "{}" , diff) ;
@@ -191,10 +194,10 @@ fn getxattr_small() {
191
194
fn getxattr_noexist ( ) {
192
195
let requests = getxattr_test ( |root| {
193
196
let path = path_cstr ( root. join ( "xattrs.txt" ) ) ;
194
- let xattr_name = ffi:: CString :: new ( "xattr_noexist" ) . unwrap ( ) ;
195
197
196
198
#[ cfg( target_os = "linux" ) ]
197
199
let rc = unsafe {
200
+ let xattr_name = ffi:: CString :: new ( "user.xattr_noexist" ) . unwrap ( ) ;
198
201
libc:: getxattr (
199
202
path. as_ptr ( ) ,
200
203
xattr_name. as_ptr ( ) ,
@@ -205,6 +208,7 @@ fn getxattr_noexist() {
205
208
206
209
#[ cfg( target_os = "freebsd" ) ]
207
210
let rc = unsafe {
211
+ let xattr_name = ffi:: CString :: new ( "xattr_noexist" ) . unwrap ( ) ;
208
212
libc:: extattr_get_file (
209
213
path. as_ptr ( ) ,
210
214
libc:: EXTATTR_NAMESPACE_USER ,
@@ -224,7 +228,7 @@ fn getxattr_noexist() {
224
228
let expect = r#"GetxattrRequest {
225
229
node_id: 2,
226
230
size: None,
227
- name: "xattr_noexist",
231
+ name: "user. xattr_noexist",
228
232
}"# ;
229
233
if let Some ( diff) = diff_str ( expect, & requests[ 0 ] ) {
230
234
println ! ( "{}" , diff) ;
@@ -236,12 +240,12 @@ fn getxattr_noexist() {
236
240
fn getxattr_buffer_too_small ( ) {
237
241
let requests = getxattr_test ( |root| {
238
242
let path = path_cstr ( root. join ( "xattrs.txt" ) ) ;
239
- let xattr_name = ffi:: CString :: new ( "xattr_small" ) . unwrap ( ) ;
240
243
241
244
let mut value = [ 0u8 ; 1 ] ;
242
245
243
246
#[ cfg( target_os = "linux" ) ]
244
247
let rc = unsafe {
248
+ let xattr_name = ffi:: CString :: new ( "user.xattr_small" ) . unwrap ( ) ;
245
249
libc:: getxattr (
246
250
path. as_ptr ( ) ,
247
251
xattr_name. as_ptr ( ) ,
@@ -252,6 +256,7 @@ fn getxattr_buffer_too_small() {
252
256
253
257
#[ cfg( target_os = "freebsd" ) ]
254
258
let rc = unsafe {
259
+ let xattr_name = ffi:: CString :: new ( "xattr_small" ) . unwrap ( ) ;
255
260
libc:: extattr_get_file (
256
261
path. as_ptr ( ) ,
257
262
libc:: EXTATTR_NAMESPACE_USER ,
@@ -269,7 +274,7 @@ fn getxattr_buffer_too_small() {
269
274
let expect = r#"GetxattrRequest {
270
275
node_id: 2,
271
276
size: Some(1),
272
- name: "xattr_small",
277
+ name: "user. xattr_small",
273
278
}"# ;
274
279
if let Some ( diff) = diff_str ( expect, & requests[ 0 ] ) {
275
280
println ! ( "{}" , diff) ;
@@ -281,12 +286,12 @@ fn getxattr_buffer_too_small() {
281
286
fn getxattr_oversize_xattr ( ) {
282
287
let requests = getxattr_test ( |root| {
283
288
let path = path_cstr ( root. join ( "xattrs.txt" ) ) ;
284
- let xattr_name = ffi:: CString :: new ( "xattr_toobig" ) . unwrap ( ) ;
285
289
286
290
let mut value = [ 0u8 ; 32 ] ;
287
291
288
292
#[ cfg( target_os = "linux" ) ]
289
293
let rc = unsafe {
294
+ let xattr_name = ffi:: CString :: new ( "user.xattr_toobig" ) . unwrap ( ) ;
290
295
libc:: getxattr (
291
296
path. as_ptr ( ) ,
292
297
xattr_name. as_ptr ( ) ,
@@ -297,6 +302,7 @@ fn getxattr_oversize_xattr() {
297
302
298
303
#[ cfg( target_os = "freebsd" ) ]
299
304
let rc = unsafe {
305
+ let xattr_name = ffi:: CString :: new ( "xattr_toobig" ) . unwrap ( ) ;
300
306
libc:: extattr_get_file (
301
307
path. as_ptr ( ) ,
302
308
libc:: EXTATTR_NAMESPACE_USER ,
@@ -314,7 +320,7 @@ fn getxattr_oversize_xattr() {
314
320
let expect = r#"GetxattrRequest {
315
321
node_id: 2,
316
322
size: Some(32),
317
- name: "xattr_toobig",
323
+ name: "user. xattr_toobig",
318
324
}"# ;
319
325
if let Some ( diff) = diff_str ( expect, & requests[ 0 ] ) {
320
326
println ! ( "{}" , diff) ;
0 commit comments