Skip to content

Commit

Permalink
raise permissions so we gain access to certain character devices, e.g…
Browse files Browse the repository at this point in the history
…. /dev/sflash0

fixes #1
  • Loading branch information
john-tornblom committed Oct 18, 2024
1 parent c4311e7 commit 683ef16
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ along with this program; see the file COPYING. If not, see
#include <sys/sysctl.h>
#include <sys/syscall.h>

#include <ps5/kernel.h>

#include "cmd.h"
#include "log.h"

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 683ef16

Please sign in to comment.