Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from ybznek/v0-8-bash
Browse files Browse the repository at this point in the history
bash: fix quotes
  • Loading branch information
mpreisler committed Aug 17, 2015
2 parents 3f1fed4 + b37c82f commit 65f1d97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions scap-workbench-oscap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ for i in $(seq 0 `expr $# - 1`); do

case "${args[i]}" in
("--results")
TARGET_RESULTS_XCCDF=${args[j]}
TARGET_RESULTS_XCCDF="${args[j]}"
args[j]="$TEMP_DIR/results-xccdf.xml"
;;
("--results-arf")
TARGET_RESULTS_ARF=${args[j]}
TARGET_RESULTS_ARF="${args[j]}"
args[j]="$TEMP_DIR/results-arf.xml"
;;
("--report")
TARGET_REPORT=${args[j]}
TARGET_REPORT="${args[j]}"
args[j]="$TEMP_DIR/report.html"
;;
*)
Expand All @@ -64,7 +64,7 @@ done
LOCAL_OSCAP="oscap"

pushd "$TEMP_DIR" > /dev/null
$LOCAL_OSCAP ${args[@]} &
$LOCAL_OSCAP "${args[@]}" &
PID=$!
RET=1

Expand All @@ -86,8 +86,8 @@ popd > /dev/null

function chown_copy
{
local what=$1
local where=$2
local what="$1"
local where="$2"

[ ! -f "$what" ] || cp "$what" "$where"

Expand All @@ -97,9 +97,9 @@ function chown_copy
fi
}

chown_copy "$TEMP_DIR/results-xccdf.xml" $TARGET_RESULTS_XCCDF
chown_copy "$TEMP_DIR/results-arf.xml" $TARGET_RESULTS_ARF
chown_copy "$TEMP_DIR/report.html" $TARGET_REPORT
chown_copy "$TEMP_DIR/results-xccdf.xml" "$TARGET_RESULTS_XCCDF"
chown_copy "$TEMP_DIR/results-arf.xml" "$TARGET_RESULTS_ARF"
chown_copy "$TEMP_DIR/report.html" "$TARGET_REPORT"

rm -r "$TEMP_DIR"

Expand Down
4 changes: 2 additions & 2 deletions scap-workbench-pkexec-oscap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SCAP_WORKBENCH_OSCAP="$PARENT_DIR/scap-workbench-oscap.sh"
# We run unprivileged if pkexec was not found.
#which $PKEXEC_PATH > /dev/null || exit 1 # fail if pkexec was not found

$PKEXEC_PATH --disable-internal-agent $SCAP_WORKBENCH_OSCAP $uid $gid $@ 2> >(tail -n +2 1>&2)
$PKEXEC_PATH --disable-internal-agent "$SCAP_WORKBENCH_OSCAP" $uid $gid "$@" 2> >(tail -n +2 1>&2)
EC=$?

# 126 is a special exit code of pkexec when user dismisses the auth dialog
Expand All @@ -38,7 +38,7 @@ EC=$?
# This is common in niche desktop environments.
if [ $EC -eq 126 ] || [ $EC -eq 127 ]; then
# in case of dismissed dialog we run without super user rights
$SCAP_WORKBENCH_OSCAP $uid $gid $@ 2> >(tail -n +2 1>&2);
"$SCAP_WORKBENCH_OSCAP" $uid $gid "$@" 2> >(tail -n +2 1>&2);
exit $?
fi

Expand Down

0 comments on commit 65f1d97

Please sign in to comment.