}
}
+char * copyString(char * data) {
+ char * ret = (char * )malloc(strlen(data) + 1);
+ memcpy(ret, data, strlen(data) + 1);
+ ret[strlen(data)] = 0;
+ return ret;
+}
+
void password(void) {
if (settings.password == NULL) {
printf("\033[91mWarning: As the protocol of the switch wants it that way, all configuration packets are send as broadcasts, meaning everyone on this net can sniff your password!\033[0m\n");
- settings.password = getpass("Password: ");
+ settings.password = copyString(getpass("Password: "));
}
}
shell_port(argv, elem);
}
+ if (strncmp(argv[0], "sys", 3) == 0) {
+ shell_sys(argv, elem);
+ }
+