/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2018-02-10 13:23:58 UTC
  • Revision ID: teddy@recompile.se-20180210132358-8pfvo9vshq9l32y5
Remove unnecessary text left from old example init.d file

* init.d-mandos: Remove unnecessary text left from old example init.d
  file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
613
613
        }
614
614
        params.size += (unsigned int)bytes_read;
615
615
      }
616
 
      close(dhpfile);
617
616
      if(params.data == NULL){
618
617
        dhparamsfilename = NULL;
619
618
      }
1656
1655
      perror_plus("ioctl SIOCGIFFLAGS");
1657
1656
      errno = old_errno;
1658
1657
    }
1659
 
    close(s);
1660
1658
    return false;
1661
1659
  }
1662
 
  close(s);
1663
1660
  return true;
1664
1661
}
1665
1662
 
1926
1923
      return;
1927
1924
    }
1928
1925
  }
1929
 
  int devnull = (int)TEMP_FAILURE_RETRY(open("/dev/null", O_RDONLY));
1930
 
  if(devnull == -1){
1931
 
    perror_plus("open(\"/dev/null\", O_RDONLY)");
1932
 
    return;
1933
 
  }
1934
1926
  int numhooks = scandirat(hookdir_fd, ".", &direntries,
1935
1927
                           runnable_hook, alphasort);
1936
1928
  if(numhooks == -1){
1937
1929
    perror_plus("scandir");
1938
 
    close(devnull);
1939
1930
    return;
1940
1931
  }
1941
1932
  struct dirent *direntry;
1942
1933
  int ret;
 
1934
  int devnull = (int)TEMP_FAILURE_RETRY(open("/dev/null", O_RDONLY));
 
1935
  if(devnull == -1){
 
1936
    perror_plus("open(\"/dev/null\", O_RDONLY)");
 
1937
    return;
 
1938
  }
1943
1939
  for(int i = 0; i < numhooks; i++){
1944
1940
    direntry = direntries[i];
1945
1941
    if(debug){
3065
3061
                                                | O_PATH));
3066
3062
    if(dir_fd == -1){
3067
3063
      perror_plus("open");
3068
 
      return;
3069
3064
    }
3070
3065
    int numentries = scandirat(dir_fd, ".", &direntries,
3071
3066
                               notdotentries, alphasort);
3088
3083
            clean_dir_at(dir_fd, direntries[i]->d_name, level+1);
3089
3084
            dret = 0;
3090
3085
          }
3091
 
          if((dret == -1) and (errno != ENOENT)){
 
3086
          if(dret == -1){
3092
3087
            fprintf_plus(stderr, "unlink(\"%s/%s\"): %s\n", dirname,
3093
3088
                         direntries[i]->d_name, strerror(errno));
3094
3089
          }
3098
3093
      
3099
3094
      /* need to clean even if 0 because man page doesn't specify */
3100
3095
      free(direntries);
 
3096
      if(numentries == -1){
 
3097
        perror_plus("scandirat");
 
3098
      }
3101
3099
      dret = unlinkat(base, dirname, AT_REMOVEDIR);
3102
3100
      if(dret == -1 and errno != ENOENT){
3103
3101
        perror_plus("rmdir");