File squilt-20251029.56b4c47.obscpio of Package squilt

07070100000000000081A40000000000000000000000016902117E00000430000000000000000000000000000000000000002000000000squilt-20251029.56b4c47/LICENSEMIT License

Copyright (c) 2018 Johannes Segitz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
07070100000001000081A40000000000000000000000016902117E000002C1000000000000000000000000000000000000002200000000squilt-20251029.56b4c47/README.md# squilt
Wrapper to confine quilt with [bubblewrap](https://github.com/containers/bubblewrap)

Previous versions used [nsjail](https://github.com/google/nsjail).

# Why?
Using quilt on untrusted spec files is not secure. For more see
[this posting by Matthias](https://www.openwall.com/lists/oss-security/2018/09/27/2).

Matthias developed the original exploit, but as described in the posting, any
command in %prep is run as the user calling quilt without any limitations. This
was (at least to us) unexpected.

# Usage
If you add an alias quilt=squilt or copy this script as 'quilt' to a directory
that is earlier in $PATH you should be able to use it like you use quilt without
noticying a difference.
07070100000002000081ED0000000000000000000000016902117E00000488000000000000000000000000000000000000001F00000000squilt-20251029.56b4c47/squilt#!/bin/sh

# Start with the base bwrap arguments in an array
bwrap_args=(
  --symlink usr/bin /bin
  --symlink usr/lib /lib
  --symlink usr/lib64 /lib64
  --ro-bind /usr /usr
  --proc /proc
  --dev /dev
  --tmpfs /tmp
  --dir /var
  --tmpfs /var/tmp
  --tmpfs "$HOME/rpmbuild"
  --unshare-all
  --share-net
  --die-with-parent
)

# Handle the system-wide config
if [[ -f "/etc/quilt.quiltrc" ]]; then
  bwrap_args+=(--dir /etc)
  bwrap_args+=(--ro-bind /etc/quilt.quiltrc /etc/quilt.quiltrc)
fi

# Handle the user-specific config
if [[ -f "$HOME/.quiltrc" ]]; then
  bwrap_args+=(--dir "$HOME")
  bwrap_args+=(--ro-bind "$HOME/.quiltrc" "$HOME/.quiltrc")
fi

# Add the writable current directory
bwrap_args+=(--dir "$PWD")
bwrap_args+=(--bind "$PWD" "$PWD")

# Check if we're in a source directory with a patches symlink and make that
# writeable as well
if [ "$(readlink patches)" = "../.." ]; then
  MAIN_SOURCE_DIR=$(realpath "$PWD/../../")
  bwrap_args+=(--dir "$MAIN_SOURCE_DIR")
  bwrap_args+=(--bind "$MAIN_SOURCE_DIR" "$MAIN_SOURCE_DIR")
fi

# The command to run
bwrap_args+=(/usr/bin/quilt "$@")

# Execute the final command
bwrap "${bwrap_args[@]}"

07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!7 blocks
openSUSE Build Service is sponsored by