Add a flag to force a password prompt, so you can override credentials
from your cached shelldap.rc. FossilOrigin-Name: 332b1f1f7a0f7f933e56a3c83b8668017a3ec1ae7dcb72b34fc4548e176c486d
This commit is contained in:
parent
6e5ffd5d70
commit
f89ceae24e
1 changed files with 14 additions and 4 deletions
18
shelldap
18
shelldap
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
# vim: set nosta noet ts=4 sw=4:
|
# vim: set nosta noet ts=4 sw=4:
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006-2011, Mahlon E. Smith <mahlon@martini.nu>
|
# Copyright (c) 2006-2012, Mahlon E. Smith <mahlon@martini.nu>
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
# modification, are permitted provided that the following conditions are met:
|
# modification, are permitted provided that the following conditions are met:
|
||||||
|
|
@ -120,7 +120,16 @@ try and ask the server for a sane default.
|
||||||
|
|
||||||
=over 4
|
=over 4
|
||||||
|
|
||||||
=item B< tls>
|
=item B<promptpass>
|
||||||
|
|
||||||
|
Force password prompting. Useful to temporarily override cached
|
||||||
|
credentials.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=over 4
|
||||||
|
|
||||||
|
=item B<tls>
|
||||||
|
|
||||||
Enables TLS over what would normally be an insecure connection.
|
Enables TLS over what would normally be an insecure connection.
|
||||||
Requires server side support.
|
Requires server side support.
|
||||||
|
|
@ -463,7 +472,7 @@ sub ldap
|
||||||
You may try connecting insecurely, or install the module and try again.\n} if $@;
|
You may try connecting insecurely, or install the module and try again.\n} if $@;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $conf->{'binddn'} && ! $conf->{'bindpass'} ) {
|
if ( ($conf->{'binddn'} && ! $conf->{'bindpass'}) || $conf->{'promptpass'} ) {
|
||||||
print "Bind password: ";
|
print "Bind password: ";
|
||||||
Term::ReadKey::ReadMode 2;
|
Term::ReadKey::ReadMode 2;
|
||||||
chomp($conf->{'bindpass'} = <STDIN>);
|
chomp($conf->{'bindpass'} = <STDIN>);
|
||||||
|
|
@ -1732,7 +1741,7 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
$0 = 'shelldap';
|
$0 = 'shelldap';
|
||||||
my $VERSION = '0.5';
|
my $VERSION = '0.6';
|
||||||
|
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use YAML::Syck;
|
use YAML::Syck;
|
||||||
|
|
@ -1750,6 +1759,7 @@ Getopt::Long::GetOptions(
|
||||||
'binddn|D=s',
|
'binddn|D=s',
|
||||||
'basedn|b=s',
|
'basedn|b=s',
|
||||||
'cacheage=i',
|
'cacheage=i',
|
||||||
|
'promptpass|W',
|
||||||
'timeout=i',
|
'timeout=i',
|
||||||
'tls_cacert=s',
|
'tls_cacert=s',
|
||||||
'tls_cert=s',
|
'tls_cert=s',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue