User passwords like "Pa55w0rd!&" fail to be set.

Bug #1404533 reported by Adrian Vladu on 2014-12-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloudbase-init
Medium
Alessandro Pilotti

Bug Description

If a user password that contains a '&' in it is being sent via the metadata service, then the password fails to be set.

For example: Pa55w0rd!& fails to be set as it is, the '&' character is stripped out.

The problem is that the string escaping is not performed for Windows cmd here:
https://github.com/stackforge/cloudbase-init/blob/master/cloudbaseinit/plugins/windows/setuserpassword.py#L85
https://github.com/stackforge/cloudbase-init/blob/master/cloudbaseinit/osutils/windows.py#L331

Adrian Vladu (avladu) on 2014-12-20
summary: - User passwords like "Pa55w0rd!&" fails to be set.
+ User passwords like "Pa55w0rd!&" fail to be set.
Changed in cloudbase-init:
status: New → Triaged
importance: Undecided → High
importance: High → Medium

Btw I want to replace since a while that "net user add" with:

 [ADSI]("WinNT://./Administrator,user")

This will also solve any password escaping issue.

Changed in cloudbase-init:
assignee: nobody → Alessandro Pilotti (alexpilotti)
Changed in cloudbase-init:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/143320
Committed: https://git.openstack.org/cgit/stackforge/cloudbase-init/commit/?id=414fd1116c521b2f9598f89c7d48b004fbff516e
Submitter: Jenkins
Branch: master

commit 414fd1116c521b2f9598f89c7d48b004fbff516e
Author: Alessandro Pilotti <email address hidden>
Date: Sun Dec 21 22:50:21 2014 +0100

    Adds ADSI based Windows user management

    Replaces the Windows user creation and password management
    implementation from "NET USER" execution to ADSI COM usage.

    Change-Id: I4f95b094c95abb11762943afdb4be26541493159
    Closes-Bug: #1404533

Changed in cloudbase-init:
status: In Progress → Fix Committed

Change abandoned by Alessandro Pilotti (<email address hidden>) on branch: master
Review: https://review.openstack.org/143277
Reason: Already fixed in
https://review.openstack.org/143320

Changed in cloudbase-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers