Uploaded image for project: 'FreeSWITCH'
  1. FreeSWITCH
  2. FS-10457

mod_cdr_csv file open does not open file allowing read/write for freeswitch group


    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.6, 1.6.7
    • Fix Version/s: 1.8, 1.6.19
    • Component/s: mod_cdr_csv
    • Labels:
    • CPU Architecture:
    • Kernel:
    • Userland:
    • Distribution:
    • Distribution Version:
      Debian 8 jessie
    • Compiler:
    • FreeSWITCH GIT Revision:
      FreeSWITCH Version 1.6.7-14-d38d065~64bit (-14-d38d065 64bit)
    • GIT Master Revision hash::
      FreeSWITCH Version 1.6.7-14-d38d065~64bit (-14-d38d065 64bit)


      [1:29 PM] Mark Kerrane: @all happy friday. I have a quick question about the cdr csv files. When the Master.csv gets created, its getting created only with user freeswitch  rwx permission. What do I need to do to set group/everyone permisson on the file. I have tried setfacl -d -m user:freeswitch:rwx /var/log/freeswitch*  for both user and group but the permission is still being set as -rw-------+  hup rollover
      [1:30 PM] Mark Kerrane: setfacl -d -m group:freeswitch:rwx /var/log/freeswitch*
      has also been run on the directory
      [1:30 PM] Mike Jerris: hmmmm
      [1:30 PM] Mike Jerris: probably does that every time the new file is created
      [1:31 PM] Mike Jerris: here is the open call... open(fd->path, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR)
      [1:32 PM] Mark Kerrane: I need to get access to the file using sftp to process it externally... any ideas? I was hoping to run hup every hour so that the rollover. the sftp user is the freeswitch group, but it cant access it
      [1:33 PM] Mike Jerris: try changing that line
      [1:33 PM] Mike Jerris: change the last bit
      [1:33 PM] Mike Jerris: to
      [1:33 PM] Mike Jerris: S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
      [1:33 PM] Mike Jerris: instead of S_IRUSR | S_IWUSR
      [1:34 PM] Mike Jerris: if that solves your problem open me a jira and i can get that in tree
      [1:39 PM] Mark Kerrane: which source? Im not a FS dev
      [1:46 PM] Mike Jerris: sorry.. in the c file for that module
      [1:47 PM] Mike Jerris: mod_cdr_csv.c
      [1:47 PM] Mike Jerris: you'd need to make that text modification, then build and install the module
      [1:47 PM] Mark Kerrane: /usr/src/freeswitch.git/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
      I just found it after searching
      [1:47 PM] Mike Jerris: correct
      [1:48 PM] Mike Jerris: diff --git a/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c b/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
      index 1ce494a334..b3a129cbe9 100644
      --- a/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
      +++ b/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
      @@ -81,7 +81,7 @@ static void do_reopen(cdr_fd_t *fd)
              for (x = 0; x < 10; x++) {
      -               if ((fd->fd = open(fd->path, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR)) > -1) {
      +               if ((fd->fd = open(fd->path, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) > -1) {
                              fd->bytes = fd_size(fd->fd);
      [1:51 PM] Mark Kerrane: k
      [1:51 PM] Mark Kerrane: I have to run for a bit will be back after I get this build and tested out
      [1:51 PM] Mike Jerris: ok
      [1:52 PM] Mark Kerrane: *after which I will get this built and tested
      [1:52 PM] Mike Jerris: if that works.. i have a slightly different patch (that won't break windows) that i can push
      [4:32 PM] Mark Kerrane: @MikeJerris it worked
      [4:35 PM] Mike Jerris: cool.. file  jira for me.. I'll commit it
      [4:38 PM] Mike Jerris: testing fresh on deb9
      [4:39 PM] Mike Jerris: sorrry.. wrong channel
      [4:39 PM] Mike Jerris: let me know when you have a jira for me




            • Assignee:
              mikej Mike Jerris
              mark.kerrane Mark Kerrane
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: