From 8c23b2e855a9f11520f2a86ed281f2b54544176b Mon Sep 17 00:00:00 2001 From: Kacper Wysocki Date: Mon, 6 Jan 2014 12:33:07 +0100 Subject: [PATCH] Try harder at scanning kernel releases (Closes #720891) --- security.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/security.c b/security.c index ac2e471..9f70e00 100644 --- a/security.c +++ b/security.c @@ -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 ||