View | Details | Raw Unified | Return to bug 367 | Differences between
and this patch

Collapse All | Expand All

(-)openssh.snap.20020722/acconfig.h (+6 lines)
Lines 150-155 Link Here
150
/* Define if you don't want to use lastlog */
150
/* Define if you don't want to use lastlog */
151
#undef DISABLE_LASTLOG
151
#undef DISABLE_LASTLOG
152
152
153
/* Define to use utmp */
154
#undef USE_UTMP
155
156
/* Define to use wtmp */
157
#undef USE_WTMP
158
153
/* Define if you don't want to use utmp */
159
/* Define if you don't want to use utmp */
154
#undef DISABLE_UTMP
160
#undef DISABLE_UTMP
155
161
(-)openssh.snap.20020722/auth1.c (+17 lines)
Lines 25-35 Link Here
25
#include "channels.h"
25
#include "channels.h"
26
#include "session.h"
26
#include "session.h"
27
#include "uidswap.h"
27
#include "uidswap.h"
28
# if defined(_CRAY) && ! defined(_CRAYSV1)
29
#include <ia.h>
30
#endif /* _CRAY */
28
#include "monitor_wrap.h"
31
#include "monitor_wrap.h"
29
32
30
/* import */
33
/* import */
31
extern ServerOptions options;
34
extern ServerOptions options;
32
35
36
# if defined(_CRAY) && ! defined(_CRAYSV1)
37
extern void cray_login_failure(char *username, int errcode);
38
extern int  cray_access_denied(char *username);
39
#endif /* _CRAY */
40
33
/*
41
/*
34
 * convert ssh auth msg type into description
42
 * convert ssh auth msg type into description
35
 */
43
 */
Lines 291-296 Link Here
291
		if (!authctxt->valid && authenticated)
299
		if (!authctxt->valid && authenticated)
292
			fatal("INTERNAL ERROR: authenticated invalid user %s",
300
			fatal("INTERNAL ERROR: authenticated invalid user %s",
293
			    authctxt->user);
301
			    authctxt->user);
302
303
# if defined(_CRAY) && ! defined(_CRAYSV1)
304
		if (type == SSH_CMSG_AUTH_PASSWORD && !authenticated)
305
			cray_login_failure(authctxt->user, IA_UDBERR);
306
		if (authenticated && cray_access_denied(authctxt->user)) {
307
			authenticated = 0;
308
			fatal("Access denied for user %s.",authctxt->user);
309
		}
310
#endif /* _CRAY */
294
311
295
#ifdef HAVE_CYGWIN
312
#ifdef HAVE_CYGWIN
296
		if (authenticated &&
313
		if (authenticated &&
(-)openssh.snap.20020722/auth2.c (+19 lines)
Lines 35-46 Link Here
35
#include "dispatch.h"
35
#include "dispatch.h"
36
#include "pathnames.h"
36
#include "pathnames.h"
37
#include "monitor_wrap.h"
37
#include "monitor_wrap.h"
38
#if defined(_CRAY) && !defined(_CRAYSV2)
39
#include <ia.h>
40
#endif /* _CRAY */
38
41
39
/* import */
42
/* import */
40
extern ServerOptions options;
43
extern ServerOptions options;
41
extern u_char *session_id2;
44
extern u_char *session_id2;
42
extern int session_id2_len;
45
extern int session_id2_len;
43
46
47
#if defined(_CRAY) && !defined(_CRAYSV2)
48
extern void cray_login_failure(char *username, int errcode);
49
extern int  cray_access_denied(char *username);
50
#endif /* _CRAY */
51
44
Authctxt *x_authctxt = NULL;
52
Authctxt *x_authctxt = NULL;
45
53
46
/* methods */
54
/* methods */
Lines 215-220 Link Here
215
		authenticated = 0;
223
		authenticated = 0;
216
#endif /* USE_PAM */
224
#endif /* USE_PAM */
217
225
226
#if defined(_CRAY) && !defined(_CRAYSV2)
227
	if (authenticated && cray_access_denied(authctxt->user)) {
228
		authenticated = 0;
229
		fatal("Access denied for user %s.",authctxt->user);
230
	}
231
#endif /* _CRAY */
232
218
	/* Log before sending the reply */
233
	/* Log before sending the reply */
219
	auth_log(authctxt, authenticated, method, " ssh2");
234
	auth_log(authctxt, authenticated, method, " ssh2");
220
235
Lines 234-239 Link Here
234
		if (authctxt->failures++ > AUTH_FAIL_MAX) {
249
		if (authctxt->failures++ > AUTH_FAIL_MAX) {
235
			packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
250
			packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
236
		}
251
		}
252
#if defined(_CRAY) && !defined(_CRAYSV2)
253
		if (strcmp(method, "password") == 0)
254
			cray_login_failure(authctxt->user, IA_UDBERR);
255
#endif /* _CRAY */
237
		methods = authmethods_get();
256
		methods = authmethods_get();
238
		packet_start(SSH2_MSG_USERAUTH_FAILURE);
257
		packet_start(SSH2_MSG_USERAUTH_FAILURE);
239
		packet_put_cstring(methods);
258
		packet_put_cstring(methods);
(-)openssh.snap.20020722/configure (-2 / +40 lines)
Lines 4070-4075 Link Here
4070
4070
4071
	MANTYPE=man
4071
	MANTYPE=man
4072
	;;
4072
	;;
4073
*-*-unicosmk*)
4074
	no_libsocket=1
4075
	no_libnsl=1
4076
	cat >>confdefs.h <<\EOF
4077
#define USE_PIPES 1
4078
EOF
4079
4080
	cat >>confdefs.h <<\EOF
4081
#define DISABLE_FD_PASSING 1
4082
EOF
4083
4084
	cat >>confdefs.h <<\EOF
4085
#define LOGIN_NEEDS_UTMPX 1
4086
EOF
4087
4088
	cat >>confdefs.h <<\EOF
4089
#define USE_UTMP 1
4090
EOF
4091
4092
	cat >>confdefs.h <<\EOF
4093
#define USE_WTMP 1
4094
EOF
4095
	LDFLAGS="$LDFLAGS"
4096
	LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
4097
	MANTYPE=cat
4098
	;;
4073
*-*-unicos*)
4099
*-*-unicos*)
4074
	no_libsocket=1
4100
	no_libsocket=1
4075
	no_libnsl=1
4101
	no_libnsl=1
Lines 4081-4088 Link Here
4081
#define DISABLE_FD_PASSING 1
4107
#define DISABLE_FD_PASSING 1
4082
EOF
4108
EOF
4083
4109
4084
	LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
4110
	cat >>confdefs.h <<\EOF
4085
	LIBS="$LIBS -lgen -lrsc"
4111
#define LOGIN_NEEDS_UTMPX 1
4112
EOF
4113
4114
	cat >>confdefs.h <<\EOF
4115
#define USE_UTMP 1
4116
EOF
4117
4118
	cat >>confdefs.h <<\EOF
4119
#define USE_WTMP 1
4120
EOF
4121
	LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
4122
	LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
4123
	MANTYPE=cat
4086
	;;
4124
	;;
4087
*-dec-osf*)
4125
*-dec-osf*)
4088
	echo "$as_me:4088: checking for Digital Unix SIA" >&5
4126
	echo "$as_me:4088: checking for Digital Unix SIA" >&5
(-)openssh.snap.20020722/configure.ac (-2 / +11 lines)
Lines 279-291 Link Here
279
	AC_CHECK_FUNCS(getluid setluid)
279
	AC_CHECK_FUNCS(getluid setluid)
280
	MANTYPE=man
280
	MANTYPE=man
281
	;;
281
	;;
282
*-*-unicosmk*)
283
	no_libsocket=1
284
	no_libnsl=1
285
	AC_DEFINE(USE_PIPES)
286
	AC_DEFINE(DISABLE_FD_PASSING)
287
	LDFLAGS="$LDFLAGS"
288
	LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
289
	MANTYPE=cat
282
*-*-unicos*)
290
*-*-unicos*)
283
	no_libsocket=1
291
	no_libsocket=1
284
	no_libnsl=1
292
	no_libnsl=1
285
	AC_DEFINE(USE_PIPES)
293
	AC_DEFINE(USE_PIPES)
286
	AC_DEFINE(DISABLE_FD_PASSING)
294
	AC_DEFINE(DISABLE_FD_PASSING)
287
	LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
295
	LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
288
	LIBS="$LIBS -lgen -lrsc"
296
	LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
297
	MANTYPE=cat
289
	;;
298
	;;
290
*-dec-osf*)
299
*-dec-osf*)
291
	AC_MSG_CHECKING(for Digital Unix SIA)
300
	AC_MSG_CHECKING(for Digital Unix SIA)
(-)openssh.snap.20020722/deattack.c (+12 lines)
Lines 101-111 Link Here
101
	if (h == NULL) {
101
	if (h == NULL) {
102
		debug("Installing crc compensation attack detector.");
102
		debug("Installing crc compensation attack detector.");
103
		n = l;
103
		n = l;
104
#if defined(_CRAY) && !defined(_CRAYSV2)
105
		h = (u_int16_t *) xmalloc(n * sizeof(u_int16_t));
106
#else
104
		h = (u_int16_t *) xmalloc(n * HASH_ENTRYSIZE);
107
		h = (u_int16_t *) xmalloc(n * HASH_ENTRYSIZE);
108
#endif /* _CRAY */
105
	} else {
109
	} else {
106
		if (l > n) {
110
		if (l > n) {
107
			n = l;
111
			n = l;
112
#if defined(_CRAY) && !defined(_CRAYSV2)
113
			h = (u_int16_t *) xrealloc(h, n * sizeof(u_int16_t));
114
#else
108
			h = (u_int16_t *) xrealloc(h, n * HASH_ENTRYSIZE);
115
			h = (u_int16_t *) xrealloc(h, n * HASH_ENTRYSIZE);
116
#endif /* _CRAY */
109
		}
117
		}
110
	}
118
	}
111
119
Lines 128-134 Link Here
128
		}
136
		}
129
		return (DEATTACK_OK);
137
		return (DEATTACK_OK);
130
	}
138
	}
139
#if defined(_CRAY) && !defined(_CRAYSV2)
140
	for (i=0; i<n; i++) h[i] = HASH_UNUSED;
141
#else
131
	memset(h, HASH_UNUSEDCHAR, n * HASH_ENTRYSIZE);
142
	memset(h, HASH_UNUSEDCHAR, n * HASH_ENTRYSIZE);
143
#endif /* _CRAY */
132
144
133
	if (IV)
145
	if (IV)
134
		h[HASH(IV) & (n - 1)] = HASH_IV;
146
		h[HASH(IV) & (n - 1)] = HASH_IV;
(-)openssh.snap.20020722/defines.h (-4 / +4 lines)
Lines 124-130 Link Here
124
# if (SIZEOF_SHORT_INT == 2)
124
# if (SIZEOF_SHORT_INT == 2)
125
typedef short int int16_t;
125
typedef short int int16_t;
126
# else
126
# else
127
#  ifdef _CRAY
127
#  if defined(_CRAY) && !defined(_CRAYSV2)
128
#   if (SIZEOF_SHORT_INT == 4)
128
#   if (SIZEOF_SHORT_INT == 4)
129
typedef short int16_t;
129
typedef short int16_t;
130
#   else
130
#   else
Lines 137-143 Link Here
137
# if (SIZEOF_INT == 4)
137
# if (SIZEOF_INT == 4)
138
typedef int int32_t;
138
typedef int int32_t;
139
# else
139
# else
140
#  ifdef _CRAY
140
#  if defined(_CRAY) && !defined(_CRAYSV2)
141
typedef long  int32_t;
141
typedef long  int32_t;
142
#  else
142
#  else
143
#   error "32 bit int type not found."
143
#   error "32 bit int type not found."
Lines 161-167 Link Here
161
#  if (SIZEOF_SHORT_INT == 2)
161
#  if (SIZEOF_SHORT_INT == 2)
162
typedef unsigned short int u_int16_t;
162
typedef unsigned short int u_int16_t;
163
#  else
163
#  else
164
#   ifdef _CRAY
164
#   if defined(_CRAY) && !defined(_CRAYSV2)
165
#    if (SIZEOF_SHORT_INT == 4)
165
#    if (SIZEOF_SHORT_INT == 4)
166
typedef unsigned short u_int16_t;
166
typedef unsigned short u_int16_t;
167
#    else
167
#    else
Lines 174-180 Link Here
174
#  if (SIZEOF_INT == 4)
174
#  if (SIZEOF_INT == 4)
175
typedef unsigned int u_int32_t;
175
typedef unsigned int u_int32_t;
176
#  else
176
#  else
177
#   ifdef _CRAY
177
#   if defined(_CRAY) && !defined(_CRAYSV2)
178
typedef unsigned long  u_int32_t;
178
typedef unsigned long  u_int32_t;
179
#   else
179
#   else
180
#    error "32 bit int type not found."
180
#    error "32 bit int type not found."
(-)openssh.snap.20020722/loginrec.c (-2 / +2 lines)
Lines 622-634 Link Here
622
	switch (li->type) {
622
	switch (li->type) {
623
	case LTYPE_LOGIN:
623
	case LTYPE_LOGIN:
624
		ut->ut_type = USER_PROCESS;
624
		ut->ut_type = USER_PROCESS;
625
#ifdef _CRAY
625
#if defined(_CRAY) && !defined(_CRAYSV2)
626
		cray_set_tmpdir(ut);
626
		cray_set_tmpdir(ut);
627
#endif
627
#endif
628
		break;
628
		break;
629
	case LTYPE_LOGOUT:
629
	case LTYPE_LOGOUT:
630
		ut->ut_type = DEAD_PROCESS;
630
		ut->ut_type = DEAD_PROCESS;
631
#ifdef _CRAY
631
#if defined(_CRAY) && !defined(_CRAYSV2)
632
		cray_retain_utmp(ut, li->pid);
632
		cray_retain_utmp(ut, li->pid);
633
#endif
633
#endif
634
		break;
634
		break;
(-)openssh.snap.20020722/monitor_mm.c (-1 / +1 lines)
Lines 28-35 Link Here
28
28
29
#ifdef HAVE_SYS_MMAN_H
29
#ifdef HAVE_SYS_MMAN_H
30
#include <sys/mman.h>
30
#include <sys/mman.h>
31
void *xmmap(size_t);
32
#endif
31
#endif
32
void *xmmap(size_t);
33
33
34
#include "ssh.h"
34
#include "ssh.h"
35
#include "xmalloc.h"
35
#include "xmalloc.h"
(-)openssh.snap.20020722/serverloop.c (+6 lines)
Lines 143-149 Link Here
143
	int save_errno = errno;
143
	int save_errno = errno;
144
	debug("Received SIGCHLD.");
144
	debug("Received SIGCHLD.");
145
	child_terminated = 1;
145
	child_terminated = 1;
146
#if !defined(_CRAY) || defined(_CRAYSV2)
146
	mysignal(SIGCHLD, sigchld_handler);
147
	mysignal(SIGCHLD, sigchld_handler);
148
#endif
147
	notify_parent();
149
	notify_parent();
148
	errno = save_errno;
150
	errno = save_errno;
149
}
151
}
Lines 670-676 Link Here
670
	/* We no longer want our SIGCHLD handler to be called. */
672
	/* We no longer want our SIGCHLD handler to be called. */
671
	mysignal(SIGCHLD, SIG_DFL);
673
	mysignal(SIGCHLD, SIG_DFL);
672
674
675
#if defined(_CRAY) && !defined(_CRAYSV2)
676
	while ((wait_pid = waitpid(-1, &wait_status, child_terminated ? WNOHANG : 0)) < 0)
677
#else
673
	while ((wait_pid = waitpid(-1, &wait_status, 0)) < 0)
678
	while ((wait_pid = waitpid(-1, &wait_status, 0)) < 0)
679
#endif /* _CRAY */
674
		if (errno != EINTR)
680
		if (errno != EINTR)
675
			packet_disconnect("wait: %.100s", strerror(errno));
681
			packet_disconnect("wait: %.100s", strerror(errno));
676
	if (wait_pid != pid)
682
	if (wait_pid != pid)
(-)openssh.snap.20020722/session.c (+29 lines)
Lines 57-62 Link Here
57
#include "canohost.h"
57
#include "canohost.h"
58
#include "session.h"
58
#include "session.h"
59
#include "monitor_wrap.h"
59
#include "monitor_wrap.h"
60
#if defined(_CRAY) && !defined(_CRAYSV2)
61
#include <tmpdir.h>
62
#endif
60
63
61
#ifdef HAVE_CYGWIN
64
#ifdef HAVE_CYGWIN
62
#include <windows.h>
65
#include <windows.h>
Lines 517-526 Link Here
517
			perror("dup2 stderr");
520
			perror("dup2 stderr");
518
#endif /* USE_PIPES */
521
#endif /* USE_PIPES */
519
522
523
#if defined(_CRAY) && !defined(_CRAYSV2)
524
		cray_init_job(s->pw); /* set up cray jid and tmpdir */
525
#endif
526
520
		/* Do processing for the child (exec command etc). */
527
		/* Do processing for the child (exec command etc). */
521
		do_child(s, command);
528
		do_child(s, command);
522
		/* NOTREACHED */
529
		/* NOTREACHED */
523
	}
530
	}
531
#if defined(_CRAY) && !defined(_CRAYSV2)
532
	signal(WJSIGNAL, cray_job_termination_handler);
533
#endif /* _CRAY */
524
#ifdef HAVE_CYGWIN
534
#ifdef HAVE_CYGWIN
525
	if (is_winnt)
535
	if (is_winnt)
526
		cygwin_set_impersonation_token(INVALID_HANDLE_VALUE);
536
		cygwin_set_impersonation_token(INVALID_HANDLE_VALUE);
Lines 608-614 Link Here
608
		/* record login, etc. similar to login(1) */
618
		/* record login, etc. similar to login(1) */
609
#ifndef HAVE_OSF_SIA
619
#ifndef HAVE_OSF_SIA
610
		if (!(options.use_login && command == NULL))
620
		if (!(options.use_login && command == NULL))
621
		{
622
#if defined(_CRAY) && !defined(_CRAYSV2)
623
			cray_init_job(s->pw); /* set up cray jid and tmpdir */
624
# endif /* _CRAY */
611
			do_login(s, command);
625
			do_login(s, command);
626
		}
612
# ifdef LOGIN_NEEDS_UTMPX
627
# ifdef LOGIN_NEEDS_UTMPX
613
		else
628
		else
614
			do_pre_login(s);
629
			do_pre_login(s);
Lines 619-624 Link Here
619
		do_child(s, command);
634
		do_child(s, command);
620
		/* NOTREACHED */
635
		/* NOTREACHED */
621
	}
636
	}
637
#if defined(_CRAY) && !defined(_CRAYSV2)
638
	signal(WJSIGNAL, cray_job_termination_handler);
639
#endif /* _CRAY */
622
#ifdef HAVE_CYGWIN
640
#ifdef HAVE_CYGWIN
623
	if (is_winnt)
641
	if (is_winnt)
624
		cygwin_set_impersonation_token(INVALID_HANDLE_VALUE);
642
		cygwin_set_impersonation_token(INVALID_HANDLE_VALUE);
Lines 759-764 Link Here
759
		printf("%s\n", aixloginmsg);
777
		printf("%s\n", aixloginmsg);
760
#endif /* WITH_AIXAUTHENTICATE */
778
#endif /* WITH_AIXAUTHENTICATE */
761
779
780
#if !defined(_CRAY) || defined(_CRAYSV2)
762
	if (options.print_lastlog && s->last_login_time != 0) {
781
	if (options.print_lastlog && s->last_login_time != 0) {
763
		time_string = ctime(&s->last_login_time);
782
		time_string = ctime(&s->last_login_time);
764
		if (strchr(time_string, '\n'))
783
		if (strchr(time_string, '\n'))
Lines 769-774 Link Here
769
			printf("Last login: %s from %s\r\n", time_string,
788
			printf("Last login: %s from %s\r\n", time_string,
770
			    s->hostname);
789
			    s->hostname);
771
	}
790
	}
791
#endif /* ! _CRAY */
772
792
773
	do_motd();
793
	do_motd();
774
}
794
}
Lines 1020-1025 Link Here
1020
		child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND",
1040
		child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND",
1021
		    original_command);
1041
		    original_command);
1022
1042
1043
#if defined(_CRAY) && !defined(_CRAYSV2)
1044
	if (cray_tmpdir[0] != '\0')
1045
		child_set_env(&env, &envsize, "TMPDIR", cray_tmpdir);
1046
#endif /* _CRAY */
1047
1023
#ifdef _AIX
1048
#ifdef _AIX
1024
	{
1049
	{
1025
		char *cp;
1050
		char *cp;
Lines 1259-1264 Link Here
1259
	/* login(1) is only called if we execute the login shell */
1284
	/* login(1) is only called if we execute the login shell */
1260
	if (options.use_login && command != NULL)
1285
	if (options.use_login && command != NULL)
1261
		options.use_login = 0;
1286
		options.use_login = 0;
1287
1288
#if defined(_CRAY) && !defined(_CRAYSV2)
1289
	cray_setup(pw->pw_uid, pw->pw_name, command);
1290
#endif /* _CRAY */
1262
1291
1263
	/*
1292
	/*
1264
	 * Login(1) does this as well, and it needs uid 0 for the "-h"
1293
	 * Login(1) does this as well, and it needs uid 0 for the "-h"
(-)openssh.snap.20020722/sshd.c (-1 / +1 lines)
Lines 934-940 Link Here
934
	    SYSLOG_FACILITY_AUTH : options.log_facility,
934
	    SYSLOG_FACILITY_AUTH : options.log_facility,
935
	    !inetd_flag);
935
	    !inetd_flag);
936
936
937
#ifdef _CRAY
937
#if defined(_CRAY) && !defined(_CRAYSV2)
938
	/* Cray can define user privs drop all prives now!
938
	/* Cray can define user privs drop all prives now!
939
	 * Not needed on PRIV_SU systems!
939
	 * Not needed on PRIV_SU systems!
940
	 */
940
	 */
(-)openssh.snap.20020722/sshpty.c (-2 / +2 lines)
Lines 162-168 Link Here
162
	}
162
	}
163
	return 1;
163
	return 1;
164
#else /* HAVE_DEV_PTS_AND_PTC */
164
#else /* HAVE_DEV_PTS_AND_PTC */
165
#ifdef _CRAY
165
#if defined(_CRAY) && !defined(_CRAYSV2)
166
	char buf[64];
166
	char buf[64];
167
	int i;
167
	int i;
168
	int highpty;
168
	int highpty;
Lines 268-274 Link Here
268
	void *old;
268
	void *old;
269
#endif /* USE_VHANGUP */
269
#endif /* USE_VHANGUP */
270
270
271
#ifdef _CRAY
271
#if defined(_CRAY) && !defined(_CRAYSV2)
272
	if (setsid() < 0)
272
	if (setsid() < 0)
273
		error("setsid: %.100s", strerror(errno));
273
		error("setsid: %.100s", strerror(errno));
274
274

Return to bug 367