Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
2caabff5
Commit
2caabff5
authored
May 24, 2017
by
Côme Chilliet
Browse files
Fixes
#5538
Fixed parsing of winstation DN when it’s not in systems RDN
parent
f7915f98
Changes
1
Hide whitespace changes
Inline
Side-by-side
contrib/bin/fusiondirectory-setup
View file @
2caabff5
...
...
@@ -95,6 +95,7 @@ my $systemrdn = "ou=systems";
my
$dnsrdn
=
"
ou=dns
";
my
$dhcprdn
=
"
ou=dhcp
";
my
$workstationrdn
=
"
ou=workstations,ou=systems
";
my
$winstationrdn
=
"
ou=computers,ou=systems
";
#################################################################################################################################################
...
...
@@ -1486,8 +1487,16 @@ sub migrate_winstations
$entry
->
replace
('
cn
'
=>
$cn
);
my
$newrdn
=
"
cn=
"
.
$cn
;
my
$dn_old
=
$entry
->
dn
();
$dn_old
=~
m/^[^,]+,.*$systemrdn,(.+)$/
or
die
"
Could not parse dn
"
.
$dn_old
.
"
\n
";
my
$entrybase
=
$
1
;
my
$entrybase
;
if
(
$dn_old
=~
m/^[^,]+,$winstationrdn,(.+)$/
)
{
$entrybase
=
$
1
;
}
elsif
(
$dn_old
=~
m/^[^,]+,.*$systemrdn,(.+)$/
)
{
$entrybase
=
$
1
;
}
elsif
(
$dn_old
=~
m/^[^,]+,.*$winstationrdn,(.+)$/
)
{
$entrybase
=
$
1
;
}
else
{
die
"
Could not parse dn
"
.
$dn_old
.
"
\n
";
}
if
(
!
branch_exists
(
$ldap
,
"
$workstationrdn
,
$entrybase
"))
{
if
(
$workstationrdn
=~
m/^([^,]+),([^,]+)$/
)
{
if
(
!
branch_exists
(
$ldap
,
"
$2,
$entrybase
"))
{
...
...
@@ -1737,6 +1746,9 @@ sub read_ldap_config {
if
((
$mesg
->
entries
)[
0
]
->
exists
('
fdWorkstationRDN
'))
{
$workstationrdn
=
(
$mesg
->
entries
)[
0
]
->
get_value
('
fdWorkstationRDN
');
}
if
((
$mesg
->
entries
)[
0
]
->
exists
('
fdSambaMachineAccountRDN
'))
{
$winstationrdn
=
(
$mesg
->
entries
)[
0
]
->
get_value
('
fdSambaMachineAccountRDN
');
}
}
return
(
$mesg
->
entries
)[
0
];
...
...
Write
Preview
Supports
Markdown
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