~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to openbsd-compat/port-aix.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-01-26 13:07:40 UTC
  • mfrom: (1.13.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100126130740-d7r70jqrqlbvz3r0
Tags: 1:5.3p1-1ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Add support for registering ConsoleKit sessions on login.
  - Drop openssh-blacklist and openssh-blacklist-extra to Suggests; they
    take up a lot of CD space, and I suspect that rolling them out in
    security updates has covered most affected systems now.
  - Convert to Upstart.  The init script is still here for the benefit of
    people running sshd in chroots.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
 
58
58
#include "port-aix.h"
59
59
 
 
60
static char *lastlogin_msg = NULL;
 
61
 
60
62
# ifdef HAVE_SETAUTHDB
61
63
static char old_registry[REGISTRY_SIZE] = "";
62
64
# endif
276
278
    Buffer *loginmsg)
277
279
{
278
280
        char *msg = NULL;
279
 
        static int msg_done = 0;
280
281
        int success = 0;
281
282
 
282
283
        aix_setauthdb(user);
283
284
        if (loginsuccess((char *)user, (char *)host, (char *)ttynm, &msg) == 0) {
284
285
                success = 1;
285
 
                if (msg != NULL && loginmsg != NULL && !msg_done) {
 
286
                if (msg != NULL) {
286
287
                        debug("AIX/loginsuccess: msg %s", msg);
287
 
                        buffer_append(loginmsg, msg, strlen(msg));
288
 
                        xfree(msg);
289
 
                        msg_done = 1;
 
288
                        if (lastlogin_msg == NULL)
 
289
                                lastlogin_msg = msg;
290
290
                }
291
291
        }
292
292
        aix_restoreauthdb();
293
293
        return (success);
294
294
}
295
295
 
 
296
char *
 
297
sys_auth_get_lastlogin_msg(const char *user, uid_t uid)
 
298
{
 
299
        char *msg = lastlogin_msg;
 
300
 
 
301
        lastlogin_msg = NULL;
 
302
        return msg;
 
303
}
 
304
 
296
305
#  ifdef CUSTOM_FAILED_LOGIN
297
306
/*
298
307
 * record_failed_login: generic "login failed" interface function