aboutsummaryrefslogtreecommitdiff
path: root/pam
diff options
context:
space:
mode:
authorJoe Richey joerichey@google.com <joerichey@google.com>2017-08-22 15:41:18 -0700
committerJoe Richey joerichey@google.com <joerichey@google.com>2017-08-22 15:41:18 -0700
commitef5cc07774674c66b5dbeb7c655a26ac6371e378 (patch)
treeea9996782b0528bebd44f36dd13e13eb9a3e791f /pam
parentca70b81fddb340ed5212741a773c3a4a0c4ea3e2 (diff)
pam_fscrypt: lock all PAM policies w/ flag
Diffstat (limited to 'pam')
-rw-r--r--pam/pam.go35
1 files changed, 0 insertions, 35 deletions
diff --git a/pam/pam.go b/pam/pam.go
index 9188b6e..804171d 100644
--- a/pam/pam.go
+++ b/pam/pam.go
@@ -32,8 +32,6 @@ import (
"errors"
"fmt"
"unsafe"
-
- "github.com/google/fscrypt/util"
)
// Handle wraps the C pam_handle_t type. This is used from within modules.
@@ -99,39 +97,6 @@ func (h *Handle) GetString(name string) (string, error) {
return C.GoString((*C.char)(data)), nil
}
-// SetSlice sets a []string value for the PAM data with the specified name.
-func (h *Handle) SetSlice(name string, slice []string) error {
- sliceLength := uintptr(len(slice))
- memorySize := (sliceLength + 1) * unsafe.Sizeof(uintptr(0))
- data := C.malloc(C.size_t(memorySize))
-
- cSlice := util.PointerSlice(data)
- for i, str := range slice {
- cSlice[i] = unsafe.Pointer(C.CString(str))
- }
- cSlice[sliceLength] = nil
-
- return h.setData(name, data, C.CleanupFunc(C.freeArray))
-}
-
-// GetSlice gets a []string value for the PAM data with the specified name. It
-// should have been previously set with SetSlice().
-func (h *Handle) GetSlice(name string) ([]string, error) {
- data, err := h.getData(name)
- if err != nil {
- return nil, err
- }
-
- var slice []string
- for _, cString := range util.PointerSlice(data) {
- if cString == nil {
- return slice, nil
- }
- slice = append(slice, C.GoString((*C.char)(cString)))
- }
- panic("We will never get here")
-}
-
// GetItem retrieves a PAM information item. This a pointer directory to the
// data, so it shouldn't be modified.
func (h *Handle) GetItem(i Item) (unsafe.Pointer, error) {