diff options
author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2009-10-29 18:27:46 +0000 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2009-10-29 18:27:46 +0000 |
commit | 5691314ef0f225c86453328710c7fbd87f925080 (patch) | |
tree | 607a197a4b506d6d66bff3a43f74f0477cc0539f /security/wipe/files/patch-prompt.c | |
parent | - Forgot to add the new file into distinfo (diff) |
- fix the core dump when wiping e.g. /tmp/testfile ([1])
- fix permissions handling ([2])
PR: 139611 [1], 139637 [2]
Submitted by: Michael <bug_report@arcor.de> [1], Christoph Weber-Fahr <cwf-ml@arcor.de> [2]
Patch by: Rob Farmer <rfarmer@predatorlabs.net> (maintainer)
Notes
Notes:
svn path=/head/; revision=243482
Diffstat (limited to 'security/wipe/files/patch-prompt.c')
-rw-r--r-- | security/wipe/files/patch-prompt.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/security/wipe/files/patch-prompt.c b/security/wipe/files/patch-prompt.c new file mode 100644 index 000000000000..c08de188dfca --- /dev/null +++ b/security/wipe/files/patch-prompt.c @@ -0,0 +1,37 @@ +--- prompt.c.orig 2009-04-25 20:18:13.000000000 -0700 ++++ prompt.c 2009-10-18 15:29:39.000000000 -0700 +@@ -41,9 +41,9 @@ + + #include "std.h" + #include "percent.h" ++#include "main.h" + #include "file.h" + #include "dir.h" +-#include "main.h" + #include "wipe.h" + #include "blkdev.h" + #include "prompt.h" +@@ -69,7 +69,10 @@ + } + #endif + +- if (options.force) goto destroy; ++ if (options.force){ ++ chmod(f->real_name, S_IRWXU); ++ goto destroy; ++ } + + permdenied = access(f->name, perm); + if (options.interactive) /* force overrides interaction */ +@@ -119,7 +122,10 @@ + + fgets(prompt, sizeof(prompt), stdin); + +- if (prompt[0] == 'y' || prompt[0] == 'Y') goto destroy; ++ if (prompt[0] == 'y' || prompt[0] == 'Y'){ ++ chmod(f->real_name, S_IRWXU); ++ goto destroy; ++ } + if (prompt[0] == 'n' || prompt[0] == 'N') return; + } + } |