Просмотр исходного кода

* apt-pkg/depcache.cc:
- always chmod extended_states to 0644

Michael Vogt лет назад: 19
Родитель
Сommit
8a3a2e994e
2 измененных файлов с 5 добавлено и 1 удалено
  1. 4 1
      apt-pkg/depcache.cc
  2. 1 0
      cmdline/apt-mark

+ 4 - 1
apt-pkg/depcache.cc

@@ -26,6 +26,8 @@
 #include <sstream>    
 #include <sstream>    
 #include <set>
 #include <set>
 
 
+#include <sys/stat.h>
+
 #include <apti18n.h>    
 #include <apti18n.h>    
 
 
 pkgDepCache::ActionGroup::ActionGroup(pkgDepCache &cache) :
 pkgDepCache::ActionGroup::ActionGroup(pkgDepCache &cache) :
@@ -253,8 +255,9 @@ bool pkgDepCache::writeStateFile(OpProgress *prog)
    }
    }
    fclose(OutFile);
    fclose(OutFile);
 
 
-   // move the outfile over the real file
+   // move the outfile over the real file and set permissions
    rename(outfile.c_str(), state.c_str());
    rename(outfile.c_str(), state.c_str());
+   chmod(state.c_str(), 0644);
 
 
    return true;
    return true;
 }
 }

+ 1 - 0
cmdline/apt-mark

@@ -61,3 +61,4 @@ if __name__ == "__main__":
                 outfile.write(str(tagfile.Section)+"\n")
                 outfile.write(str(tagfile.Section)+"\n")
         # all done, rename the tmpfile
         # all done, rename the tmpfile
         os.rename(outfile.name, STATE_FILE)
         os.rename(outfile.name, STATE_FILE)
+        os.chmod(outfile.name, 0644)