summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2005-09-18 10:44:25 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2005-09-18 10:44:25 +0000
commit652b57c94099e205c8881444c425d88b24f42530 (patch)
tree6688179ba3ce6112d896fdfb3b79465e180fa75f
parent8ec517a521107ca5d69216640cbdf0e0b31f3361 (diff)
Relevant BUGIDs: none
Purpose of commit: bugfix Commit summary: --------------- check if argument which we try to access exists
-rw-r--r--modules/pam_selinux/pam_selinux_check.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/pam_selinux/pam_selinux_check.c b/modules/pam_selinux/pam_selinux_check.c
index 6ff3fbc0..73c77fa0 100644
--- a/modules/pam_selinux/pam_selinux_check.c
+++ b/modules/pam_selinux/pam_selinux_check.c
@@ -121,6 +121,9 @@ main (int argc, char **argv)
pam_handle_t *pamh;
int childPid;
+ if (argc < 1)
+ exit (-1);
+
if (!authenticate_via_pam(argv[1],&pamh))
exit(-1);
@@ -149,7 +152,7 @@ main (int argc, char **argv)
pam_end( pamh, PAM_SUCCESS );
exit(0);
}
- argv[0]="/bin/sh";
+ argv[0]=strdup ("/bin/sh");
argv[1]=NULL;
/* NOTE: The environment has not been sanitized. LD_PRELOAD and other fun