Ejemplo n.º 1
0
// PutEnv adds or changes the value of PAM environment variables.
//
// NAME=value will set a variable to a value.
// NAME= will set a variable to an empty value.
// NAME (without an "=") will delete a variable.
func (t *Transaction) PutEnv(nameval string) error {
	cs := C.CString(nameval)
	defer C.free(unsafe.Pointer(cs))
	t.status = C.pam_putenv(t.handle, cs)
	if t.status != C.PAM_SUCCESS {
		return t
	}
	return nil
}
Ejemplo n.º 2
0
// pam_putenv
func (t *Transaction) PutEnv(nameval string) int {
	cs := C.CString(nameval)
	defer C.free(unsafe.Pointer(cs))
	return int(C.pam_putenv(t.handle, cs))
}