struct event_tool_context *ctx = talloc_get_type_abort(
private_data, struct event_tool_context);
struct stat statbuf;
- char *script, *etc_script, *data_script;
+ char *script, *etc_script;
int ret;
if (argc != 2) {
return ENOMEM;
}
- data_script = path_datadir_append(mem_ctx, script);
- if (data_script == NULL) {
- return ENOMEM;
- }
-
ret = lstat(etc_script, &statbuf);
if (ret == 0) {
if (S_ISLNK(statbuf.st_mode)) {
return EINVAL;
} else {
if (errno == ENOENT) {
+ char *data_script;
+
+ data_script = path_datadir_append(mem_ctx, script);
+ if (data_script == NULL) {
+ return ENOMEM;
+ }
+
ret = stat(data_script, &statbuf);
if (ret != 0) {
printf("Script %s does not exist in %s\n",