Browse Source

Use semver to compare kernel versions properly

Charles Lehner 10 years ago
parent
commit
10d9d53630
2 changed files with 5 additions and 2 deletions
  1. 2 1
      package.json
  2. 3 1
      util/Seccomp.js

+ 2 - 1
package.json

@@ -4,6 +4,7 @@
     "dependencies": {
         "nthen": "~0.1.1",
         "node.extend": "~1.0.8",
-        "jshint": "2.4.1"
+        "jshint": "2.4.1",
+        "semver": "^2.3.1"
     }
 }

+ 3 - 1
util/Seccomp.js

@@ -13,6 +13,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+var Semver = require('semver');
+
 var TEST_PROGRAM = [
     "#include <sys/resource.h>",
     "#include <sys/prctl.h>",
@@ -54,7 +56,7 @@ var detect = module.exports.detect = function (async, file, builder)
         console.log("SECCOMP is only available on linux");
     } else if (process.env['Seccomp_NO']) {
         console.log("SECCOMP disabled");
-    } else if (builder.config.systemRelease < "3.5") {
+    } else if (Semver.lt(builder.config.systemRelease, "3.5.0")) {
         console.log("SECCOMP filtering is only available in Linux 3.5+");
     } else {
         var done = async();