Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai3
accountserver
Commits
3d998e63
Commit
3d998e63
authored
Jun 29, 2019
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set gidNumber on generated LDAP objects
parent
c97fb450
Pipeline
#3646
passed with stages
in 4 minutes and 47 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
backend/ldap/model.go
backend/ldap/model.go
+2
-0
backend/ldap/resources.go
backend/ldap/resources.go
+5
-1
No files found.
backend/ldap/model.go
View file @
3d998e63
...
...
@@ -29,6 +29,7 @@ const (
passwordLastChangeLDAPAttr
=
"shadowLastChange"
u2fRegistrationsLDAPAttr
=
"u2fRegistration"
uidNumberLDAPAttr
=
"uidNumber"
gidNumberLDAPAttr
=
"gidNumber"
)
// Interface to something that adds Resources to a User.
...
...
@@ -164,6 +165,7 @@ func userToLDAP(user *as.User) (attrs []ldap.PartialAttribute) {
{
Type
:
"uid"
,
Vals
:
s2l
(
user
.
Name
)},
{
Type
:
"cn"
,
Vals
:
s2l
(
user
.
Name
)},
{
Type
:
uidNumberLDAPAttr
,
Vals
:
s2l
(
strconv
.
Itoa
(
user
.
UID
))},
{
Type
:
gidNumberLDAPAttr
,
Vals
:
s2l
(
"2000"
)},
{
Type
:
"givenName"
,
Vals
:
s2l
(
"Private"
)},
{
Type
:
"sn"
,
Vals
:
s2l
(
"Private"
)},
{
Type
:
"gecos"
,
Vals
:
s2l
(
user
.
Name
)},
...
...
backend/ldap/resources.go
View file @
3d998e63
...
...
@@ -373,10 +373,14 @@ func (h *webdavResourceHandler) FromLDAP(entry *ldap.Entry) (*as.Resource, error
func
(
h
*
webdavResourceHandler
)
ToLDAP
(
rsrc
*
as
.
Resource
)
[]
ldap
.
PartialAttribute
{
return
[]
ldap
.
PartialAttribute
{
{
Type
:
"objectClass"
,
Vals
:
[]
string
{
"top"
,
"person"
,
"posixAccount"
,
"shadowAccount"
,
"organizationalPerson"
,
"inetOrgPerson"
,
"ftpAccount"
}},
{
Type
:
"objectClass"
,
Vals
:
[]
string
{
"top"
,
"person"
,
"posixAccount"
,
"shadowAccount"
,
"ftpAccount"
}},
{
Type
:
"ftpname"
,
Vals
:
s2l
(
rsrc
.
Name
)},
{
Type
:
"homeDirectory"
,
Vals
:
s2l
(
rsrc
.
DAV
.
Homedir
)},
{
Type
:
uidNumberLDAPAttr
,
Vals
:
s2l
(
strconv
.
Itoa
(
rsrc
.
DAV
.
UID
))},
{
Type
:
gidNumberLDAPAttr
,
Vals
:
s2l
(
"2000"
)},
{
Type
:
"uid"
,
Vals
:
s2l
(
rsrc
.
Name
)},
{
Type
:
"cn"
,
Vals
:
s2l
(
rsrc
.
Name
)},
{
Type
:
"sn"
,
Vals
:
s2l
(
"Private"
)},
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment