-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #259 from Gottox/improve/ls-better-escape
Improve/ls better escape
- Loading branch information
Showing
10 changed files
with
184 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh -ex | ||
|
||
###################################################################### | ||
# @author Enno Boland ([email protected]) | ||
# @file escape.sh | ||
# @created Monday Nov 20, 2023 18:24:05 CET | ||
|
||
# | ||
# @description This script creates a squashfs image, mounts it, and | ||
# repacks it from the mounted path. | ||
###################################################################### | ||
|
||
: "${BUILD_DIR:?BUILD_DIR is not set}" | ||
: "${MKSQUASHFS:?MKSQUASHFS is not set}" | ||
: "${SOURCE_ROOT:?SOURCE_ROOT is not set}" | ||
: "${SQSH_LS:?SQSH_UNPACK is not set}" | ||
|
||
MKSQUASHFS_OPTS="-no-xattrs -noappend -all-root -mkfs-time 0" | ||
|
||
WORK_DIR="$BUILD_DIR/escape" | ||
|
||
mkdir -p "$WORK_DIR" | ||
cd "$WORK_DIR" | ||
|
||
mkdir -p "$PWD/empty" | ||
|
||
printf "dir\e d 777 0 0\n" > "$PWD/escape.pseudo"; | ||
|
||
# shellcheck disable=SC2086 | ||
$MKSQUASHFS "$PWD/empty" "$PWD/escape.squashfs" -pf "$PWD/escape.pseudo" \ | ||
$MKSQUASHFS_OPTS | ||
result="$($SQSH_LS -r --escape "$PWD/escape.squashfs")" | ||
[ "$result" = "$(printf "%s" "/dir\e")" ] | ||
|
||
result="$($SQSH_LS -r --raw "$PWD/escape.squashfs")" | ||
[ "$result" = "$(printf "/dir\e")" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.