On AIX, if an LDAP user authenticates through SSH, the user's registry info is not updated. For instance, if an LDAP user enters an incorrect password while logging in through SSH, the LDAP user's unsuccessful_login_count is not increased. This is solved by adding calls to setuserdb(), getuserattr(), and setauthdb() in auth.c. I will be submitting a patch that adds these calls for 3.6p1. If anyone sees something in the patch that isn't kosher, let me know...
Created attachment 269 [details] Add calls to AIX's setuserdb(), setauthdb() in auth.c
Created attachment 270 [details] Untested patch containing discussed changes. I can't find much documentation on setauthdb (no man pages, only a couple of references on Google) but from what I can gather it loads some authentication code at runtime somewhat like PAM. A few things on the patch: 1) setauthdb is not on AIX 4.2 so you patch breaks there. You can add a test to configure.ac and put your additions inside "#ifdef HAVE_SETAUTHDB". 2) the indentation in the "if (authenticated.." block is misleading. You also have a whitespace-only change. 3) I'd move the variables you need inside the "if (authenticated.." block. That will remove one #ifdef. 4) Is 16 an absolute maximum for S_REGISTRY? You should probably use sizeof(registry) instead of a magic number in the strncpy. Do you even need the char *tmp and strncpy? Does setauthdb allocate oldauthdb for you (many of those functions do). 5) Do you need to explicitly set "files" in the case where getuserattr fails? Would you be better off just skipping the setauthdb in that case (which is equivalent to the old behaviour)? FWIW, I'd like to see all of this code moved out of the mainline and into a compatibility function (see http://marc.theaimsgroup.com/?l=openssh-unix-dev&m=104936325924401).
Created attachment 280 [details] Update patch to use record_failed_login (largely untested) Added AC_CHECK_FUNCS(setauthdb) to configure.ac. Added (char **)"" to setpcred call to match prototype (including usersec.h defines the prototype so the build will fail with a mismatch). Note: you will need to run "autoreconf" to rebuild configure if you use this patch
Created attachment 356 [details] Put setauthdb in its own function. Updated patch against -current.
Patch applied, thanks.
Mass change of RESOLVED bugs to CLOSED