Bug 1279942 - targetcli truncates password when it is longer than 255 characters
targetcli truncates password when it is longer than 255 characters
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: targetcli (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Maurizio Lombardi
Bruno Goncalves
Depends On:
Blocks: 1313485 1295577
  Show dependency treegraph
Reported: 2015-11-10 09:38 EST by Bruno Goncalves
Modified: 2017-11-01 20:05 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Bruno Goncalves 2015-11-10 09:38:12 EST
Description of problem:
Trying to configure CHAP password longer than 255 characters, only the first 255 characters are used for password.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Create a password with 256 characters
# export password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 256`
# echo ${#password}

2.Create an iSCSI target
# targetcli /iscsi create iqn.2009-10.com.redhat:storage-1

3. Set the CHAP password
# targetcli /iscsi/iqn.2009-10.com.redhat:storage-1/tpg1 set auth password=$password
Parameter password is now 'JlNkQ1xmnhsYCukUIl5Ors8tiLNGnPu6GmUxhhidLvSuEEaZWqctB2rljEEC0xD1MuoqAgYunW33CWF1xncRZ93ns6wGbHKKKph6rPjYPB9mUudQKIHW2wtfYvnktkGKTnOZhjVnc4irBcxMxCLtVBobp9MtOmAee4gfHxDuhuScPKkb2DjoEtUBZ3h0xZ7RkpPqv8JGCK5BgKYo9uibwpGNgcK4ya56tiIEEesF5yGilqit3tfRGUJJBLeWJSz'.

# echo $?

4. Check the last character was not set
# echo $password

Expected results:
targetcli should return some error informing the password is too long or provide some warning informing the password will be truncated.

The problem also happens with userid longer than 255.

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