Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-crates-io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1.0.3
id: auth
- run: cargo publish
- run: cargo publish --locked
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Check that the actual checksums match what we expected. If not fail
# the release and have the person doing the release check again for
# reproducability problems.
# reproducibility problems.
cat expected_checksums.txt
diff -u expected_checksums.txt target/pkg/SHA256SUMS

Expand Down
15 changes: 0 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@ rust-version = "1.70"

default-run = "sudo"

[lib]
path = "src/lib.rs"

[[bin]]
name = "sudo"
path = "bin/sudo.rs"

[[bin]]
name = "su"
path = "bin/su.rs"

[[bin]]
name = "visudo"
path = "bin/visudo.rs"

[dependencies]
libc = "0.2.152"
glob = "0.3.0"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PAM_SRC_DIR = src/pam

BINDGEN_CMD = bindgen --allowlist-function '^pam_.*$$' --allowlist-var '^PAM_.*$$' --opaque-type pam_handle_t --blocklist-function pam_vsyslog --blocklist-function pam_vprompt --blocklist-function pam_vinfo --blocklist-function pam_verror --blocklist-type '.*va_list.*' --ctypes-prefix libc --no-layout-tests --sort-semantically

PAM_VARIANT = $$(./get-pam-variant.bash)
PAM_VARIANT = $$(./util/get-pam-variant.bash)

.PHONY: all clean pam-sys pam-sys-diff

Expand Down
1 change: 0 additions & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
msrv = "1.70"
check-private-items = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 6 additions & 11 deletions util/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,23 @@ TARGET_DIR_BASE="$PROJECT_DIR/target/pkg"

set -eo pipefail

# Clear any previous builds
rm -rf "$TARGET_DIR_BASE"

# Fetch the date from the changelog
DATE=$(grep -m1 '^##' "$PROJECT_DIR"/CHANGELOG.md | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}')

# Build binaries
docker build --pull --tag "$BUILDER_IMAGE_TAG" --file "$SCRIPT_DIR/Dockerfile-release" "$SCRIPT_DIR"
docker run --rm --user "$(id -u):$(id -g)" -v "$PROJECT_DIR:/build" -w "/build" "$BUILDER_IMAGE_TAG" cargo clean
docker run --rm --user "$(id -u):$(id -g)" -v "$PROJECT_DIR:/build" -w "/build" "$BUILDER_IMAGE_TAG" cargo build --release --features pam-login,apparmor

# Generate man pages
"$PROJECT_DIR/util/generate-docs.sh"
docker run --rm --user "$(id -u):$(id -g)" -v "$PROJECT_DIR:/build" -w "/build" "$BUILDER_IMAGE_TAG" cargo clean --locked
docker run --rm --user "$(id -u):$(id -g)" -v "$PROJECT_DIR:/build" -w "/build" "$BUILDER_IMAGE_TAG" cargo build --locked --release --features pam-login,apparmor

# Set target directories and clear any previous builds
# Set target directories
target_dir_sudo="$TARGET_DIR_BASE/sudo"
target_dir_su="$TARGET_DIR_BASE/su"
target_sudo="$TARGET_DIR_BASE/sudo-$SUDO_RS_VERSION.tar.gz"
target_su="$TARGET_DIR_BASE/su-$SUDO_RS_VERSION.tar.gz"

rm -rf "$target_dir_sudo"
rm -rf "$target_dir_su"
rm -rf "$target_su"
rm -rf "$target_sudo"

# Show what is happening
set -x

Expand Down
8 changes: 7 additions & 1 deletion util/generate-docs.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/usr/bin/env bash

set -eo pipefail

docs_dir="docs/man"
files=("sudo.8" "visudo.8" "sudoers.5" "su.1")

function docker_pandoc() {
docker run --rm -i -v "$(pwd):/data" -u "$(id -u):$(id -g)" "pandoc/core@sha256:668f5ced9d99ed0fd8b0efda93d6cead066565bb400fc1fb165e77ddbb586a16" "$@"
}

for f in "${files[@]}"; do
origin_file="$docs_dir/$f.md"
target_file="$docs_dir/$f.man"

echo "Generating man page for $f from '$origin_file' to '$target_file'"
util/pandoc.sh -s -t man "$origin_file" -o "$target_file"
docker_pandoc -s -t man "$origin_file" -o "$target_file"
done
File renamed without changes.
3 changes: 0 additions & 3 deletions util/pandoc.sh

This file was deleted.

4 changes: 4 additions & 0 deletions util/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@ sed -i 's/^title: SUDO(8) sudo-rs .*/title: SUDO(8) sudo-rs '"$NEW_VERSION"' | s
sed -i 's/^title: VISUDO(8) sudo-rs .*/title: VISUDO(8) sudo-rs '"$NEW_VERSION"' | sudo-rs/' "$PROJECT_DIR"/docs/man/visudo.8.md
sed -i 's/^title: SUDOERS(5) sudo-rs .*/title: SUDOERS(5) sudo-rs '"$NEW_VERSION"' | sudo-rs/' "$PROJECT_DIR"/docs/man/sudoers.5.md

echo "Regenerate man pages"
"$PROJECT_DIR/util/generate-docs.sh"

echo "Rebuilding project"
# NOTE: Not using --locked as Cargo.lock needs to be updated with the new version
(cd $PROJECT_DIR && cargo build --release)
Loading