Bug 1508581 - modutil prompts for old password when -newpwfile <(echo) -force is passed to set blank password
Summary: modutil prompts for old password when -newpwfile <(echo) -force is passed to ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nss
Version: 7.5
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Daiki Ueno
QA Contact: Hubert Kario
URL:
Whiteboard:
Depends On:
Blocks: 1730687 1539785
TreeView+ depends on / blocked
 
Reported: 2017-11-01 17:52 UTC by Niranjan Mallapadi Raghavender
Modified: 2019-07-17 11:08 UTC (History)
7 users (show)

Fixed In Version: nss-3.34.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1539785 (view as bug list)
Environment:
Last Closed: 2018-04-10 09:46:29 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0679 None None None 2018-04-10 09:46:48 UTC
Mozilla Foundation 1415847 None None None 2019-07-22 12:46:23 UTC

Description Niranjan Mallapadi Raghavender 2017-11-01 17:52:10 UTC
Description of problem:


I am seeing a difference in behaviour with regard to modutil in RHEL7.5.


RHEL7.5
===========
Red Hat Enterprise Linux release 7.5 Beta (Maipo)

Version: nss-tools-3.34.0-0.1.beta1.el7.x86_64


$ mkdir abc

$ cd abc
$ modutil -dbdir . -create -force
$ modutil -changepw "NSS Certificate DB" -newpwfile <(echo) -force -dbdir . >/dev/null
Enter old password:



RHEL7.4
========
Red Hat Enterprise Linux Server release 7.4 (Maipo)
version: nss-tools-3.28.4-8.el7.x86_64

[root@server-3294 abc]# modutil -changepw "NSS Certificate DB" -newpwfile <(echo) -force -dbdir . >/dev/null
[root@server-3294 abc]#



Version-Release number of selected component (if applicable):
nss-tools-3.34.0-0.1.beta1.el7.x86_64

Actual results:
 modutil -changepw "NSS Certificate DB" -newpwfile <(echo) -force -dbdir . >/dev/null 

The above command prompts for password



Expected results:

 modutil -changepw "NSS Certificate DB" -newpwfile <(echo) -force -dbdir . >/dev/null

The above command should not prompt for old password. 

Additional info:

Comment 3 Kai Engert (:kaie) (inactive account) 2017-11-09 11:00:01 UTC
Thanks for your report.

This is probably caused by a recent upstream change to make modutil behave more correctly.
  https://bugzilla.mozilla.org/show_bug.cgi?id=1395495

Previously, modutil created NSS databases in a half-initialized and unusable state, so it was changed to always create a usable database immediately, by setting an empty password by default.

IIUC, you are trying to set the password to the empty string. This is no longer necessary, because it is the new default.

Your command could be changed to work, by providing the old password parameter, e.g. by adding the following to your command line:
  -pwfile <(echo)

Comment 4 Kai Engert (:kaie) (inactive account) 2017-11-09 11:01:19 UTC
Do you think this change in behavior could cause problems for customers?

Can you please give an argument why you consider it a regression that must be fixed?

If necessary, we could potentially change modutil to check if the current password is the empty password, and avoid the prompt in that scenario.

Comment 5 Lukas Slebodnik 2017-11-09 11:03:46 UTC
(In reply to Kai Engert (:kaie) from comment #4)
> Do you think this change in behavior could cause problems for customers?
> 
> Can you please give an argument why you consider it a regression that must
> be fixed?
> 
> If necessary, we could potentially change modutil to check if the current
> password is the empty password, and avoid the prompt in that scenario.

Will that work with nss in el7.4 and also in el7.5?
Because it is annoying to use different steps in setup based on different versions of some package.

Comment 6 Kai Engert (:kaie) (inactive account) 2017-11-09 11:08:49 UTC
(In reply to Lukas Slebodnik from comment #5)
> Will that work with nss in el7.4 and also in el7.5?
> Because it is annoying to use different steps in setup based on different
> versions of some package.

You are assuming the fix is already agreed on and planned. You are one step to quick. I was asking you for justifications, prior to deciding that we try to implement that fix.

Comment 7 Kai Engert (:kaie) (inactive account) 2017-11-09 11:09:30 UTC
Reported upstream at
https://bugzilla.mozilla.org/show_bug.cgi?id=1415847

Comment 9 Kai Engert (:kaie) (inactive account) 2017-11-09 11:14:28 UTC
(In reply to Lukas Slebodnik from comment #5)
> Because it is annoying to use different steps in setup based on different
> versions of some package.

I believe you could add
  -pwfile <(echo)
everywhere, to both old and new versions, and it should work with both old and new versions.

The question is, should we consider this change in behavior disruptive for existing workflows? If yes, it would be an argument to get it fixed prior to shipping 7.5.0

Comment 17 errata-xmlrpc 2018-04-10 09:46:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:0679


Note You need to log in before you can comment on or make changes to this bug.