lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 28 Jun 2016 13:19:05 +0300
From:	Alexander Kapshuk <alexander.kapshuk@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	gregkh@...uxfoundation.org,
	Alexander Kapshuk <alexander.kapshuk@...il.com>
Subject: [PATCH 31/32] ver_linux: 'version()' function definition

Definition of the 'version()' function. The function encapsulates the
algorithm that extracts the version number of the utility being queried,
and returns it as a value.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@...il.com>
---
 scripts/ver_linux | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 3bf72ad..27b43ae 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -69,3 +69,14 @@ BEGIN {
 		printversion("Modules Loaded", mods)
 	}
 }
+
+function version(cmd,    ver) {
+	while (cmd | getline > 0) {
+		if (!/ver_linux/ && match($0, /[0-9]+([.]?[0-9]+)+/)) {
+			ver = substr($0, RSTART, RLENGTH)
+			break
+		}
+	}
+	close(cmd)
+	return ver
+}
-- 
2.7.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ