I am trying to develop in the cgo a plug-in of sudo.
https://www.sudo.ws/man/1.8.15/sudo_plugin.man.html
export the struct to the global scope of policy_plugin.
A policy plugin must declare and populate a
policy_plugin
struct in the global scope.
Do you have an explanation of what that means?
export_test.go
package main
/*
#include "sudo_plugin.h"
#include <stddef.h>
*/
import "C"
func main() {
}
// don't worked
//export policy
var policy = &C.struct_policy_plugin{
C.SUDO_POLICY_PLUGIN,
C.SUDO_API_VERSION,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
nil,
}