From af3120209183845981617cf574ec1cb5d62a2abf Mon Sep 17 00:00:00 2001 From: mboelen Date: Wed, 16 Mar 2016 20:29:05 +0100 Subject: Show permission warning while allowing users to continue --- lynis | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'lynis') diff --git a/lynis b/lynis index 7cc8c06c..aa7f195d 100755 --- a/lynis +++ b/lynis @@ -137,37 +137,38 @@ echo "[!] Change ownership of ${INCLUDEDIR}/${FILE} to 'root' or similar (found: ${OWNER} with UID ${OWNERID})." echo "" echo " Command:" - echo " # chown root:root ${INCLUDEDIR}/${FILE}" + echo " # chown 0:0 ${INCLUDEDIR}/${FILE}" echo "" - echo " Note: on some systems the default group might be 'wheel'. Use 'chown root:wheel' instead on the files." echo "" fi - if [ ${ISSUE} -eq 0 ]; then - . ${INCLUDEDIR}/consts - . ${INCLUDEDIR}/functions - else + # Now if there is an issue with permissions, show it to the user and let them decide how to continue. + if [ ${ISSUE} -eq 1 ]; then echo ""; echo ""; echo "[X] Security check failed: See action above, to correct this issue." echo "" echo " Why do I see this error?" echo " -------------------------------" - echo " This is a protection mechanism, to prevent the root user from executing user created files." + echo " This is a protection mechanism to prevent the root user from executing user created files." echo ""; echo "" echo " What can I do?" echo " ---------------------" - echo " 1) Check if a trusted user created the files (e.g. you, by using Git, Homebrew or similar)" + echo " 1) Check if a trusted user created the files, by using Git, Homebrew or similar" echo "" echo " 2) Change ownership and permissions of the related files (or full directory)." echo "" echo " Commands (full directory):" echo " # cd .." - echo " # chown -R root: lynis" + echo " # chown -R 0:0 lynis" echo "" echo " 3) Start Lynis again (cd lynis && ./lynis)." echo ""; echo ""; - exit 1 + echo "[ Press ENTER to continue, or CTRL+C to cancel ]" + read DUMMY fi + . ${INCLUDEDIR}/consts + . ${INCLUDEDIR}/functions + # ################################################################################# # -- cgit v1.2.3