aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony G. Basile <basile@opensource.dyc.edu>2011-05-06 22:21:00 -0400
committerAnthony G. Basile <basile@opensource.dyc.edu>2011-05-06 22:21:00 -0400
commite6797b5c11034d79c4e59f659736bfe288104c66 (patch)
tree345666fa496d6ae7607a75d83d97ded418ab22f2 /src
parentpoc/mangle-paxflags.c: added verbose mode (diff)
downloadelfix-e6797b5c11034d79c4e59f659736bfe288104c66.tar.gz
elfix-e6797b5c11034d79c4e59f659736bfe288104c66.tar.bz2
elfix-e6797b5c11034d79c4e59f659736bfe288104c66.zip
poc/mangle-paxflags.c: added quiet mode and fixed whitespaces
Diffstat (limited to 'src')
-rw-r--r--src/fix-gnustack.c4
-rw-r--r--src/paxctl-ng.c23
2 files changed, 16 insertions, 11 deletions
diff --git a/src/fix-gnustack.c b/src/fix-gnustack.c
index 2afd7da..3c12700 100644
--- a/src/fix-gnustack.c
+++ b/src/fix-gnustack.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <string.h>
#include <error.h>
+#include <libgen.h>
#include <gelf.h>
@@ -37,12 +38,13 @@ print_help(char *v)
printf(
"Package Name : " PACKAGE_STRING "\n"
"Bug Reports : " PACKAGE_BUGREPORT "\n"
+ "Program Name : %s\n"
"Description : Check for, or conditionally remove, executable flag from PT_GNU_STACK\n\n"
"Usage : %s {[-f] ELFfile | [-h]}\n"
"options : Print out protection flags on PT_GNU_STACK\n"
" : -f Remove X if WX flags are set on PT_GNU_STACK\n"
" : -h Print out this help\n",
- v
+ basename(v), basename(v)
);
exit(EXIT_SUCCESS);
diff --git a/src/paxctl-ng.c b/src/paxctl-ng.c
index 9f1b86a..0957e36 100644
--- a/src/paxctl-ng.c
+++ b/src/paxctl-ng.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <string.h>
#include <error.h>
+#include <libgen.h>
#include <gelf.h>
@@ -39,12 +40,13 @@
void
print_help(char *v)
{
- printf(
- "Package Name : " PACKAGE_STRING "\n"
- "Bug Reports : " PACKAGE_BUGREPORT "\n"
- "Description : Get or set pax flags on an ELF object\n\n"
- "Usage : %s {[-pPeEmMrRxXsSzZC] ELFfile | [-h]}\n"
- "options : Print out pax flag information\n"
+ printf(
+ "Package Name : " PACKAGE_STRING "\n"
+ "Bug Reports : " PACKAGE_BUGREPORT "\n"
+ "Program Name : %s\n"
+ "Description : Get or set pax flags on an ELF object\n\n"
+ "Usage : %s {[-pPeEmMrRxXsSzZC] ELFfile | [-h]}\n"
+ "options : Print out pax flag information\n"
" : -p Disable PAGEEXEC\t-P Enable PAGEEXEC\n"
" : -e Disable EMUTRAMP\t-E Enable EMUTRAMP\n"
" : -m Disable MPROTECT\t-M Enable MPROTECT\n"
@@ -53,11 +55,12 @@ print_help(char *v)
" : -s Disable SEGMEXEC\t-X Enable SEGMEXEC\n"
" : -z Default least secure\t-Z Default most secure\n"
" : -C Created PT_PAX_FLAGS program header\n"
- " : -h Print out this help\n",
- v
- );
+ " : -h Print out this help\n",
+ basename(v),
+ basename(v)
+ );
- exit(EXIT_SUCCESS);
+ exit(EXIT_SUCCESS);
}