Compare commits
5 Commits
pam-module
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d43b022cb | ||
|
|
c1a0f72fa1 | ||
|
|
fabe599f29 | ||
|
|
4851b5d1fc | ||
|
|
8fd6202a7b |
@@ -6,6 +6,11 @@
|
||||
|
||||
This is a Go wrapper for the PAM application API.
|
||||
|
||||
Package path changed for ease of use, and to avoid conflicts with the original
|
||||
|
||||
Originally created by [Mike Steinert](https://github.com/msteinert/pam)
|
||||
Updated and modified by [Marco Trevisan](https://github.com/3v1n0/go-pam/tree/pam-moduler)
|
||||
|
||||
## Module support
|
||||
|
||||
Go PAM can also used to create PAM modules in a simple way, using the go.
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
//
|
||||
// For example:
|
||||
//
|
||||
// //go:generate go run github.com/msteinert/pam/v2/pam-moduler
|
||||
// //go:generate go run git.cloudyne.io/go/msteinert-go-pam/pam-moduler
|
||||
// //go:generate go generate --skip="pam_module"
|
||||
// package main
|
||||
//
|
||||
// import "github.com/msteinert/pam/v2"
|
||||
// import "git.cloudyne.io/go/msteinert-go-pam"
|
||||
//
|
||||
// type ExampleHandler struct{}
|
||||
// var pamModuleHandler pam.ModuleHandler = &ExampleHandler{}
|
||||
@@ -229,7 +229,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"unsafe"
|
||||
"github.com/msteinert/pam/v2"
|
||||
"git.cloudyne.io/go/msteinert-go-pam"
|
||||
)
|
||||
`)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:generate go run github.com/msteinert/pam/v2/cmd/pam-moduler -libname "pam_godebug.so"
|
||||
//go:generate go run git.cloudyne.io/go/msteinert-go-pam/cmd/pam-moduler -libname "pam_godebug.so"
|
||||
//go:generate go generate --skip="pam_module.go"
|
||||
|
||||
// This is a similar implementation of pam_debug.so
|
||||
@@ -10,8 +10,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/msteinert/pam/v2"
|
||||
"github.com/msteinert/pam/v2/cmd/pam-moduler/tests/internal/utils"
|
||||
"git.cloudyne.io/go/msteinert-go-pam/cmd/pam-moduler/tests/internal/utils"
|
||||
)
|
||||
|
||||
var pamModuleHandler pam.ModuleHandler = &DebugModule{}
|
||||
|
||||
@@ -5,8 +5,7 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/msteinert/pam/v2"
|
||||
"github.com/msteinert/pam/v2/cmd/pam-moduler/tests/internal/utils"
|
||||
"git.cloudyne.io/go/msteinert-go-pam/cmd/pam-moduler/tests/internal/utils"
|
||||
)
|
||||
|
||||
func Test_DebugModule_ActionStatus(t *testing.T) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import "C"
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/msteinert/pam/v2"
|
||||
"git.cloudyne.io/go/msteinert-go-pam"
|
||||
"os"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/msteinert/pam/v2/cmd/pam-moduler/tests/internal/utils"
|
||||
"git.cloudyne.io/go/msteinert-go-pam/cmd/pam-moduler/tests/internal/utils"
|
||||
)
|
||||
|
||||
func ensureNoError(t *testing.T, err error) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:generate go run github.com/msteinert/pam/v2/cmd/pam-moduler -type integrationTesterModule -parallel-conv
|
||||
//go:generate go run git.cloudyne.io/go/msteinert-go-pam/cmd/pam-moduler -type integrationTesterModule -parallel-conv
|
||||
//go:generate go generate --skip="pam_module.go"
|
||||
|
||||
// Package main is the package for the integration tester module PAM shared library.
|
||||
@@ -10,8 +10,7 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/msteinert/pam/v2"
|
||||
"github.com/msteinert/pam/v2/cmd/pam-moduler/tests/internal/utils"
|
||||
"git.cloudyne.io/go/msteinert-go-pam/cmd/pam-moduler/tests/internal/utils"
|
||||
)
|
||||
|
||||
type integrationTesterModule struct {
|
||||
|
||||
@@ -10,8 +10,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/msteinert/pam/v2"
|
||||
"github.com/msteinert/pam/v2/cmd/pam-moduler/tests/internal/utils"
|
||||
"git.cloudyne.io/go/msteinert-go-pam/cmd/pam-moduler/tests/internal/utils"
|
||||
)
|
||||
|
||||
func (r *Request) check(res *Result, expectedResults []interface{}) error {
|
||||
|
||||
@@ -16,7 +16,7 @@ import "C"
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/msteinert/pam/v2"
|
||||
"git.cloudyne.io/go/msteinert-go-pam"
|
||||
"os"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@@ -3,8 +3,7 @@ package main
|
||||
import (
|
||||
"encoding/gob"
|
||||
|
||||
"github.com/msteinert/pam/v2"
|
||||
"github.com/msteinert/pam/v2/cmd/pam-moduler/tests/internal/utils"
|
||||
"git.cloudyne.io/go/msteinert-go-pam/cmd/pam-moduler/tests/internal/utils"
|
||||
)
|
||||
|
||||
// SerializablePamError represents a [pam.Error] in a
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package utils
|
||||
|
||||
import "github.com/msteinert/pam/v2"
|
||||
|
||||
// BaseModule is the type for a base PAM module.
|
||||
type BaseModule struct{}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/msteinert/pam/v2"
|
||||
)
|
||||
|
||||
// TestSetup is an utility type for having a playground for test PAM modules.
|
||||
|
||||
@@ -11,8 +11,6 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/msteinert/pam/v2"
|
||||
)
|
||||
|
||||
// Action represents a PAM action to perform.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// `go generate` once in the module directory.
|
||||
// This is not strictly needed
|
||||
|
||||
//go:generate go run github.com/msteinert/pam/v2/cmd/pam-moduler
|
||||
//go:generate go run git.cloudyne.io/go/msteinert-go-pam/cmd/pam-moduler
|
||||
//go:generate go generate --skip="pam_module.go"
|
||||
|
||||
// Package main provides the module shared library.
|
||||
@@ -10,8 +10,6 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/msteinert/pam/v2"
|
||||
)
|
||||
|
||||
type exampleHandler struct{}
|
||||
|
||||
@@ -16,7 +16,7 @@ import "C"
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/msteinert/pam/v2"
|
||||
"git.cloudyne.io/go/msteinert-go-pam"
|
||||
"os"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/msteinert/pam/v2"
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user