summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--API.txt3
-rw-r--r--VERSION4
-rw-r--r--ipalib/plugins/passwd.py11
3 files changed, 14 insertions, 4 deletions
diff --git a/API.txt b/API.txt
index fdb780d53..7466930fb 100644
--- a/API.txt
+++ b/API.txt
@@ -2409,10 +2409,11 @@ output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDA
output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
output: PrimaryKey('value', None, None)
command: passwd
-args: 3,1,3
+args: 3,2,3
arg: Str('principal', autofill=True, cli_name='user', primary_key=True)
arg: Password('password')
arg: Password('current_password', autofill=True, confirm=False)
+option: Password('otp?', confirm=False)
option: Str('version?', exclude='webui')
output: Output('result', <type 'bool'>, None)
output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
diff --git a/VERSION b/VERSION
index 65e527350..a61848d62 100644
--- a/VERSION
+++ b/VERSION
@@ -89,5 +89,5 @@ IPA_DATA_VERSION=20100614120000
# #
########################################################
IPA_API_VERSION_MAJOR=2
-IPA_API_VERSION_MINOR=93
-# Last change: mbasti - New record type added: DLV
+IPA_API_VERSION_MINOR=94
+# Last change: pvoborni - Add OTP option to passwd command
diff --git a/ipalib/plugins/passwd.py b/ipalib/plugins/passwd.py
index 95b9b6017..f5fc14d51 100644
--- a/ipalib/plugins/passwd.py
+++ b/ipalib/plugins/passwd.py
@@ -89,6 +89,14 @@ class passwd(Command):
),
)
+ takes_options = (
+ Password('otp?',
+ label=_('OTP'),
+ doc=_('One Time Password'),
+ confirm=False,
+ ),
+ )
+
has_output = output.standard_value
msg_summary = _('Changed password for "%(value)s"')
@@ -121,7 +129,8 @@ class passwd(Command):
if current_password == MAGIC_VALUE:
ldap.modify_password(entry_attrs.dn, password)
else:
- ldap.modify_password(entry_attrs.dn, password, current_password)
+ otp = options.get('otp')
+ ldap.modify_password(entry_attrs.dn, password, current_password, otp)
return dict(
result=True,