Skip to content

Commit

Permalink
Try harder at scanning kernel releases (Closes #720891)
Browse files Browse the repository at this point in the history
  • Loading branch information
comotion committed Jan 6, 2014
1 parent 0497c49 commit 8c23b2e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions security.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,14 @@ int check_kernel_version()
}else if(!strncmp(uts.sysname, "Linux", 5)){
int maj,min,rel;
if(sscanf(uts.release, "%d.%d.%d", &maj, &min, &rel) != 3) {
fprintf(stderr, "%s (%s, %d)\n",
_("Failed to scan kernel release."),
strerror(errno),errno);
// maybe it's a 3.10-rc3 release.
if(sscanf(uts.release, "%d.%d", &maj, &min) != 2) {
fprintf(stderr, "%s (%s, %d)\n",
_("Failed to scan kernel release."),
strerror(errno),errno);
return 0;
}
rel = 9; // instead of passing garbage
}else{
//fprintf(stdout, "kernel rel: %d.%d\n", maj, min);
if(maj > 2 ||
Expand Down

0 comments on commit 8c23b2e

Please sign in to comment.