]> granicus.if.org Git - sudo/commitdiff
Only use the first two digits of the version number.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 15 Aug 2014 22:46:24 +0000 (16:46 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 15 Aug 2014 22:46:24 +0000 (16:46 -0600)
Fixes a problem on RHEL 7 which has version numbers like 7.0.1406

sudo.pp

diff --git a/sudo.pp b/sudo.pp
index b7b33544317038d3142f4cdd4ede50398f00967f..1736638bf345107d98bff65ab5c0259fa4a0a0ad 100644 (file)
--- a/sudo.pp
+++ b/sudo.pp
@@ -84,7 +84,7 @@ still allow people to get their work done."
 
 %if [rpm]
        # Add distro info to release
-       osrelease=`echo "$pp_rpm_distro" | sed -e 's/^[^0-9]*//' -e 's/-.*$//'`
+       osrelease=`echo "$pp_rpm_distro" | sed -e 's/^[^0-9]*\([0-9][0-9]\).*/\1/' -e 's/^[^0-9]*\([0-9]\)[^0-9].*/\1/'`
        case "$pp_rpm_distro" in
        centos*|rhel*)
                pp_rpm_release="$pp_rpm_release.el${osrelease%%[0-9]}"