Bug 1006260

Summary: Account provider: creation of super long char user ends with error unauthorized instead of error too-long
Product: Red Hat Enterprise Linux 7 Reporter: Petr Sklenar <psklenar>
Component: openlmi-providersAssignee: Roman Rakus <rrakus>
Status: CLOSED NOTABUG QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: tsmetana
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-10 14:04:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 922084    

Description Petr Sklenar 2013-09-10 10:34:52 UTC
Description of problem:
Creation of super long char user ends with error unauthorized instead of error too-long.

Version-Release number of selected component (if applicable):
openlmi-account-0.1.1-2.el7.x86_64

How reproducible:
always

Steps to Reproduce:
def setUp(self):
        self.conn = lmishell.connect(HOST, USER, PASSWD)
        self.assertTrue(isinstance(self.conn, lmishell.LMIConnection), "Couldn't connect to remote provider")
        self.cs = self.conn.root.cimv2.Linux_ComputerSystem.first_instance()
        self.lams = self.conn.root.cimv2.LMI_AccountManagementService.first_instance()


def test(self)
        # create 32char user
        myuser = "32charabcdefghijklmnopqrstuvwxyz"
        user = self.lams.CreateAccount(Name=myuser, System=self.cs)
        self.assertEqual(user.rval, -1)
        self.assertTrue('name is too long' in user.errorstr)

# this is OK, it ends with the right error message ^^

        # try to create too long user
        myuser = "superman" * 9999999
        user = self.lams.CreateAccount(Name=myuser, System=self.cs)
        print user
        self.assertEqual(user.rval, -1)
        self.assertTrue('name is too long' in user.errorstr)

Actual results:
unauthorized

Expected results:
name is too long

Additional info:
/var/log/message

Sep 10 06:33:02 pes-guest-90 cimserver[25085]: pam_unix(wbem:auth): authentication failure; logname= uid=0 euid=0 tty=wbemLocal ruser= rhost=  user=root
Sep 10 06:33:02 pes-guest-90 cimserver[25085]: pam_succeed_if(wbem:auth): requirement "uid >= 1000" not met by user "root"
Sep 10 06:33:04 pes-guest-90 cimserver[25085]: pam_authenticate failed: Authentication failure
Sep 10 06:33:05 pes-guest-90 cimserver[25085]: PAM authentication failed for local user: root

Comment 2 Roman Rakus 2013-09-10 14:04:01 UTC
Looks like you have bad password. I can't reproduce it.