X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/dd09a217ac0d331f4a0324cf42559da5d35edc9a..9b9eb42ace92e3dd2e0a3e5fcaeb251708517106:/cmdline/apt-mark

diff --git a/cmdline/apt-mark b/cmdline/apt-mark
index 533ed8715..f6e749eb5 100755
--- a/cmdline/apt-mark
+++ b/cmdline/apt-mark
@@ -40,7 +40,7 @@ if __name__ == "__main__":
     if not options.filename:
         STATE_FILE = apt_pkg.Config.FindDir("Dir::State") + "extended_states"
     else:
-        STATE_FILE=options.state_file
+        STATE_FILE=options.filename
 
     # open the statefile
     if os.path.exists(STATE_FILE):
@@ -60,4 +60,6 @@ if __name__ == "__main__":
             else:
                 outfile.write(str(tagfile.Section)+"\n")
         # all done, rename the tmpfile
+        os.chmod(outfile.name, 0644)
         os.rename(outfile.name, STATE_FILE)
+        os.chmod(STATE_FILE, 0644)