Initial commit
Proof-of-concept implementation. Bugs will occur.
This commit is contained in:
10
vendor/github.com/hanwen/go-fuse/v2/internal/xattr/constants_linux.go
generated
vendored
Normal file
10
vendor/github.com/hanwen/go-fuse/v2/internal/xattr/constants_linux.go
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
// Copyright 2024 the Go-FUSE Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package xattr
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
// ENOATTR indicates that an extended attribute was not present.
|
||||
const ENOATTR = unix.ENODATA
|
||||
11
vendor/github.com/hanwen/go-fuse/v2/internal/xattr/constants_unix.go
generated
vendored
Normal file
11
vendor/github.com/hanwen/go-fuse/v2/internal/xattr/constants_unix.go
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
//go:build !linux
|
||||
|
||||
// Copyright 2024 the Go-FUSE Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package xattr
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
const ENOATTR = unix.ENOATTR
|
||||
9
vendor/github.com/hanwen/go-fuse/v2/internal/xattr/xattr.go
generated
vendored
Normal file
9
vendor/github.com/hanwen/go-fuse/v2/internal/xattr/xattr.go
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Copyright 2024 the Go-FUSE Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package xattr
|
||||
|
||||
func ParseAttrNames(buf []byte) [][]byte {
|
||||
return parseAttrNames(buf)
|
||||
}
|
||||
20
vendor/github.com/hanwen/go-fuse/v2/internal/xattr/xattr_freebsd.go
generated
vendored
Normal file
20
vendor/github.com/hanwen/go-fuse/v2/internal/xattr/xattr_freebsd.go
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2024 the Go-FUSE Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package xattr
|
||||
|
||||
// BSDs syscall use different convention of data buf retrieved
|
||||
// through syscall `unix.Listxattr`.
|
||||
// Ref: extattr_list_file(2)
|
||||
func parseAttrNames(buf []byte) [][]byte {
|
||||
var attrList [][]byte
|
||||
for p := 0; p < len(buf); {
|
||||
attrNameLen := int(buf[p])
|
||||
p++
|
||||
attrName := buf[p : p+attrNameLen]
|
||||
attrList = append(attrList, attrName)
|
||||
p += attrNameLen
|
||||
}
|
||||
return attrList
|
||||
}
|
||||
13
vendor/github.com/hanwen/go-fuse/v2/internal/xattr/xattr_unix.go
generated
vendored
Normal file
13
vendor/github.com/hanwen/go-fuse/v2/internal/xattr/xattr_unix.go
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
//go:build !freebsd
|
||||
|
||||
// Copyright 2024 the Go-FUSE Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package xattr
|
||||
|
||||
import "bytes"
|
||||
|
||||
func parseAttrNames(buf []byte) [][]byte {
|
||||
return bytes.Split(buf, []byte{0})
|
||||
}
|
||||
Reference in New Issue
Block a user