View | Details | Raw Unified | Return to bug 1527
Collapse All | Expand All

(-)session.c (-3 / +9 lines)
Lines 1-4 Link Here
1
/* $OpenBSD: session.c,v 1.241 2008/06/16 13:22:53 dtucker Exp $ */
1
/* $OpenBSD: session.c,v 1.242 2008/08/21 04:09:57 djm Exp $ */
2
/*
2
/*
3
 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
3
 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4
 *                    All rights reserved
4
 *                    All rights reserved
Lines 87-92 Link Here
87
#include <kafs.h>
87
#include <kafs.h>
88
#endif
88
#endif
89
89
90
#define IS_INTERNAL_SFTP(c) \
91
	(!strncmp(c, INTERNAL_SFTP_NAME, sizeof(INTERNAL_SFTP_NAME) - 1) && \
92
	 (c[sizeof(INTERNAL_SFTP_NAME) - 1] == '\0' || \
93
	  c[sizeof(INTERNAL_SFTP_NAME) - 1] == ' ' || \
94
	  c[sizeof(INTERNAL_SFTP_NAME) - 1] == '\t'))
95
90
/* func */
96
/* func */
91
97
92
Session *session_new(void);
98
Session *session_new(void);
Lines 701-707 do_exec(Session *s, const char *command) Link Here
701
	if (options.adm_forced_command) {
707
	if (options.adm_forced_command) {
702
		original_command = command;
708
		original_command = command;
703
		command = options.adm_forced_command;
709
		command = options.adm_forced_command;
704
		if (strcmp(INTERNAL_SFTP_NAME, command) == 0)
710
		if (IS_INTERNAL_SFTP(command))
705
			s->is_subsystem = SUBSYSTEM_INT_SFTP;
711
			s->is_subsystem = SUBSYSTEM_INT_SFTP;
706
		else if (s->is_subsystem)
712
		else if (s->is_subsystem)
707
			s->is_subsystem = SUBSYSTEM_EXT;
713
			s->is_subsystem = SUBSYSTEM_EXT;
Lines 709-715 do_exec(Session *s, const char *command) Link Here
709
	} else if (forced_command) {
715
	} else if (forced_command) {
710
		original_command = command;
716
		original_command = command;
711
		command = forced_command;
717
		command = forced_command;
712
		if (strcmp(INTERNAL_SFTP_NAME, command) == 0)
718
		if (IS_INTERNAL_SFTP(command))
713
			s->is_subsystem = SUBSYSTEM_INT_SFTP;
719
			s->is_subsystem = SUBSYSTEM_INT_SFTP;
714
		else if (s->is_subsystem)
720
		else if (s->is_subsystem)
715
			s->is_subsystem = SUBSYSTEM_EXT;
721
			s->is_subsystem = SUBSYSTEM_EXT;

Return to bug 1527