mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Make spa_history_zone platform-dependent in kernel
This function should only return "linux" on Linux. Move the kernel part of the function out of common code. Fix the tests for FreeBSD. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10079
This commit is contained in:
@@ -51,11 +51,11 @@ function run_and_verify
|
||||
fullcmd="$1"
|
||||
flags="$2"
|
||||
|
||||
if is_linux; then
|
||||
if is_illumos; then
|
||||
histcmd=$(echo $fullcmd | sed 's/\/usr\/sbin\///g')
|
||||
else
|
||||
histcmd=$(echo $fullcmd | sed 's/^.*\/\(zpool .*\).*$/\1/')
|
||||
histcmd=$(echo $histcmd | sed 's/^.*\/\(zfs .*\).*$/\1/')
|
||||
else
|
||||
histcmd=$(echo $fullcmd | sed 's/\/usr\/sbin\///g')
|
||||
fi
|
||||
|
||||
cmd=$(echo $histcmd | awk '{print $1}')
|
||||
@@ -112,10 +112,11 @@ function verify_long
|
||||
typeset suffix=""
|
||||
if is_linux; then
|
||||
suffix=":linux"
|
||||
elif is_freebsd; then
|
||||
suffix=":freebsd"
|
||||
fi
|
||||
|
||||
grep "$cmd \[user $uid ($user) on $hname$suffix\]" \
|
||||
$NEW_HISTORY >/dev/null 2>&1
|
||||
grep -q "$cmd \[user $uid ($user) on $hname$suffix\]" $NEW_HISTORY
|
||||
if [[ $? != 0 ]]; then
|
||||
log_note "Couldn't find long information for \"$cmd\""
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user