RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1143942 - virt-sysprep option '--password-crypto' do not work
Summary: virt-sysprep option '--password-crypto' do not work
Keywords:
Status: CLOSED DUPLICATE of bug 1143949
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-18 09:46 UTC by Lingfei Kong
Modified: 2014-09-18 12:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-18 12:49:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lingfei Kong 2014-09-18 09:46:50 UTC
Description of problem:
virt-sysprep option '--password-crypto' md5|sha256|sha512 do not work, if you set password encryption to a new value md5, then create a new user and set its password, the new password will stil use the old password encryption, such as sha512.


Version-Release number of selected component (if applicable):
libguestfs-1.27.43-1.1.el7


How reproducible:
100%


Steps to Reproduce:
1. Create a raw format guest image: rhel6.6.img, by default this guest use 'sha512' as its password encryption
2. #virt-sysprep --password-crypto md5 -a rhel6.6.img
[   0.0] Examining the guest ...
[   5.0] Performing "abrt-data" ...
[   5.0] Performing "bash-history" ...
[   5.0] Performing "blkid-tab" ...
[   5.0] Performing "crash-data" ...
[   5.0] Performing "cron-spool" ...
[   5.0] Performing "dhcp-client-state" ...
[   5.0] Performing "dhcp-server-state" ...
[   5.0] Performing "dovecot-data" ...
[   5.0] Performing "logfiles" ...
[   5.0] Performing "machine-id" ...
[   5.0] Performing "mail-spool" ...
[   5.0] Performing "net-hostname" ...
[   5.0] Performing "net-hwaddr" ...
[   5.0] Performing "pacct-log" ...
[   5.0] Performing "package-manager-cache" ...
[   5.0] Performing "pam-data" ...
[   5.0] Performing "puppet-data-log" ...
[   5.0] Performing "rh-subscription-manager" ...
[   5.0] Performing "rhn-systemid" ...
[   5.0] Performing "rpm-db" ...
[   5.0] Performing "samba-db-log" ...
[   5.0] Performing "script" ...
[   5.0] Performing "smolt-uuid" ...
[   5.0] Performing "ssh-hostkeys" ...
[   5.0] Performing "ssh-userdir" ...
[   5.0] Performing "sssd-db-log" ...
[   5.0] Performing "tmp-files" ...
[   5.0] Performing "udev-persistent-net" ...
[   5.0] Performing "utmp" ...
[   5.0] Performing "yum-uuid" ...
[   5.0] Performing "customize" ...
[   5.0] Setting a random seed
[   5.0] Performing "lvm-uuids" ...

3. Login the guest, create a new user and check file /etc/shadow and /etc/sysconfig/authconfig
# useradd test
# passwd test
#cat /etc/shadow/ | grep test
test:$6$3W3li43Y$5tGb4NpR8zHNKmkSXoEsRFDTtkjLIeqL.qa5dDQihgHKGi0UjH6qDDIrhZk577M97MJJVqy8NTJiZIzZmOfcB1:16328:0:99999:7:::
#cat /etc/sysconfig/authconfig | grep PASSWDALGORITHM
PASSWDALGORITHM=sha512


Actual results:
The hashing algorithm in /etc/shadow is still sha512, i.e. the first two characters in the password field is $1 (md5 - 1, sha512 - 6, sha256 - 5)
The value of PASSWDALGORITHM is still sha512 in /etc/sysconfig/authconfig. 
Also i can not see any message from the output prove that virt-sysprep have performed option --password-crypto.


Expected results:
The hashing algorithm in /etc/shadow should be md5, i.e. the first two characters in the password field should be $1
The value of PASSWDALGORITHM should be md5
There should a message from the output prove that virt-sysprep have performed option --password-crypto.


Additional info:

Comment 1 Richard W.M. Jones 2014-09-18 12:49:13 UTC
Because virt-sysprep and virt-customize (and virt-builder) now
use common code to implement features like --password-crypto, I'm
going to fold these two bugs together.

*** This bug has been marked as a duplicate of bug 1143949 ***


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