/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
 
      ret = close(dhpfile);
617
 
      if(ret == -1){
618
 
        perror_plus("close");
619
 
      }
620
616
      if(params.data == NULL){
621
617
        dhparamsfilename = NULL;
622
618
      }
1659
1655
      perror_plus("ioctl SIOCGIFFLAGS");
1660
1656
      errno = old_errno;
1661
1657
    }
1662
 
    if((close(s) == -1) and debug){
1663
 
      old_errno = errno;
1664
 
      perror_plus("close");
1665
 
      errno = old_errno;
1666
 
    }
1667
1658
    return false;
1668
1659
  }
1669
 
  if((close(s) == -1) and debug){
1670
 
    old_errno = errno;
1671
 
    perror_plus("close");
1672
 
    errno = old_errno;
1673
 
  }
1674
1660
  return true;
1675
1661
}
1676
1662
 
1937
1923
      return;
1938
1924
    }
1939
1925
  }
1940
 
  int devnull = (int)TEMP_FAILURE_RETRY(open("/dev/null", O_RDONLY));
1941
 
  if(devnull == -1){
1942
 
    perror_plus("open(\"/dev/null\", O_RDONLY)");
1943
 
    return;
1944
 
  }
1945
1926
  int numhooks = scandirat(hookdir_fd, ".", &direntries,
1946
1927
                           runnable_hook, alphasort);
1947
1928
  if(numhooks == -1){
1948
1929
    perror_plus("scandir");
1949
 
    close(devnull);
1950
1930
    return;
1951
1931
  }
1952
1932
  struct dirent *direntry;
1953
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
  }
1954
1939
  for(int i = 0; i < numhooks; i++){
1955
1940
    direntry = direntries[i];
1956
1941
    if(debug){
3076
3061
                                                | O_PATH));
3077
3062
    if(dir_fd == -1){
3078
3063
      perror_plus("open");
3079
 
      return;
3080
3064
    }
3081
3065
    int numentries = scandirat(dir_fd, ".", &direntries,
3082
3066
                               notdotentries, alphasort);
3099
3083
            clean_dir_at(dir_fd, direntries[i]->d_name, level+1);
3100
3084
            dret = 0;
3101
3085
          }
3102
 
          if((dret == -1) and (errno != ENOENT)){
 
3086
          if(dret == -1){
3103
3087
            fprintf_plus(stderr, "unlink(\"%s/%s\"): %s\n", dirname,
3104
3088
                         direntries[i]->d_name, strerror(errno));
3105
3089
          }
3109
3093
      
3110
3094
      /* need to clean even if 0 because man page doesn't specify */
3111
3095
      free(direntries);
 
3096
      if(numentries == -1){
 
3097
        perror_plus("scandirat");
 
3098
      }
3112
3099
      dret = unlinkat(base, dirname, AT_REMOVEDIR);
3113
3100
      if(dret == -1 and errno != ENOENT){
3114
3101
        perror_plus("rmdir");