[Pkg-privacy-commits] [libgsecuredelete] 131/168: sfill wrapper: Don't leave a temporary directory when becoming root

Ulrike Uhlig u-guest at moszumanska.debian.org
Thu Jul 7 20:06:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch master
in repository libgsecuredelete.

commit f9e9ed4ba26b617957ee797569e79f045deedcb3
Author: Colomban Wendling <ban at herbesfolles.org>
Date:   Tue Jun 12 03:09:40 2012 +0200

    sfill wrapper: Don't leave a temporary directory when becoming root
    
    Set up temporary directory removal before trying to become root so it
    will get removed even if we exit prematurely after having gained root
    privileges.
---
 gsd-sfill-helper.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gsd-sfill-helper.in b/gsd-sfill-helper.in
index b01d968..809fc5a 100644
--- a/gsd-sfill-helper.in
+++ b/gsd-sfill-helper.in
@@ -113,6 +113,10 @@ progress_step() {
 }
 
 
+trap "rm -rf '$dir'" EXIT
+trap cleanup INT QUIT TERM
+
+
 if [ `whoami` != root ]; then
   # before trying to become root, check whether the FS on which we will work
   # actually requires root privileges
@@ -139,10 +143,6 @@ if [ `whoami` != root ]; then
 fi
 
 
-trap "rm -rf '$dir'" EXIT
-trap cleanup INT QUIT TERM
-
-
 # fill disk space, workaround for file size limit
 if [ -z "$OPT_i" ]; then
   input=/dev/zero

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/libgsecuredelete.git



More information about the Pkg-privacy-commits mailing list