Skip to content

[Bug]: User's Root Directory isn't correct in the UI when using a group to control the root directory #2049

@scrollsaw

Description

@scrollsaw

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration issue.
  • This issue is not already reported on Github (I've searched it).

Bug description

When configuring a user to use a group's Root Directory (ex D:\FTP\INBOUND%username%), the user's Root Directory textbox incorrectly shows the server default root directory instead of the group specified root directory.

This is confusing to admins because: when you log in to the FTP as the user, it uses the correct group specified root directory and things work as they should.

Seems like just a display/UI issue.

Using Windows Server 2022 and SFTPGO 2.6.6

Steps to reproduce

  1. Clean install of SFTPGO 2.6.6 on Windows Server 2022
  2. Set the default user base dir in sftpgo.json: (ex "users_base_dir": "D:\FTP")
  3. (If you don't set this, then you can't leave the user's root directory blank below)
  4. Restart the service.
  5. Create a group, set the storage to local and specify the root directory (ex D:\FTP\INBOUND%username%).
  6. The other group settings are default
  7. Create a user (ex: myUser) with default settings and set the Primary Group to the group you made above.
  8. Leave the Storage to Local Disk and the Root directory blank.
  9. Save the user to create it.
  10. If you now edit the user, you'll see that the Root directory is set to D:\FTP\myUser (the server default) instead of the group specified Root directory.
  11. But if you log on to the sftp server with that user, it will create and use the correct group specified directory (D:\FTP\INBOUND\myUser)

Expected behavior

I would expect the UI to show the group specified root directory when looking at the user settings.

SFTPGo version

sftpgo_v2.6.6_windows_x86_64

Data provider

sqlite

Installation method

Other

Configuration

the only change from default is:

"users_base_dir": "D:\FTP",

Relevant log output

What are you using SFTPGo for?

Medium business

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions