Browse Source

Fix pointer mismatch with pam plugin

pull/4517/head
Richard James Salts 8 years ago
parent
commit
9e3cd1ea70
  1. 3
      vendor/github.com/msteinert/pam/transaction.c
  2. 5
      vendor/github.com/msteinert/pam/transaction.go

3
vendor/github.com/msteinert/pam/transaction.c generated vendored

@ -39,13 +39,12 @@ error:
return PAM_CONV_ERR; return PAM_CONV_ERR;
} }
struct pam_conv *make_pam_conv(void *appdata_ptr) struct pam_conv *make_pam_conv()
{ {
struct pam_conv* conv = malloc(sizeof *conv); struct pam_conv* conv = malloc(sizeof *conv);
if (!conv) { if (!conv) {
return NULL; return NULL;
} }
conv->conv = cb_pam_conv; conv->conv = cb_pam_conv;
conv->appdata_ptr = appdata_ptr;
return conv; return conv;
} }

5
vendor/github.com/msteinert/pam/transaction.go generated vendored

@ -4,7 +4,7 @@ package pam
//#include <stdlib.h> //#include <stdlib.h>
//#cgo CFLAGS: -Wall -std=c99 //#cgo CFLAGS: -Wall -std=c99
//#cgo LDFLAGS: -lpam //#cgo LDFLAGS: -lpam
//struct pam_conv *make_pam_conv(void *); //struct pam_conv *make_pam_conv();
import "C" import "C"
import ( import (
@ -61,7 +61,8 @@ type conversation struct {
func newConversation(handler ConversationHandler) (*conversation, C.int) { func newConversation(handler ConversationHandler) (*conversation, C.int) {
c := &conversation{} c := &conversation{}
c.handler = handler c.handler = handler
c.conv = C.make_pam_conv(unsafe.Pointer(c)) c.conv = C.make_pam_conv()
c.conv.appdata_ptr = unsafe.Pointer(c)
if c.conv == nil { if c.conv == nil {
return nil, C.PAM_BUF_ERR return nil, C.PAM_BUF_ERR
} }

Loading…
Cancel
Save