Merge remote-tracking branch 'origin/portunus-fixes'
This commit is contained in:
commit
b68a325a3f
24
modules/ldap/0003-gecos-ascii-escape.patch
Normal file
24
modules/ldap/0003-gecos-ascii-escape.patch
Normal file
|
@ -0,0 +1,24 @@
|
|||
diff --git a/internal/core/user.go b/internal/core/user.go
|
||||
index e74ccfe..291c75b 100644
|
||||
--- a/internal/core/user.go
|
||||
+++ b/internal/core/user.go
|
||||
@@ -8,6 +8,7 @@ package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
+ "strconv"
|
||||
)
|
||||
|
||||
// User represents a single user account.
|
||||
@@ -86,9 +87,9 @@ func (u User) RenderToLDAP(suffix string, allGroups map[string]Group) LDAPObject
|
||||
obj.Attributes["loginShell"] = []string{u.POSIX.LoginShell}
|
||||
}
|
||||
if u.POSIX.GECOS == "" {
|
||||
- obj.Attributes["gecos"] = []string{u.FullName()}
|
||||
+ obj.Attributes["gecos"] = []string{strconv.QuoteToASCII(u.FullName())}
|
||||
} else {
|
||||
- obj.Attributes["gecos"] = []string{u.POSIX.GECOS}
|
||||
+ obj.Attributes["gecos"] = []string{strconv.QuoteToASCII(u.POSIX.GECOS)}
|
||||
}
|
||||
obj.Attributes["objectClass"] = append(obj.Attributes["objectClass"], "posixAccount")
|
||||
}
|
|
@ -59,6 +59,7 @@ in
|
|||
patches = [
|
||||
./0001-update-user-validation-regex.patch
|
||||
./0002-both-ldap-and-ldaps.patch
|
||||
./0003-gecos-ascii-escape.patch
|
||||
];
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue