Skip to content

Commit

Permalink
fix env path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AlkenePan committed Oct 25, 2022
1 parent 2a3bd69 commit fcb5d73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions rasp/librasp/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ impl RASPManager {
pid.to_string().as_str(),
"sh",
"-c",
"PATH=/bin:/usr/bin:/sbin",
format!(
"mkdir -p {} && echo '{}' > {} && mv {} {}",
config_dir, message, config_path_bak, config_path_bak, config_path
Expand Down
6 changes: 4 additions & 2 deletions rasp/mount_script
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ while read A B C SUBROOT MOUNT JUNK
do [ $MOUNT = $FILESYS ] && break
done < /proc/self/mountinfo

[ $MOUNT = $FILESYS ] # Moar sanity check!
[ $MOUNT = $FILESYS ] # More sanity check!
SUBPATH=$(echo $REALPATH | sed s,^$FILESYS,,)
DEVDEC=$(printf "%d %d" $(stat --format "0x%t 0x%T" $DEV))
run_command="$NSENTER_PATH --target $PID --mount --uts --ipc --net --pid -- sh -c"
run_command="$NSENTER_PATH --target $PID --mount --uts --ipc --net --pid -- sh -c PATH=/usr/bin:/bin:/sbin"
if [ `$run_command "mount|grep $CONTPATH|wc -l"` -ne 0 ];then
echo "container mount dir $CONTPATH is mounting!"
exit 0
Expand All @@ -43,6 +43,8 @@ $run_command "rmdir /tmpmnt"
check_result=`$run_command "mount|grep $CONTPATH|wc -l"`
if [ $check_result -ne 0 ];then
echo "dynamic mount physics $HOSTPATH on $PID $CONTPATH is success!"
exit 0
else
echo "dynamic mount physics $HOSTPATH on $PID $CONTPATH is fail!"
exit 1
fi

0 comments on commit fcb5d73

Please sign in to comment.