Commit 55f1be5a authored by Daniel Salzman's avatar Daniel Salzman
Browse files

process: remove storage writability check

parent fe6a0409
......@@ -21,7 +21,6 @@
#include <string.h>
#include <signal.h>
#include <grp.h>
#include <assert.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
......@@ -32,12 +31,8 @@
#include "knot/ctl/process.h"
#include "knot/conf/conf.h"
#include "knot/common/log.h"
#include "libknot/errcode.h"
#include "libknot/internal/mem.h"
#include "libknot/libknot.h"
#define LOCK_FILE "knot.lock"
char* pid_filename()
{
rcu_read_lock();
......@@ -169,38 +164,6 @@ int proc_update_privileges(int uid, int gid)
}
}
/* Check storage writability. */
conf_iter_t iter = conf_iter(conf(), C_ZONE);
while (iter.code == KNOT_EOK) {
conf_val_t id = conf_iter_id(conf(), &iter);
conf_val_t val = conf_zone_get(conf(), C_STORAGE, conf_dname(&id));
char *storage = conf_abs_path(&val, NULL);
if (storage == NULL) {
conf_iter_finish(conf(), &iter);
return KNOT_ENOMEM;
}
char *lfile = sprintf_alloc("%s/%s", storage, LOCK_FILE);
assert(lfile != NULL);
FILE *fp = fopen(lfile, "w");
if (fp == NULL) {
log_error("storage directory '%s' is not writable",
storage);
free(lfile);
free(storage);
conf_iter_finish(conf(), &iter);
return KNOT_EACCES;
} else {
fclose(fp);
unlink(lfile);
}
free(lfile);
free(storage);
conf_iter_next(conf(), &iter);
}
conf_iter_finish(conf(), &iter);
return KNOT_EOK;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment