Atlas - checks.c
Home / lib / rootGuard Lines: 1 | Size: 941 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* SPDX-License-Identifier: GPL-3.0 2 * Root Guard 3 * 4 * checks.c - Root Guard Checks Implementation 5 * 6 * COPYRIGHT NOTICE 7 * Copyright (C) 2025-2026 0x4248 and contributors 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the license is not changed. 10 * 11 * This software is free and open source. Licensed under the GNU general 12 * public license version 3.0 as published by the Free Software Foundation. 13*/ 14 15 16#include <unistd.h> 17#include <fcntl.h> 18#include <stdio.h> 19#include <dirent.h> 20 21#include "checks.h" 22 23 24 25int root_uuid_check(){ 26 if (getuid() != 0) { 27 return RG_TF; 28 } 29 return RG_TP; 30} 31 32int shadow_file_check(){ 33 if (faccessat(AT_FDCWD, "/etc/shadow", R_OK, AT_EACCESS) == 0) return RG_TP; 34 return RG_TF; 35} 36 37int root_dir_check(){ 38 DIR *dir = opendir("/root"); 39 if (dir) { 40 closedir(dir); 41 return RG_TP; 42 } 43 return RG_TF; 44}[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.