Bug 1631556

Summary: authconfig --updateall fails with TypeError: 'int' object is not callable
Product: [Fedora] Fedora Reporter: Kevin Adler <kadler>
Component: authselectAssignee: Pavel Březina <pbrezina>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: pbrezina
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: authselect-1.0.1-2.fc28 authselect-1.0.1-2.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-01 02:47:33 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:
Embargoed:

Description Kevin Adler 2018-09-20 20:52:16 UTC
Description of problem:
authconfig --updateall fails with

Traceback (most recent call last):
  File "/sbin/authconfig", line 585, in <module>
    main()
  File "/sbin/authconfig", line 564, in main
    authcompat = AuthCompat()
  File "/sbin/authconfig", line 435, in __init__
    self.sysconfig = EnvironmentFile(Path.System('authconfig'))
  File "/usr/lib/python3.6/site-packages/authselect/authcompat_EnvironmentFile.py", line 42, in __init__
    self.read()
  File "/usr/lib/python3.6/site-packages/authselect/authcompat_EnvironmentFile.py", line 53, in read
    self.delimiter, self.quotes)
  File "/usr/lib/python3.6/site-packages/authselect/authcompat_EnvironmentFile.py", line 162, in Parse
    value = EnvironmentFile.Line.Unescape(match.group(6), quotes)
  File "/usr/lib/python3.6/site-packages/authselect/authcompat_EnvironmentFile.py", line 207, in Unescape
    if i + 1 >= length(value):
TypeError: 'int' object is not callable


The problem is due to this line:

if i + 1 >= length(value):

It should be this instead:

if i + 1 >= len(value):


Version-Release number of selected component (if applicable): 1.0-3.fc28.x86_64


How reproducible: Always


Steps to Reproduce:
1. From root shell, run authconfig --updateall

Actual results:
Crashes with above error.

Expected results:
Should not crash

Additional info:

Some analysis by other IBMers seems to be that this may be the cause of a problem during F27->F28 upgrade which resulted in /var/run/nologin being regenerated during boot and never cleared, preventing login via VT/sudo/etc. Part of the remediation was to boot in single-user mode and run authselect --updateall which is how I discovered this bug. After fixing the buggy Python code, I was able to run the command and then log in was fixed.

Comment 1 Pavel Březina 2018-09-24 10:26:52 UTC
Thank you.

Upstream ticket:
https://github.com/pbrezina/authselect/issues/92

Comment 2 Fedora Update System 2018-09-27 13:27:37 UTC
authselect-1.0.1-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-18cdaf94c1

Comment 3 Fedora Update System 2018-09-27 13:33:20 UTC
authselect-1.0.1-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-29bdc75404

Comment 4 Fedora Update System 2018-09-27 16:43:28 UTC
authselect-1.0.1-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-29bdc75404

Comment 5 Fedora Update System 2018-09-27 18:42:46 UTC
authselect-1.0.1-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-18cdaf94c1

Comment 6 Fedora Update System 2018-09-28 07:31:25 UTC
authselect-1.0.1-2.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-738a0e5f83

Comment 7 Fedora Update System 2018-09-28 07:31:41 UTC
authselect-1.0.1-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-00221867d7

Comment 8 Fedora Update System 2018-09-28 19:35:09 UTC
authselect-1.0.1-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-738a0e5f83

Comment 9 Fedora Update System 2018-09-28 20:31:54 UTC
authselect-1.0.1-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-00221867d7

Comment 10 Fedora Update System 2018-10-01 02:47:33 UTC
authselect-1.0.1-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2018-10-02 19:33:17 UTC
authselect-1.0.1-2.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.