Bug 1006260 - Account provider: creation of super long char user ends with error unauthorized instead of error too-long
Account provider: creation of super long char user ends with error unauthoriz...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openlmi-providers (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Roman Rakus
:
Depends On:
Blocks: 922084
  Show dependency treegraph
 
Reported: 2013-09-10 06:34 EDT by Petr Sklenar
Modified: 2014-01-12 19:15 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-10 10:04:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Sklenar 2013-09-10 06:34:52 EDT
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 10:04:01 EDT
Looks like you have bad password. I can't reproduce it.

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