Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pdbedit module on samba 4.9 (Fixes #50538) #50540

Merged
merged 1 commit into from Nov 16, 2018

Conversation

@sjorge
Copy link
Contributor

commented Nov 16, 2018

What does this PR do?

Fixes salt.modules.pdbedit for samba 4.9

What issues does this PR fix or reference?

#50538

Previous Behavior

Python exceptions and incorrect data

New Behavior

Return the expected data

Tests written?

No

Commits signed with GPG?

No

Copy link
Collaborator

left a comment

LGTM

@cachedout cachedout merged commit d9644bd into saltstack:develop Nov 16, 2018
11 checks passed
11 checks passed
WIP Ready for review
Details
codeclimate 1 fixed issue
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details
@sjorge sjorge deleted the sjorge:pdbedit_samba49 branch Nov 16, 2018
@sjorge

This comment has been minimized.

Copy link
Contributor Author

commented Nov 16, 2018

Just an extra bit of background info...

[atlas :: sjorge][~]
[.]$ pfexec pdbedit --list --verbose
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
Processing section "[global]"
---------------
Unix username:        sjorge
NT username:
Account Flags:        [U          ]
User SID:             S-1-5-21-685084175-2572502280-2464704839-1001
Forcing Primary Group to 'Domain Users' for sjorge
Primary Group SID:    S-1-5-21-685084175-2572502280-2464704839-513
Full Name:            Jorge Schrauwen
Home Directory:       \\atlas\sjorge
HomeDir Drive:
Logon Script:
Profile Path:         \\atlas\sjorge\profile
Domain:               ATLAS
Account desc:
Workstations:
Munged dial:
Logon time:           0
Logoff time:          Wed, 06 Feb 2036 16:06:39 CET
Kickoff time:         Wed, 06 Feb 2036 16:06:39 CET
Password last set:    Wed, 24 Oct 2018 20:05:20 CEST
Password can change:  Wed, 24 Oct 2018 20:05:20 CEST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

The following line is not present on Samba 4.8
lp_load_ex: refreshing parameters

Which made the first few lines be considered as another 'user' that was missing 'Unix username' field, resulting in the exception observed.

The extra check it see if the user has an actual 'unix username' property before appending it avoids this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.