Untitled

 avatar
unknown
plain_text
10 months ago
426 B
6
Indexable
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>

int main() {
    // Creează un fișier simplu în /tmp pentru a verifica dacă rulează ca root
    int fd = creat("/tmp/root_test.txt", 0644);
    if (fd < 0) {
        perror("creat");
        return 1;
    }

    write(fd, "Root access test.\n", 18);
    close(fd);

    printf("Fișierul /tmp/root_test.txt a fost creat.\n");
    return 0;
}
Editor is loading...
Leave a Comment