/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 plugin-runner.c

  • Committer: Teddy Hogeborn
  • Date: 2014-03-01 09:47:01 UTC
  • Revision ID: teddy@recompile.se-20140301094701-j0vpnc0fyil6tpdn
* plugin-runner.c (main): Declare "bad_prefixes" and "bad_suffixes"
                          correctly.  Also fix resulting issues with
                          casting to non-const and suppress the
                          warnings thereof.

Show diffs side-by-side

added added

removed removed

Lines of Context:
850
850
    {
851
851
      bool bad_name = false;
852
852
      
853
 
      const char const *bad_prefixes[] = { ".", "#", NULL };
 
853
      const char * const bad_prefixes[] = { ".", "#", NULL };
854
854
      
855
 
      const char const *bad_suffixes[] = { "~", "#", ".dpkg-new",
 
855
      const char * const bad_suffixes[] = { "~", "#", ".dpkg-new",
856
856
                                           ".dpkg-old",
857
857
                                           ".dpkg-bak",
858
858
                                           ".dpkg-divert", NULL };
859
 
      for(const char **pre = bad_prefixes; *pre != NULL; pre++){
 
859
#pragma GCC diagnostic push
 
860
#pragma GCC diagnostic ignored "-Wcast-qual"
 
861
      for(const char **pre = (const char **)bad_prefixes;
 
862
          *pre != NULL; pre++){
 
863
#pragma GCC diagnostic pop
860
864
        size_t pre_len = strlen(*pre);
861
865
        if((d_name_len >= pre_len)
862
866
           and strncmp((dirst->d_name), *pre, pre_len) == 0){
871
875
      if(bad_name){
872
876
        continue;
873
877
      }
874
 
      for(const char **suf = bad_suffixes; *suf != NULL; suf++){
 
878
#pragma GCC diagnostic push
 
879
#pragma GCC diagnostic ignored "-Wcast-qual"
 
880
      for(const char **suf = (const char **)bad_suffixes;
 
881
          *suf != NULL; suf++){
 
882
#pragma GCC diagnostic pop
875
883
        size_t suf_len = strlen(*suf);
876
884
        if((d_name_len >= suf_len)
877
885
           and (strcmp((dirst->d_name) + d_name_len-suf_len, *suf)