X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/180d654463687e84270ade218e65d97356c58551..b129b7cbc9fd9a9c11a77e5922861ef08893efa1:/hotline/server.go?ds=inline diff --git a/hotline/server.go b/hotline/server.go index a77e792..78b7a37 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -283,7 +283,7 @@ func NewServer(configDir, netInterface string, netPort int, logger *zap.SugaredL for { tr := &TrackerRegistration{ UserCount: server.userCount(), - PassID: server.TrackerPassID[:], + PassID: server.TrackerPassID, Name: server.Config.Name, Description: server.Config.Description, } @@ -447,11 +447,12 @@ func (s *Server) UpdateUser(login, newLogin, name, password string, access acces // update renames the user login if login != newLogin { - err := os.Rename(filepath.Join(s.ConfigDir, "Users", login+".yaml"), filepath.Join(s.ConfigDir, "Users", newLogin+".yaml")) + err := os.Rename(filepath.Join(s.ConfigDir, "Users", path.Join("/", login)+".yaml"), filepath.Join(s.ConfigDir, "Users", path.Join("/", newLogin)+".yaml")) if err != nil { - return err + return fmt.Errorf("unable to rename account: %w", err) } s.Accounts[newLogin] = s.Accounts[login] + s.Accounts[newLogin].Login = newLogin delete(s.Accounts, login) }