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

Collapse All | Expand All

(-)session.c.orig (-3 / +19 lines)
Lines 651-660 do_pre_login(Session *s) Link Here
651
void
651
void
652
do_exec(Session *s, const char *command)
652
do_exec(Session *s, const char *command)
653
{
653
{
654
	/*  implement 'scp-only' for public keys  */
654
	if (forced_command) {
655
	if (forced_command) {
655
		original_command = command;
656
		if (strncmp(forced_command,"scp-only",8) == 0) {
656
		command = forced_command;
657
			if (!command) {
657
		debug("Forced command '%.900s'", command);
658
				fatal("scp-only but trying to get shell");
659
			}
660
			if (strncmp(command,"scp ",4) == 0) {
661
				char *p;
662
				for (p = command; *p && *p != ';'; p++) ;
663
				*p = '\0';
664
			}
665
			else {
666
				fatal("scp-only but trying to run command: %.900s",command);
667
			}
668
		}
669
		else {
670
			original_command = command;
671
			command = forced_command;
672
			debug("Forced command '%.900s'", command);
673
 		}
658
	}
674
	}
659
675
660
#ifdef SSH_AUDIT_EVENTS
676
#ifdef SSH_AUDIT_EVENTS

Return to bug 1172