OpenDNSSEC-signer 1.2.1
|
#include "config.h"
#include "util/file.h"
#include "util/log.h"
#include "util/se_malloc.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
Go to the source code of this file.
Functions | |
const char * | se_file_mode2str (const char *mode) |
int | se_fgetc (FILE *fd, unsigned int *line_nr) |
int | se_skip_whitespace (FILE *fd, unsigned int *line_nr) |
char * | se_build_path (const char *file, const char *suffix, int dir) |
FILE * | se_fopen (const char *file, const char *dir, const char *mode) |
void | se_fclose (FILE *fd) |
ssize_t | se_writen (int fd, const void *vptr, size_t n) |
time_t | se_file_lastmodified (const char *file) |
int | se_strcmp (const char *s1, const char *s2) |
const char * | se_replace (const char *str, const char *oldstr, const char *newstr) |
int | se_file_copy (const char *file1, const char *file2) |
char * | se_dir_name (const char *file) |
void | se_chown (const char *file, uid_t uid, gid_t gid, int getdir) |
void | se_str_trim (char *str) |
char* se_build_path | ( | const char * | file, |
const char * | suffix, | ||
int | dir | ||
) |
Construct file name. (StrAppend?, snprintf?)
Definition at line 114 of file file.c.
References se_malloc().
Referenced by signconf_backup(), task_backup(), tools_audit(), tools_read_input(), tools_update(), zone_add_dnskeys(), zone_backup_state(), zone_nsecify(), zone_recover_from_backup(), and zone_sign().
void se_chown | ( | const char * | file, |
uid_t | uid, | ||
gid_t | gid, | ||
int | getdir | ||
) |
(Create) and change ownership of directories
Definition at line 396 of file file.c.
References se_dir_name(), se_free(), se_log_debug(), se_log_error(), and se_log_warning().
char* se_dir_name | ( | const char * | file | ) |
Get directory part of filename.
Definition at line 367 of file file.c.
References se_calloc(), and se_log_assert.
Referenced by se_chown().
void se_fclose | ( | FILE * | fd | ) |
Close a file.
Definition at line 206 of file file.c.
Referenced by adfile_read(), adfile_write(), engine_config(), se_file_copy(), se_file_lastmodified(), se_log_init(), signconf_backup(), signconf_read(), signconf_recover_from_backup(), task_backup(), task_recover_from_backup(), zone_add_dnskeys(), zone_backup_state(), zone_nsecify(), zone_recover_from_backup(), and zone_sign().
int se_fgetc | ( | FILE * | fd, |
unsigned int * | line_nr | ||
) |
Get next char.
Definition at line 72 of file file.c.
References se_log_assert.
Referenced by se_skip_whitespace().
int se_file_copy | ( | const char * | file1, |
const char * | file2 | ||
) |
File copy.
Definition at line 343 of file file.c.
References se_fclose(), se_fopen(), se_log_assert, se_log_debug(), and SYSTEM_MAXLEN.
Referenced by tools_read_input(), and tools_update().
time_t se_file_lastmodified | ( | const char * | file | ) |
Get file last modified.
Definition at line 248 of file file.c.
References se_fclose(), se_fopen(), and se_log_assert.
Referenced by signconf_read(), and zonelist_read().
const char* se_file_mode2str | ( | const char * | mode | ) |
File access. Convert file mode to readable string.
Definition at line 52 of file file.c.
References se_log_assert, and se_strcmp().
Referenced by se_fopen().
FILE* se_fopen | ( | const char * | file, |
const char * | dir, | ||
const char * | mode | ||
) |
Open a file.
Definition at line 155 of file file.c.
References se_file_mode2str(), se_free(), se_log_assert, se_log_debug(), se_log_error(), and se_malloc().
Referenced by adfile_read(), adfile_write(), engine_config(), se_file_copy(), se_file_lastmodified(), se_log_init(), signconf_backup(), signconf_read(), signconf_recover_from_backup(), task_backup(), task_recover_from_backup(), zone_add_dnskeys(), zone_backup_state(), zone_nsecify(), zone_recover_from_backup(), and zone_sign().
const char* se_replace | ( | const char * | str, |
const char * | oldstr, | ||
const char * | newstr | ||
) |
Replace a substring in string.
Definition at line 292 of file file.c.
References se_calloc(), se_log_assert, se_strdup(), and SYSTEM_MAXLEN.
Referenced by set_notify_ns().
int se_skip_whitespace | ( | FILE * | fd, |
unsigned int * | line_nr | ||
) |
void se_str_trim | ( | char * | str | ) |
int se_strcmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Compare strings.
Definition at line 270 of file file.c.
Referenced by adapter_compare(), backup_read_check_str(), engine_search_workers(), engine_update_zones(), key_compare(), keylist_lookup(), main(), parse_zonelist_zones(), se_file_mode2str(), signconf_compare(), zone_update_zonelist(), zonedata_recover_from_backup(), and zonelist_lookup_zone_by_name().