Fix service user

This commit is contained in:
Benedikt Kulmann
2020-10-14 10:50:39 +02:00
committed by A.Unger
parent 629561833a
commit d578a2603a
2 changed files with 3 additions and 1 deletions

View File

@@ -87,7 +87,7 @@ func (s Service) hasAccountManagementPermissions(ctx context.Context) bool {
// serviceUserToIndex temporarily adds a service user to the index, which is supposed to be removed before the lock on the handler function is released
func (s Service) serviceUserToIndex() (teardownServiceUser func()) {
if s.Config.ServiceUser.Username != "" && s.Config.ServiceUser.UUID != "" {
err := s.index.Add(s.getInMemoryServiceUser())
_, err := s.index.Add(s.getInMemoryServiceUser())
if err != nil {
s.log.Logger.Err(err).Msg("service user was configured but failed to be added to the index")
} else {

View File

@@ -236,6 +236,7 @@ func (s Service) createDefaultAccounts() (err error) {
}
}
// TODO: can be removed again as soon as we respect the predefined UIDs and GIDs from the account. Then no autoincrement is happening, therefore we don't need to update accounts.
changed := false
for _, r := range results {
if r.Field == "UidNumber" || r.Field == "GidNumber" {
@@ -324,6 +325,7 @@ func (s Service) createDefaultGroups() (err error) {
}
}
// TODO: can be removed again as soon as we respect the predefined GIDs from the group. Then no autoincrement is happening, therefore we don't need to update groups.
for _, r := range results {
if r.Field == "GidNumber" {
gid, err := strconv.ParseInt(path.Base(r.Value), 10, 0)