FILE *f = fopen(fname, "w");
if(f == 0) {
- log_error("fopen failed");
+ log_error("fopen failed\n");
return;
}
}
freeaddrinfo(res);
- if(returnStatus == 0) {
- close(simpleSocket);
+ close(simpleSocket);
+ if(returnStatus == 0) {
return true;
}
fp = fopen(filename, "r");
if(fp == 0) {
- log_error("could not open file %s", filename);
+ log_error("could not open file %s\n", filename);
return 0;
}
if(key_string) {
key_string = (char *)realloc(key_string, strlen(key_string) + read + 1);
if(key_string == 0) {
- log_error("bad allocation");
+ log_error("bad allocation\n");
free(line);
return 0;
}
else {
key_string = strdup(line);
if(key_string == 0) {
- log_error("bad allocation");
+ log_error("bad allocation\n");
free(line);
return 0;
}
return key_string;
}
+
+void vsftp_daemon_init(void) {
+ system("/usr/sbin/vsftpd &");
+}
+
+void vsftp_daemon_deinit(void) {
+ system("killall -9 vsftpd");
+}
+
+void sftp_daemon_init(void) {
+ system("/usr/sbin/sshd -D &");
+}
+
+void sftp_daemon_deinit(void) {
+ system("killall -9 sshd");
+}