mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-09 16:25:15 +03:00
sftpd test: add a debug log
The git push test sometime fails when running on travis. The issue cannot be replicated locally so print the logs to try to understand what is happening
This commit is contained in:
@@ -353,6 +353,9 @@ func buildUserHomeDir(user *User) {
|
||||
}
|
||||
|
||||
func validatePermissions(user *User) error {
|
||||
if len(user.Permissions) == 0 {
|
||||
return &ValidationError{err: "Please grant some permissions to this user"}
|
||||
}
|
||||
permissions := make(map[string][]string)
|
||||
if _, ok := user.Permissions["/"]; !ok {
|
||||
return &ValidationError{err: fmt.Sprintf("Permissions for the root dir \"/\" must be set")}
|
||||
@@ -391,9 +394,6 @@ func validateUser(user *User) error {
|
||||
if len(user.Password) == 0 && len(user.PublicKeys) == 0 {
|
||||
return &ValidationError{err: "Please set a password or at least a public_key"}
|
||||
}
|
||||
if len(user.Permissions) == 0 {
|
||||
return &ValidationError{err: "Please grant some permissions to this user"}
|
||||
}
|
||||
if !filepath.IsAbs(user.HomeDir) {
|
||||
return &ValidationError{err: fmt.Sprintf("home_dir must be an absolute path, actual value: %v", user.HomeDir)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user