summaryrefslogtreecommitdiff
path: root/internal/user/server
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2024-02-23 15:01:41 +0200
committerPaul Buetow <pbuetow@mimecast.com>2024-02-23 15:01:41 +0200
commita3e10757a52fa47a0608afd88986162ca5eb22cc (patch)
treedce61c6695bc3badd455a64767252e6947b32711 /internal/user/server
parent85780654df870dc4170b93a8ed5a5dbfa917fe5d (diff)
lint warnings
Diffstat (limited to 'internal/user/server')
-rw-r--r--internal/user/server/user.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/user/server/user.go b/internal/user/server/user.go
index abf74f3..d391672 100644
--- a/internal/user/server/user.go
+++ b/internal/user/server/user.go
@@ -81,7 +81,7 @@ func (u *User) HasFilePermission(filePath, permissionType string) (hasPermission
func (u *User) hasFilePermission(cleanPath, permissionType string) (bool, error) {
// First check file system Linux/UNIX permission.
if _, err := permissions.ToRead(u.Name, cleanPath); err != nil {
- return false, fmt.Errorf("User without OS file system permissions to read path: '%v'", err)
+ return false, fmt.Errorf("User without OS file system permissions to read path: %w", err)
}
dlog.Server.Info(u, cleanPath, permissionType,
"User with OS file system permissions to path")
@@ -89,7 +89,7 @@ func (u *User) hasFilePermission(cleanPath, permissionType string) (bool, error)
// Only allow to follow regular files or symlinks.
info, err := os.Lstat(cleanPath)
if err != nil {
- return false, fmt.Errorf("Unable to determine file type: '%v'", err)
+ return false, fmt.Errorf("Unable to determine file type: %w", err)
}
if !info.Mode().IsRegular() {
return false, fmt.Errorf("Can only open regular files or follow symlinks")
@@ -130,7 +130,7 @@ func (u *User) iteratePaths(cleanPath, permissionType string) (bool, error) {
re, err := regexp.Compile(regexStr)
if err != nil {
return false, fmt.Errorf("Permission test failed, can't compile regex "+
- "'%s': '%v'", regexStr, err)
+ "'%s': %w", regexStr, err)
}
if negate && re.MatchString(cleanPath) {
dlog.Server.Info(u, cleanPath, "Permission test failed partially, "+