~ubuntu-branches/ubuntu/edgy/openssh/edgy

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2005-10-31 07:46:44 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20051031074644-poik7e4un4723tr4
Tags: 1:4.2p1-5ubuntu1
Resynchronise with Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *
3
3
 * Copyright (c) 2001 Gert Doering.  All rights reserved.
4
 
 * Copyright (c) 2003,2004 Darren Tucker.  All rights reserved.
 
4
 * Copyright (c) 2003,2004,2005 Darren Tucker.  All rights reserved.
5
5
 *
6
6
 * Redistribution and use in source and binary forms, with or without
7
7
 * modification, are permitted provided that the following conditions
42
42
# endif
43
43
 
44
44
/*
45
 
 * AIX has a "usrinfo" area where logname and other stuff is stored - 
 
45
 * AIX has a "usrinfo" area where logname and other stuff is stored -
46
46
 * a few applications actually use this and die if it's not set
47
47
 *
48
48
 * NOTE: TTY= should be set, but since no one uses it and it's hard to
49
49
 * acquire due to privsep code.  We will just drop support.
50
50
 */
51
 
 
52
 
 
53
51
void
54
52
aix_usrinfo(struct passwd *pw)
55
53
{
60
58
        len = sizeof("LOGNAME= NAME= ") + (2 * strlen(pw->pw_name));
61
59
        cp = xmalloc(len);
62
60
 
63
 
        i = snprintf(cp, len, "LOGNAME=%s%cNAME=%s%c", pw->pw_name, '\0', 
 
61
        i = snprintf(cp, len, "LOGNAME=%s%cNAME=%s%c", pw->pw_name, '\0',
64
62
            pw->pw_name, '\0');
65
63
        if (usrinfo(SETUINFO, cp, i) == -1)
66
64
                fatal("Couldn't set usrinfo: %s", strerror(errno));
153
151
int
154
152
sys_auth_passwd(Authctxt *ctxt, const char *password)
155
153
{
156
 
        char *authmsg = NULL, *msg, *name = ctxt->pw->pw_name;
 
154
        char *authmsg = NULL, *msg = NULL, *name = ctxt->pw->pw_name;
157
155
        int authsuccess = 0, expired, reenter, result;
158
156
 
159
157
        do {
160
158
                result = authenticate((char *)name, (char *)password, &reenter,
161
159
                    &authmsg);
162
160
                aix_remove_embedded_newlines(authmsg);  
163
 
                debug3("AIX/authenticate result %d, msg %.100s", result,
 
161
                debug3("AIX/authenticate result %d, authmsg %.100s", result,
164
162
                    authmsg);
165
163
        } while (reenter);
166
164
 
170
168
        if (result == 0) {
171
169
                authsuccess = 1;
172
170
 
173
 
                /*
 
171
                /*
174
172
                 * Record successful login.  We don't have a pty yet, so just
175
173
                 * label the line as "ssh"
176
174
                 */
257
255
sys_auth_record_login(const char *user, const char *host, const char *ttynm,
258
256
    Buffer *loginmsg)
259
257
{
260
 
        char *msg;
 
258
        char *msg = NULL;
261
259
        int success = 0;
262
260
 
263
261
        aix_setauthdb(user);