OpenDNSSEC-signer 1.3.0rc3
|
#include "config.h"
#include "shared/file.h"
#include "shared/log.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 * | ods_file_mode2str (const char *mode) |
int | ods_fgetc (FILE *fd, unsigned int *line_nr) |
int | ods_skip_whitespace (FILE *fd, unsigned int *line_nr) |
char * | ods_build_path (const char *file, const char *suffix, int dir) |
FILE * | ods_fopen (const char *file, const char *dir, const char *mode) |
void | ods_fclose (FILE *fd) |
ssize_t | ods_writen (int fd, const void *vptr, size_t n) |
time_t | ods_file_lastmodified (const char *file) |
int | ods_strcmp (const char *s1, const char *s2) |
const char * | ods_replace (const char *str, const char *oldstr, const char *newstr) |
int | ods_file_copy (const char *file1, const char *file2) |
char * | ods_dir_name (const char *file) |
void | ods_chown (const char *file, uid_t uid, gid_t gid, int getdir) |
void | ods_str_trim (char *str) |
char* ods_build_path | ( | const char * | file, |
const char * | suffix, | ||
int | dir | ||
) |
Construct file name. (StrAppend?, snprintf?)
Definition at line 117 of file file.c.
References ods_log_crit().
Referenced by tools_audit(), tools_input(), zone_backup(), and zone_recover().
void ods_chown | ( | const char * | file, |
uid_t | uid, | ||
gid_t | gid, | ||
int | getdir | ||
) |
(Create) and change ownership of directories
Definition at line 415 of file file.c.
References ods_dir_name(), ods_log_debug(), ods_log_error(), and ods_log_warning().
char* ods_dir_name | ( | const char * | file | ) |
Get directory part of filename.
Definition at line 384 of file file.c.
References ods_log_assert.
Referenced by ods_chown().
void ods_fclose | ( | FILE * | fd | ) |
Close a file.
Definition at line 216 of file file.c.
Referenced by adbackup_read(), adfile_read(), adfile_write(), engine_config(), ods_file_copy(), ods_file_lastmodified(), ods_log_init(), signconf_recover_from_backup(), task_recover_from_backup(), util_write_pidfile(), zone_backup(), and zone_recover().
int ods_fgetc | ( | FILE * | fd, |
unsigned int * | line_nr | ||
) |
Get next char.
Definition at line 75 of file file.c.
References ods_log_assert.
Referenced by adutil_readline_frm_file(), and ods_skip_whitespace().
int ods_file_copy | ( | const char * | file1, |
const char * | file2 | ||
) |
File copy.
Definition at line 359 of file file.c.
References ods_fclose(), ods_fopen(), ods_log_debug(), and SYSTEM_MAXLEN.
Referenced by tools_input().
time_t ods_file_lastmodified | ( | const char * | file | ) |
Get file last modified.
Definition at line 258 of file file.c.
References ods_fclose(), ods_fopen(), and ods_log_assert.
Referenced by signconf_update(), and zonelist_update().
const char* ods_file_mode2str | ( | const char * | mode | ) |
Convert file mode to readable string.
Definition at line 53 of file file.c.
References ods_strcmp().
Referenced by ods_fopen().
FILE* ods_fopen | ( | const char * | file, |
const char * | dir, | ||
const char * | mode | ||
) |
Open a file.
Definition at line 162 of file file.c.
References ods_file_mode2str(), ods_log_assert, ods_log_debug(), and ods_log_verbose().
Referenced by adbackup_read(), adfile_read(), adfile_write(), engine_config(), ods_file_copy(), ods_file_lastmodified(), ods_log_init(), signconf_recover_from_backup(), task_recover_from_backup(), util_write_pidfile(), zone_backup(), and zone_recover().
const char* ods_replace | ( | const char * | str, |
const char * | oldstr, | ||
const char * | newstr | ||
) |
int ods_skip_whitespace | ( | FILE * | fd, |
unsigned int * | line_nr | ||
) |
void ods_str_trim | ( | char * | str | ) |
int ods_strcmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Compare strings.
Definition at line 280 of file file.c.
Referenced by adapter_compare(), backup_read_check_str(), domain_recover(), keylist_lookup(), main(), ods_file_mode2str(), parse_conf_adapters(), parse_zonelist_zones(), signconf_compare_denial(), zone_merge(), zone_recover(), zonedata_recover(), and zonedata_update_serial().