Bug 1710 - aix_setauthdb/aix_restoredb are not called in getpwnamallow() causing permanently_set_uid() to fail
Summary: aix_setauthdb/aix_restoredb are not called in getpwnamallow() causing permane...
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 5.3p1
Hardware: PPC AIX
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_4
  Show dependency treegraph
 
Reported: 2010-02-02 05:48 AEDT by Alexandre Letourneau
Modified: 2010-03-26 10:52 AEDT (History)
2 users (show)

See Also:


Attachments
A patch fixing this issue (608 bytes, patch)
2010-02-02 05:48 AEDT, Alexandre Letourneau
no flags Details | Diff
Level 3 debug logs showing the problem (10.72 KB, text/plain)
2010-02-02 05:49 AEDT, Alexandre Letourneau
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Letourneau 2010-02-02 05:48:15 AEDT
Created attachment 1787 [details]
A patch fixing this issue

We are using a bunch of diffrent LAMs to authenticate users, and
while qualifying openSSH5.3p1 on aix 5.3 and 6.1 we discovered 
a small bug.

In auth.c inside the function getpwnamallow(const char *user)
getpwnam(user) is called w/o setting the authdb first.

This results in the wrong authdb being used to retrieve the
user's passwd structure: it uses the default LAM. 
(ie: the first one it finds in /usr/lib/security/methods.cfg)

setauthdb() is called during the authentication phase
(which is very good), but it is also necessary to make 
the call before using getpwnam/getpwuid/etc.

This is easly fixed by wrapping aix_setauthdb()/aix_restoredb [from port-aix.c] around the getpwnam(user) call [in auth.c]

I attached a patch, that I tested on aix 5.3 and aix 6.1, fixing this issue.
Comment 1 Alexandre Letourneau 2010-02-02 05:49:02 AEDT
Created attachment 1788 [details]
Level 3 debug logs showing the problem
Comment 2 Darren Tucker 2010-02-12 10:39:18 AEDT
Thanks, I'll look at this.
Comment 3 Yannick Bergeron 2010-03-06 07:25:23 AEDT
is it still planned to be included in 5.4?

I saw that some bugs that were previously blocks for 5.4 were moved to 5.5

We would really appreciate that this fix could be included in 5.4
Comment 4 Darren Tucker 2010-03-07 11:57:53 AEDT
Patch applied, thanks.  It will be in 5.4p1.

I think that after the release we should put a getpwnam() wrapper in port-aix.c that does this to keep the diffs out of the mainline code.
Comment 5 Alexandre Letourneau 2010-03-07 16:50:49 AEDT
Thanks, yes it would be much cleaner that way. I could work on it.
Comment 6 Darren Tucker 2010-03-26 10:52:13 AEDT
With the release of 5.4p1, this bug is now considered closed.