From 652b57c94099e205c8881444c425d88b24f42530 Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Sun, 18 Sep 2005 10:44:25 +0000 Subject: Relevant BUGIDs: none Purpose of commit: bugfix Commit summary: --------------- check if argument which we try to access exists --- modules/pam_selinux/pam_selinux_check.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/pam_selinux/pam_selinux_check.c') 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 -- cgit v1.2.3