From 53389b574397b32d8343319b8bb94fc93c4c8c05 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 27 Jan 2023 14:44:45 -0700 Subject: [PATCH] Recognize Alma Linux and Rocky Linux (Open Source RHEL clones) --- etc/sudo-logsrvd.pp | 4 ++-- etc/sudo-python.pp | 4 ++-- etc/sudo.pp | 4 ++-- scripts/mkpkg | 4 ++-- scripts/pp | 4 +++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/etc/sudo-logsrvd.pp b/etc/sudo-logsrvd.pp index 242b21986..2928c5be3 100644 --- a/etc/sudo-logsrvd.pp +++ b/etc/sudo-logsrvd.pp @@ -87,7 +87,7 @@ This makes it possible to have all sudo I/O logs on a central server." # For RedHat the doc dir is expected to include version and release case "$pp_rpm_distro" in - centos*|rhel*|f[0-9]*) + alma*|centos*|rhel*|rocky*|f[0-9]*) docdir="${docdir}-${pp_rpm_version}-${pp_rpm_release}" exampledir="${docdir}/examples" ;; @@ -131,7 +131,7 @@ This makes it possible to have all sudo I/O logs on a central server." # Add distro info to release osrelease=`echo "$pp_rpm_distro" | sed -e 's/^[^0-9]*\([0-9]\{1,2\}\).*/\1/'` case "$pp_rpm_distro" in - centos*|rhel*|f[0-9]*) + alma*|centos*|rhel*|rocky*|f[0-9]*) # CentOS Stream has a single-digit version if test $osrelease -lt 10; then osrelease="${osrelease}0" diff --git a/etc/sudo-python.pp b/etc/sudo-python.pp index 9250da4f7..2cc2fd64c 100644 --- a/etc/sudo-python.pp +++ b/etc/sudo-python.pp @@ -47,7 +47,7 @@ # For RedHat the doc dir is expected to include version and release case "$pp_rpm_distro" in - centos*|rhel*|f[0-9]*) + alma*|centos*|rhel*|rocky*|f[0-9]*) docdir="${docdir}-${pp_rpm_version}-${pp_rpm_release}" exampledir="${docdir}/examples" ;; @@ -87,7 +87,7 @@ # Add distro info to release osrelease=`echo "$pp_rpm_distro" | sed -e 's/^[^0-9]*\([0-9]\{1,2\}\).*/\1/'` case "$pp_rpm_distro" in - centos*|rhel*|f[0-9]*) + alma*|centos*|rhel*|rocky*|f[0-9]*) # CentOS Stream has a single-digit version if test $osrelease -lt 10; then osrelease="${osrelease}0" diff --git a/etc/sudo.pp b/etc/sudo.pp index 2941ede60..948ffa4f9 100644 --- a/etc/sudo.pp +++ b/etc/sudo.pp @@ -105,7 +105,7 @@ still allow people to get their work done." # For RedHat the doc dir is expected to include version and release case "$pp_rpm_distro" in - centos*|rhel*|f[0-9]*) + alma*|centos*|rhel*|rocky*|f[0-9]*) docdir="${docdir}-${pp_rpm_version}-${pp_rpm_release}" exampledir="${docdir}/examples" ;; @@ -162,7 +162,7 @@ still allow people to get their work done." # Add distro info to release osrelease=`echo "$pp_rpm_distro" | sed -e 's/^[^0-9]*\([0-9]\{1,2\}\).*/\1/'` case "$pp_rpm_distro" in - centos*|rhel*|f[0-9]*) + alma*|centos*|rhel*|rocky*|f[0-9]*) # CentOS Stream has a single-digit version if test $osrelease -lt 10; then osrelease="${osrelease}0" diff --git a/scripts/mkpkg b/scripts/mkpkg index dd4f4492f..3e6a64094 100755 --- a/scripts/mkpkg +++ b/scripts/mkpkg @@ -165,9 +165,9 @@ with_python=false # Choose configure options by osversion. # We use the same configure options as vendor packages when possible. case "$osversion" in - centos*|rhel*|f[0-9]*) + alma*|centos*|rhel*|rocky*|f[0-9]*) case "$osversion" in - centos*|rhel*) + alma*|centos*|rhel*|rocky*) osmajor=`sed -n -e 's/^.*release \([0-9][0-9]*\).*$/\1/p' /etc/redhat-release` if [ $osmajor -ge 4 ]; then # RHEL 4 and up support SELinux diff --git a/scripts/pp b/scripts/pp index f5c689c05..d2a716c0f 100755 --- a/scripts/pp +++ b/scripts/pp @@ -1,6 +1,6 @@ #!/bin/sh # Copyright 2023 One Identity LLC. ALL RIGHTS RESERVED -pp_revision="20230120" +pp_revision="20230127" # Copyright 2018 One Identity LLC. ALL RIGHTS RESERVED. # # Redistribution and use in source and binary forms, with or without @@ -5569,6 +5569,8 @@ pp_rpm_detect_distro () { pp_rpm_distro=`sed -n \ -e 's/^Red Hat Linux.*release \([0-9][0-9\.]*\).*/rh\1/p' \ -e 's/^Red Hat Enterprise Linux.*release \([0-9][0-9\.]*\).*/rhel\1/p' \ + -e 's/^Rocky Linux.*release \([0-9][0-9\.]*\).*/rocky\1/p' \ + -e 's/^AlmaLinux.*release \([0-9][0-9\.]*\).*/alma\1/p' \ -e 's/^CentOS.*release \([0-9][0-9\.]*\).*/centos\1/p' \ /etc/redhat-release` elif test -f /etc/SuSE-release; then