From 683ef16a07ea664cddd5793fe177652d8657c65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20T=C3=B6rnblom?= Date: Fri, 18 Oct 2024 18:39:14 +0200 Subject: [PATCH] raise permissions so we gain access to certain character devices, e.g. /dev/sflash0 fixes #1 --- main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.c b/main.c index 97c3f39..f3503cf 100644 --- a/main.c +++ b/main.c @@ -32,6 +32,8 @@ along with this program; see the file COPYING. If not, see #include #include +#include + #include "cmd.h" #include "log.h" @@ -413,6 +415,14 @@ main() { sleep(1); } + // change authid so certain character devices can be read, e.g., + // /dev/sflash0 + pid = getpid(); + if(kernel_set_ucred_authid(pid, 0x4801000000000013L)) { + FTP_LOG_PRINTF("%s", "Unable to change AuthID\n"); + return EXIT_FAILURE; + } + while(1) { ftp_serve(port); sleep(3);