support starting telnetd if requested

This commit is contained in:
Nick Chan committed 2024-04-09 16:00:51 +08:00
1 parent 90ff7e4cec
commit d36693c1d8
3 files changed
+15 -3

No files matched your search

+3 -1
View File
@@ -9,7 +9,7 @@
.Nd arm64 iOS/iPadOS/tvOS 15.0-17.5, bridgeOS 5.0-8.3 jailbreaking tool .Nd arm64 iOS/iPadOS/tvOS 15.0-17.5, bridgeOS 5.0-8.3 jailbreaking tool
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl cCdDEfhIlLnpRsSvV .Op Fl cCdDEfhIlLnpRsSTvV
.Op Fl e Ar Boot arguments .Op Fl e Ar Boot arguments
.Op Fl k Ar Pongo image .Op Fl k Ar Pongo image
.Op Fl o Ar overlay file .Op Fl o Ar overlay file
@@ -221,6 +221,8 @@ section below) will be executed. The loader app and the built in SSH server can
as well as any jailbreak-specific apps you have installed. as well as any jailbreak-specific apps you have installed.
.It Fl S , -no-colors .It Fl S , -no-colors
Disable colors on the command line. External programs like checkra1n clones may still output colors. Disable colors on the command line. External programs like checkra1n clones may still output colors.
.It Fl T , -telnetd
Enable the TELNET daemon on port 46, all interfaces. Please note that there is no authentication and is therefore insecure.
.It Fl v , -debug-logging .It Fl v , -debug-logging
Enable debug logging. The option may be repeated for extra verbosity. Enable debug logging. The option may be repeated for extra verbosity.
.It Fl V , -verbose-boot .It Fl V , -verbose-boot
+1
View File
@@ -47,6 +47,7 @@ typedef uint64_t palerain_option_t;
// #define palerain_option_emerg_mode (UINT64_C(1) << 29) /* emergency mode (early boot usb shell) */ // #define palerain_option_emerg_mode (UINT64_C(1) << 29) /* emergency mode (early boot usb shell) */
#define palerain_option_jbinit_log_to_file (UINT64_C(1) << 30) /* deprecated (kept for compatibility) */ #define palerain_option_jbinit_log_to_file (UINT64_C(1) << 30) /* deprecated (kept for compatibility) */
#define palerain_option_cli (UINT64_C(1) << 31) /* CLI mode */ #define palerain_option_cli (UINT64_C(1) << 31) /* CLI mode */
#define palerain_option_telnetd (UINT64_C(1) << 32) /* Enable TELNET daemon */
#define palerain_option_flower_chain (UINT64_C(1) << 61) /* Flower chain */ #define palerain_option_flower_chain (UINT64_C(1) << 61) /* Flower chain */
#define palerain_option_test1 (UINT64_C(1) << 62) /* Developer test option 1 */ #define palerain_option_test1 (UINT64_C(1) << 62) /* Developer test option 1 */
+11 -2
View File
@@ -39,6 +39,7 @@ static struct option longopts[] = {
{"force-revert", no_argument, NULL, palerain_option_case_force_revert}, {"force-revert", no_argument, NULL, palerain_option_case_force_revert},
{"no-colors", no_argument, NULL, 'S'}, {"no-colors", no_argument, NULL, 'S'},
{"safe-mode", no_argument, NULL, 's'}, {"safe-mode", no_argument, NULL, 's'},
{"telnetd", no_argument, NULL, 'T'},
{"version", no_argument, NULL, palerain_option_case_version}, {"version", no_argument, NULL, palerain_option_case_version},
{"override-libcheckra1nhelper", required_argument, NULL, palerain_option_case_libcheckra1nhelper_path}, {"override-libcheckra1nhelper", required_argument, NULL, palerain_option_case_libcheckra1nhelper_path},
{"override-pongo", required_argument, NULL, 'k'}, {"override-pongo", required_argument, NULL, 'k'},
@@ -65,7 +66,7 @@ static int usage(int e, char* prog_name)
{ {
fprintf(stderr, fprintf(stderr,
"Usage: %s [-" "Usage: %s [-"
"DEhpvVldsSLRnPI" "DEhpvVldsSTLRnPI"
#ifdef DEV_BUILD #ifdef DEV_BUILD
"12" "12"
#endif #endif
@@ -113,6 +114,7 @@ static int usage(int e, char* prog_name)
"\t-R, --reboot-device\t\t\tReboot connected device in normal mode\n" "\t-R, --reboot-device\t\t\tReboot connected device in normal mode\n"
"\t-s, --safe-mode\t\t\t\tEnter safe mode\n" "\t-s, --safe-mode\t\t\t\tEnter safe mode\n"
"\t-S, --no-colors\t\t\t\tDisable colors on the command line\n" "\t-S, --no-colors\t\t\t\tDisable colors on the command line\n"
"\t-T, --telnetd\t\t\t\tEnable TELNET daemon on port 46 (insecure)\n"
"\t-v, --debug-logging\t\t\tEnable debug logging\n" "\t-v, --debug-logging\t\t\tEnable debug logging\n"
"\t\tThis option can be repeated for extra verbosity.\n" "\t\tThis option can be repeated for extra verbosity.\n"
"\t-V, --verbose-boot\t\t\tVerbose boot\n" "\t-V, --verbose-boot\t\t\tVerbose boot\n"
@@ -132,7 +134,7 @@ int optparse(int argc, char* argv[]) {
int opt; int opt;
int index; int index;
while ((opt = getopt_long(argc, argv, while ((opt = getopt_long(argc, argv,
"DEhpvVlLdsStRnPIe:o:r:K:k:i:" "DEhpvVlLdsSTtRnPIe:o:r:K:k:i:"
#ifdef DEV_BUILD #ifdef DEV_BUILD
"12" "12"
#endif #endif
@@ -216,6 +218,9 @@ int optparse(int argc, char* argv[]) {
tui_options_safe_mode = true; tui_options_safe_mode = true;
#endif #endif
break; break;
case 'T':
palerain_flags |= palerain_option_telnetd;
break;
case 'k': case 'k':
if (access(optarg, F_OK) != 0) { if (access(optarg, F_OK) != 0) {
LOG(LOG_FATAL, "Cannot access pongo file at %s: %d (%s)", optarg, errno, strerror(errno)); LOG(LOG_FATAL, "Cannot access pongo file at %s: %d (%s)", optarg, errno, strerror(errno));
@@ -360,6 +365,10 @@ int optparse(int argc, char* argv[]) {
return 0; return 0;
} }
if (palerain_flags & palerain_option_telnetd) {
LOG(LOG_WARNING, "telnetd is enabled");
}
if ((strstr(xargs_cmd, "serial=") != NULL) && !force_use_verbose_boot && (palerain_flags & palerain_option_setup_rootful)) { if ((strstr(xargs_cmd, "serial=") != NULL) && !force_use_verbose_boot && (palerain_flags & palerain_option_setup_rootful)) {
palerain_flags &= ~palerain_option_verbose_boot; palerain_flags &= ~palerain_option_verbose_boot;
} }