aboutsummaryrefslogtreecommitdiff
path: root/files/usr/local/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'files/usr/local/libexec')
-rw-r--r--files/usr/local/libexec/idm-ssh-authorized-keys.common4
-rw-r--r--files/usr/local/libexec/idm-ssh-known-hosts.common4
2 files changed, 4 insertions, 4 deletions
diff --git a/files/usr/local/libexec/idm-ssh-authorized-keys.common b/files/usr/local/libexec/idm-ssh-authorized-keys.common
index d18b199..89d2f20 100644
--- a/files/usr/local/libexec/idm-ssh-authorized-keys.common
+++ b/files/usr/local/libexec/idm-ssh-authorized-keys.common
@@ -20,7 +20,7 @@ close($fh);
my $mech = $config{SASL_MECH} // 'GSSAPI';
my $uri = $config{URI} // quit('URI not specified');
-my $basedn = $config{BASE} // quit('BASE not specified');
+my $basedn = $config{USERS_BASE} // quit('USERS_BASE not specified');
@ARGV == 1 or die "usage: $0 USERNAME\n";
my $username = $ARGV[0];
@@ -32,7 +32,7 @@ $status->code and die "$0: ".$status->error;
my $search = $conn->search(
scope => 'sub',
- base => "ou=accounts,$basedn",
+ base => $basedn,
filter => '(&(objectClass=posixAccount)(sshPublicKey=*)(uid=' . escape_filter_value($username) . '))',
attrs => ['sshPublicKey']);
$search->code and die "$0: ".$search->error;
diff --git a/files/usr/local/libexec/idm-ssh-known-hosts.common b/files/usr/local/libexec/idm-ssh-known-hosts.common
index 78b48fc..5b784d6 100644
--- a/files/usr/local/libexec/idm-ssh-known-hosts.common
+++ b/files/usr/local/libexec/idm-ssh-known-hosts.common
@@ -31,7 +31,7 @@ close($fh);
my $mech = $config{SASL_MECH} // 'GSSAPI';
my $uri = $config{URI} // quit('URI not specified');
-my $basedn = $config{BASE} // quit('BASE not specified');
+my $basedn = $config{HOSTS_BASE} // quit('HOSTS_BASE not specified');
my $conn = Net::LDAP->new($uri, version => '3') or quit($@);
my $sasl = Authen::SASL->new($mech);
@@ -40,7 +40,7 @@ $status->code and quit($status->error);
my $search = $conn->search(
scope => 'sub',
- base => "ou=hosts,ou=accounts,$basedn",
+ base => $basedn,
filter => '(&(sshPublicKey=*)(associatedDomain=' . escape_filter_value($hostname) . '))',
attrs => ['sshPublicKey']);
$search->code and quit($search->error);