summaryrefslogtreecommitdiff
path: root/data/dropbear_/shell.diff
blob: 2f608690164f40d04defebb03735004d9ca299e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff -ur dropbear-2019.78/common-session.c dropbear-2019.78+iOS/common-session.c
--- dropbear-2019.78/common-session.c	2019-03-27 04:15:23.000000000 -1000
+++ dropbear-2019.78+iOS/common-session.c	2019-11-03 23:12:39.000000000 -1000
@@ -599,6 +599,9 @@
 
 const char* get_user_shell() {
 	/* an empty shell should be interpreted as "/bin/sh" */
+	if (svr_opts.forced_shell) {
+		return svr_opts.forced_shell;
+	}
 	if (ses.authstate.pw_shell[0] == '\0') {
 		return "/bin/sh";
 	} else {
diff -ur dropbear-2019.78/runopts.h dropbear-2019.78+iOS/runopts.h
--- dropbear-2019.78/runopts.h	2019-03-27 04:15:23.000000000 -1000
+++ dropbear-2019.78+iOS/runopts.h	2019-11-03 23:09:42.000000000 -1000
@@ -124,6 +124,7 @@
 	char * pidfile;
 
 	char * forced_command;
+	char * forced_shell;
 
 } svr_runopts;
 
diff -ur dropbear-2019.78/svr-runopts.c dropbear-2019.78+iOS/svr-runopts.c
--- dropbear-2019.78/svr-runopts.c	2019-03-27 04:15:23.000000000 -1000
+++ dropbear-2019.78+iOS/svr-runopts.c	2019-11-03 23:11:05.000000000 -1000
@@ -103,6 +103,8 @@
 #if DEBUG_TRACE
 					"-v		verbose (compiled with DEBUG_TRACE)\n"
 #endif
+                                        "Customized options for iOS:\n\n"
+                                        "-S shell       Force specific shell\n"
 					,DROPBEAR_VERSION, progname,
 #if DROPBEAR_DSS
 					DSS_PRIV_FILENAME,
@@ -135,6 +137,7 @@
 	svr_opts.bannerfile = NULL;
 	svr_opts.banner = NULL;
 	svr_opts.forced_command = NULL;
+	svr_opts.forced_shell = NULL;
 	svr_opts.forkbg = 1;
 	svr_opts.norootlogin = 0;
 #ifdef HAVE_GETGROUPLIST
@@ -191,6 +194,9 @@
 				case 'c':
 					next = &svr_opts.forced_command;
 					break;
+				case 'S':
+					next = &svr_opts.forced_shell;
+					break;
 				case 'd':
 				case 'r':
 					next = &keyfile;