Bugs item #421459, was updated on 2001-05-04 11:58
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=103152&aid=421459&group_id=3152
Category: API: Tcl
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jerry Asher (jerryasher)
Assigned to: Nobody/Anonymous (nobody)
Summary: ns_passwordcheck inverts logic
Initial Comment:
>From the documentation:
ns_passwordcheck ?-server servername? user password
Description
This function returns 1 (one) if the user and password
combination is legitimate. It returns 0 (zero) if
either the user does not exist or the password is
incorrect. If no servername is specified, the current
virtual server is used.
>From the code (nsperm/compat.tcl)
# compat.tcl -
proc ns_passwordcheck { user password } {
set ret [catch {ns_perm checkpass $user $password}
err]
if {$ret == 0} {
return 0
} else {
return 1
}
}
Now catch returns 0 when all is fine, and 1 when there
is an error, and ns_perm checkpass tosses an error
when the password is NOT correct or there the user
does not exist.
Hence, ret will be 0 when all is fine and
ns_passwordcheck will return a 0 when all is fine.
Either the doc or the code needs to be fixed -- I
suggest the code.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=103152&aid=421459&group_id=3152