Example code contains incorrect constant names which causes incorrect behavior on error messages or text information.

Bug #912128 reported by Collin Stocks
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-pam (Ubuntu)
New
Undecided
Unassigned

Bug Description

The example file:

/usr/share/doc/python-pam/examples/pamtest.py

Line 19 contains:

               elif type == PAM.PAM_PROMPT_ERROR_MSG or type == PAM.PAM_PROMPT_TEXT_INFO:

Line 19 should contain:

              elif type == PAM.PAM_ERROR_MSG or type == PAM.PAM_TEXT_INFO:

If the pam module gives text info or an error message, this results in the example giving the following as output:
Go away! (('Authentication service cannot retrieve authentication info', 9))

...when in fact it should (under at least some circumstances) give the following as output:
Good to go!

1) Description: Ubuntu 11.04
Release: 11.04

2) python-pam:
  Installed: 0.4.2-12.2ubuntu2
  Candidate: 0.4.2-12.2ubuntu2
  Version table:
 *** 0.4.2-12.2ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main amd64 Packages
        100 /var/lib/dpkg/status

3) See above.
4) See above.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.