cosmetics

This commit is contained in:
John Törnblom committed 2026-02-18 19:50:33 +01:00
1 parent 5050503072
commit 9f0a2a9822
3 files changed
+5 -5

No files matched your search

-2
View File
@@ -92,8 +92,6 @@ main() {
syscall(SYS_thr_set_name, -1, "ftpsrv.elf"); syscall(SYS_thr_set_name, -1, "ftpsrv.elf");
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
FTP_LOG_PRINTF("FTP server was compiled at %s %s\n", __DATE__, __TIME__);
while(1) { while(1) {
ftp_serve(port, notify_user); ftp_serve(port, notify_user);
notify_user = 0; notify_user = 0;
+3 -3
View File
@@ -31,14 +31,14 @@ along with this program; see the file COPYING. If not, see
/** /**
* This global lock is used to address race conditions that may occur when * A global lock that address race conditions that may occur when
* threads atempt to read several SELF files at the same time. * threads atempt to read several SELF files at the same time.
**/ **/
static pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER;
/** /**
* Decrypt and copy an ELF segment. * Decrypt and copy an encrypted ELF segment.
**/ **/
static int static int
decrypt_segment(int self_fd, int elf_fd, const Elf64_Phdr* phdr, size_t ind) { decrypt_segment(int self_fd, int elf_fd, const Elf64_Phdr* phdr, size_t ind) {
@@ -324,7 +324,7 @@ self_extract_elf(int self_fd, int elf_fd) {
continue; continue;
} }
// Decrypt and/or copy the segment // Decrypt and copy the segment
if(entry->props.is_encrypted || entry->props.is_compressed) { if(entry->props.is_encrypted || entry->props.is_compressed) {
if(decrypt_segment(self_fd, elf_fd, &phdr, i)) { if(decrypt_segment(self_fd, elf_fd, &phdr, i)) {
free(entries); free(entries);
+2
View File
@@ -298,6 +298,8 @@ ftp_serve(uint16_t port, int notify_user) {
puts("| |_| |"); puts("| |_| |");
printf("| %-16s Copyright (C) 2025 John Törnblom & drakmor |\n", VERSION_TAG); printf("| %-16s Copyright (C) 2025 John Törnblom & drakmor |\n", VERSION_TAG);
puts("'-------------------------------------------------------------'"); puts("'-------------------------------------------------------------'");
puts("");
printf("compiled at %s %s, running on port %d\n", __DATE__, __TIME__, port);
} }
if(getifaddrs(&ifaddr) == -1) { if(getifaddrs(&ifaddr) == -1) {