Skip to content

Commit

Permalink
fix claiming on macOS (netdata#16686)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 authored Dec 29, 2023
1 parent 062eb42 commit e97a607
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions daemon/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ void get_netdata_execution_path(void) {

netdata_exe_file[exepath_size] = '\0';

strcpy(netdata_exe_path, netdata_exe_file);
dirname(netdata_exe_path);
// macOS's dirname(3) does not modify passed string
char *tmpdir = strdupz(netdata_exe_file);
strcpy(netdata_exe_path, dirname(tmpdir));
freez(tmpdir);
}

static void fix_directory_file_permissions(const char *dirname, uid_t uid, gid_t gid, bool recursive)
Expand Down

0 comments on commit e97a607

Please sign in to comment.