Skip to content

Commit

Permalink
pam: Do not generate pam_authd.so by default
Browse files Browse the repository at this point in the history
  • Loading branch information
3v1n0 committed Apr 11, 2024
1 parent 623593c commit 69f706f
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 19 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@ jobs:
set -eu
find pam -name '*.so' -print -delete
go generate -C pam -x
test -e pam/pam_authd.so
test -e pam/go-exec/pam_authd_exec.so
- name: Generate PAM module with pam_debug tag
run: |
set -eu
find pam -name '*.so' -print -delete
go generate -C pam -x -tags pam_debug
test -e pam/pam_authd.so
test -e pam/go-exec/pam_authd_exec.so
rust-sanity:
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ override_dh_auto_configure:
done

override_dh_auto_build:
# Build PAM library & Go loader
# Build PAM exec library
DH_GOLANG_GO_GENERATE=1 dh_auto_build -- $(AUTHD_GO_PACKAGE)/pam

# Build the NSS library
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ require (
// FIXME: Use released version once we have one!
// The branch below includes changes from this upstream PR:
// - https://github.com/msteinert/pam/pull/13
replace github.com/msteinert/pam/v2 => github.com/3v1n0/go-pam/v2 v2.0.0-20240321054421-f19903865176
replace github.com/msteinert/pam/v2 => github.com/3v1n0/go-pam/v2 v2.0.0-20240411233529-b5562c52121b
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/3v1n0/go-pam/v2 v2.0.0-20240321054421-f19903865176 h1:N5WwJAe15Lj1NsGqZ6f1/GXuZmZ46HVB4KwM52Lc8ds=
github.com/3v1n0/go-pam/v2 v2.0.0-20240321054421-f19903865176/go.mod h1:KT28NNIcDFf3PcBmNI2mIGO4zZJ+9RSs/At2PB3IDVc=
github.com/3v1n0/go-pam/v2 v2.0.0-20240411233529-b5562c52121b h1:Fu45lhoPhxajRL7ombMoeBOzAB0n1MKGLJD+RHfMbdk=
github.com/3v1n0/go-pam/v2 v2.0.0-20240411233529-b5562c52121b/go.mod h1:KT28NNIcDFf3PcBmNI2mIGO4zZJ+9RSs/At2PB3IDVc=
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
Expand Down
4 changes: 2 additions & 2 deletions pam/generate.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build generate && !pam_module_generation && !pam_debug
//go:build generate && !pam_debug

//go:generate go generate -C internal/proto

//go:generate ./generate.sh -tags "!pam_binary_cli && !pam_debug"
//go:generate ./generate.sh -tags "!pam_binary_cli && !pam_debug" -no-generator

package main
4 changes: 1 addition & 3 deletions pam/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ set -euo pipefail

SCRIPT_PATH=$(dirname "$0")
PROJECT_ROOT=$(realpath "$SCRIPT_PATH")/..
module_libname=pam_authd.so
exec_libname=pam_authd_exec.so

cd "$SCRIPT_PATH"
Expand All @@ -13,9 +12,8 @@ if [ -d "$PROJECT_ROOT"/vendor ]; then
echo Vendored dependencies detected, not re-generating pam_module.go
else
go run github.com/msteinert/pam/v2/cmd/pam-moduler \
-libname "$module_libname" -type pamModule -no-main \
-type pamModule -no-main \
"${@}"
go generate -x -tags pam_module_generation
fi

# shellcheck disable=SC2086
Expand Down
4 changes: 2 additions & 2 deletions pam/generate_debug.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build generate && !pam_module_generation && pam_debug
//go:build generate && pam_debug

//go:generate go generate -C internal/proto

//go:generate env CFLAGS=-g3 CGO_CFLAGS=-g3 ./generate.sh -tags "!pam_binary_cli && pam_debug" -build-tags pam_gdm_debug -output pam_module_debug.go
//go:generate env CFLAGS=-g3 CGO_CFLAGS=-g3 ./generate.sh -tags "!pam_binary_cli && pam_debug" -build-tags pam_gdm_debug -no-generator -output pam_module_debug.go

package main
4 changes: 1 addition & 3 deletions pam/pam_module.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions pam/pam_module_debug.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 69f706f

Please sign in to comment.