how to successfully test for a valid admin password in leopard?

I want to test to see if an admin password entered by a user is valid. In theory something like this should work:

set user_pass to "ii"
	do shell script "sudo -k"
	set test_password to do shell script ("ls /private/var/root/") password user_pass with administrator privileges
on error myerr
	log "the password is invalid"
end try

However, instead of being trapped by try, Leopard puts up an authentication dialog. I believe this did not happen on Tiger, but could be mistaken.

Is there some better way?

got the answer on the mailing lists from Alex Luttgents: