Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/lve
File: secureio.h
// Secure I/O and filesystem operations
[0] Fix | Delete
[1] Fix | Delete
#ifndef _SECUREIO_H_
[2] Fix | Delete
#define _SECUREIO_H_
[3] Fix | Delete
[4] Fix | Delete
#include <sys/types.h>
[5] Fix | Delete
[6] Fix | Delete
[7] Fix | Delete
#define SECUREIO_BUFSIZE 8192
[8] Fix | Delete
[9] Fix | Delete
[10] Fix | Delete
// Writes absolute path pointed by descriptor fd to buffer *buf
[11] Fix | Delete
// Returns buf if successful
[12] Fix | Delete
// Returns NULL if error has occured
[13] Fix | Delete
char *get_path_from_descriptor(int fd, char *buf);
[14] Fix | Delete
[15] Fix | Delete
[16] Fix | Delete
// Returns 1 if subdir is subdirectory of dir, 0 otherwise
[17] Fix | Delete
int is_subdir(const char *dir, const char *subdir);
[18] Fix | Delete
[19] Fix | Delete
[20] Fix | Delete
// Opens path for reading not following symlinks and verifies that opened path is inside parent_path
[21] Fix | Delete
// Returns:
[22] Fix | Delete
// descriptor if successful
[23] Fix | Delete
// -1 if path does not exist or is a symlink
[24] Fix | Delete
// -2 if opened path is NOT inside parent_path or cannot be determined
[25] Fix | Delete
int open_not_symlink(const char *path, const char *parent_path);
[26] Fix | Delete
[27] Fix | Delete
[28] Fix | Delete
// Closes descriptor (if it is > 0)
[29] Fix | Delete
void closefd(int fd);
[30] Fix | Delete
[31] Fix | Delete
[32] Fix | Delete
// Tries to read first directory entry in order to ensure that descriptor is valid
[33] Fix | Delete
// Returns 0 if reading succeeded or -1 if error has occured
[34] Fix | Delete
int check_dir(int fd);
[35] Fix | Delete
[36] Fix | Delete
[37] Fix | Delete
// Checks if path is a directory (in secure manner)
[38] Fix | Delete
// Also opens path (if descriptor fd == -1) and then checks that opened path is inside parent_path
[39] Fix | Delete
// Returns descriptor if path refers to directory
[40] Fix | Delete
// Returns -1 if path does not exist or is not a directory
[41] Fix | Delete
// Returns -2 if opened path is NOT inside parent_path or cannot be determined
[42] Fix | Delete
int isdir(const char *path, int fd, const char *parent_path);
[43] Fix | Delete
[44] Fix | Delete
[45] Fix | Delete
// Sets permissions to directory (in secure manner)
[46] Fix | Delete
// Returns descriptor if successful
[47] Fix | Delete
// Returns -1 if error has occured
[48] Fix | Delete
// Returns -2 if opened path is NOT inside parent_path or cannot be determined
[49] Fix | Delete
int set_perm_dir_secure(const char *path, mode_t perm, int fd, const char *parent_path);
[50] Fix | Delete
[51] Fix | Delete
[52] Fix | Delete
// Sets owner and group of directory (in secure manner)
[53] Fix | Delete
// Returns descriptor if successful
[54] Fix | Delete
// Returns -1 if error has occured
[55] Fix | Delete
// Returns -2 if opened path is NOT inside parent_path or cannot be determined
[56] Fix | Delete
int set_owner_dir_secure(const char *path, uid_t uid, gid_t gid, int fd, const char *parent_path);
[57] Fix | Delete
[58] Fix | Delete
[59] Fix | Delete
// Creates directory if it does not exist, sets permissions/owner otherwise
[60] Fix | Delete
// Returns descriptor if successful
[61] Fix | Delete
// Returns -1 if error has occured
[62] Fix | Delete
int create_dir_secure(const char *path, mode_t perm, uid_t uid, gid_t gid, int fd, const char *parent_path);
[63] Fix | Delete
[64] Fix | Delete
[65] Fix | Delete
// Recursive directory creation function
[66] Fix | Delete
// Returns 0 if successful
[67] Fix | Delete
// Returns -1 if error has occured
[68] Fix | Delete
int makedirs_secure(const char *path, mode_t perm, uid_t uid, gid_t gid, const char *parent_path);
[69] Fix | Delete
[70] Fix | Delete
[71] Fix | Delete
#endif
[72] Fix | Delete
[73] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function