358.09

parent 4aa59f86
...@@ -228,6 +228,7 @@ static int modprobe_helper(const int print_errors, const char *module_name) ...@@ -228,6 +228,7 @@ static int modprobe_helper(const int print_errors, const char *module_name)
{ {
char modprobe_path[NV_PROC_MODPROBE_PATH_MAX]; char modprobe_path[NV_PROC_MODPROBE_PATH_MAX];
int status = 1; int status = 1;
struct stat file_status;
pid_t pid; pid_t pid;
const char *envp[] = { "PATH=/sbin", NULL }; const char *envp[] = { "PATH=/sbin", NULL };
FILE *fp; FILE *fp;
...@@ -322,6 +323,15 @@ static int modprobe_helper(const int print_errors, const char *module_name) ...@@ -322,6 +323,15 @@ static int modprobe_helper(const int print_errors, const char *module_name)
sprintf(modprobe_path, "/sbin/modprobe"); sprintf(modprobe_path, "/sbin/modprobe");
} }
/* Do not attempt to exec(3) modprobe if it does not exist. */
if (stat(modprobe_path, &file_status) != 0 ||
!S_ISREG(file_status.st_mode) ||
(file_status.st_mode & S_IXUSR) != S_IXUSR)
{
return 0;
}
/* Fork and exec modprobe from the child process. */ /* Fork and exec modprobe from the child process. */
switch (pid = fork()) switch (pid = fork())
......
NVIDIA_VERSION = 355.11 NVIDIA_VERSION = 358.09
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment