#define SUDO_API_VERSION_SET_MAJOR(vp, n) do { \
*(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \
} while(0)
- #define SUDO_VERSION_SET_MINOR(vp, n) do { \
+ #define SUDO_API_VERSION_SET_MINOR(vp, n) do { \
*(vp) = (*(vp) & 0xffff0000) | (n); \
} while(0)
/* Hook API version major/minor */
#define SUDO_HOOK_VERSION_MAJOR 1
#define SUDO_HOOK_VERSION_MINOR 0
- #define SUDO_HOOK_MKVERSION(x, y) ((x << 16) | y)
- #define SUDO_HOOK_VERSION SUDO_HOOK_MKVERSION(SUDO_HOOK_VERSION_MAJOR,\
+ #define SUDO_HOOK_VERSION SUDO_API_MKVERSION(SUDO_HOOK_VERSION_MAJOR,\
SUDO_HOOK_VERSION_MINOR)
- /* Getters and setters for hook API version */
- #define SUDO_HOOK_VERSION_GET_MAJOR(v) ((v) >> 16)
- #define SUDO_HOOK_VERSION_GET_MINOR(v) ((v) & 0xffff)
- #define SUDO_HOOK_VERSION_SET_MAJOR(vp, n) do { \
- *(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \
- } while(0)
- #define SUDO_HOOK_VERSION_SET_MINOR(vp, n) do { \
- *(vp) = (*(vp) & 0xffff0000) | (n); \
- } while(0)
+ For getters and setters see the _\bP_\bo_\bl_\bi_\bc_\by _\bp_\bl_\bu_\bg_\bi_\bn _\bA_\bP_\bI.
R\bRe\bem\bmo\bot\bte\be c\bco\bom\bmm\bma\ban\bnd\bd e\bex\bxe\bec\bcu\but\bti\bio\bon\bn
The s\bsu\bud\bdo\bo front end does not have native support for running remote
informational or error messages to the user, which is usually more
convenient for simple messages where no use input is required.
+ _\bC_\bo_\bn_\bv_\be_\br_\bs_\ba_\bt_\bi_\bo_\bn _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be_\bs
+
+ The conversation function takes as arguments pointers to the following
+ structures:
+
struct sudo_conv_message {
#define SUDO_CONV_PROMPT_ECHO_OFF 0x0001 /* do not echo user input */
#define SUDO_CONV_PROMPT_ECHO_ON 0x0002 /* echo user input */
char *reply;
};
- /* Conversation callback API version major/minor */
- #define SUDO_CONV_CALLBACK_VERSION_MAJOR 1
- #define SUDO_CONV_CALLBACK_VERSION_MINOR 0
- #define SUDO_CONV_CALLBACK_MKVERSION(x, y) ((x << 16) | y)
- #define SUDO_CONV_CALLBACK_VERSION \
- SUDO_CONV_CALLBACK_MKVERSION(SUDO_CONV_CALLBACK_VERSION_MAJOR, \
- SUDO_CONV_CALLBACK_VERSION_MINOR)
-
typedef int (*sudo_conv_callback_fn_t)(int signo, void *closure);
struct sudo_conv_callback {
unsigned int version;
sudo_conv_callback_fn_t on_resume;
};
+ Pointers to the c\bco\bon\bnv\bve\ber\brs\bsa\bat\bti\bio\bon\bn() and p\bpr\bri\bin\bnt\btf\bf()-style functions are passed in
+ to the plugin's o\bop\bpe\ben\bn() function when the plugin is initialized. The
+ following type definitions can be used in the declaration of the o\bop\bpe\ben\bn()
+ function:
+
typedef int (*sudo_conv_t)(int num_msgs,
const struct sudo_conv_message msgs[],
struct sudo_conv_reply replies[],
typedef int (*sudo_printf_t)(int msg_type, const char *fmt, ...);
- Pointers to the c\bco\bon\bnv\bve\ber\brs\bsa\bat\bti\bio\bon\bn() and p\bpr\bri\bin\bnt\btf\bf()-style functions are passed in
- to the plugin's o\bop\bpe\ben\bn() function when the plugin is initialized.
-
To use the c\bco\bon\bnv\bve\ber\brs\bsa\bat\bti\bio\bon\bn() function, the plugin must pass an array of
sudo_conv_message and sudo_conv_reply structures. There must be a struct
sudo_conv_message and struct sudo_conv_reply for each message in the
- conversation. The struct sudo_conv_callback pointer, if not NULL,
- contains function pointers that are called when the s\bsu\bud\bdo\bo process is
- suspended and/or resumed during conversation input. The functions are
- passed the signal that caused s\bsu\bud\bdo\bo to be suspended and the _\bc_\bl_\bo_\bs_\bu_\br_\be
- pointer. This allows the plugin to release resources such as locks that
- should not be held indefinitely on suspend and reacquire them on resume.
- Note that the functions are not actually invoked from within a signal
- handler.
+ conversation. The struct sudo_conv_callback pointer, if not NULL, should
+ contain function pointers to be called when the s\bsu\bud\bdo\bo process is suspended
+ and/or resumed during conversation input. The _\bo_\bn_\b__\bs_\bu_\bs_\bp_\be_\bn_\bd and _\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be
+ functions are called with the signal that caused s\bsu\bud\bdo\bo to be suspended and
+ the _\bc_\bl_\bo_\bs_\bu_\br_\be pointer from the struct sudo_conv_callback. The intended use
+ is to allow the plugin to release resources, such as locks, that should
+ not be held indefinitely while suspended and then reacquire them when the
+ process is resumed. Note that the functions are not actually invoked
+ from within a signal handler.
The plugin is responsible for freeing the reply buffer located in each
struct sudo_conv_reply, if it is not NULL. SUDO_CONV_REPL_MAX represents
#define GROUP_API_VERSION_MINOR 0
#define GROUP_API_VERSION ((GROUP_API_VERSION_MAJOR << 16) | \
GROUP_API_VERSION_MINOR)
-
- /* Getters and setters for group version */
- #define GROUP_API_VERSION_GET_MAJOR(v) ((v) >> 16)
- #define GROUP_API_VERSION_GET_MINOR(v) ((v) & 0xffff)
- #define GROUP_API_VERSION_SET_MAJOR(vp, n) do { \
- *(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \
- } while(0)
- #define GROUP_API_VERSION_SET_MINOR(vp, n) do { \
- *(vp) = (*(vp) & 0xffff0000) | (n); \
- } while(0)
+ For getters and setters see the _\bP_\bo_\bl_\bi_\bc_\by _\bp_\bl_\bu_\bg_\bi_\bn _\bA_\bP_\bI.
P\bPL\bLU\bUG\bGI\bIN\bN A\bAP\bPI\bI C\bCH\bHA\bAN\bNG\bGE\bEL\bLO\bOG\bG
The following revisions have been made to the Sudo Plugin API.
#define SUDO_API_VERSION_SET_MAJOR(vp, n) do { \e
*(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \e
} while(0)
-#define SUDO_VERSION_SET_MINOR(vp, n) do { \e
+#define SUDO_API_VERSION_SET_MINOR(vp, n) do { \e
*(vp) = (*(vp) & 0xffff0000) | (n); \e
} while(0)
.RE
/* Hook API version major/minor */
#define SUDO_HOOK_VERSION_MAJOR 1
#define SUDO_HOOK_VERSION_MINOR 0
-#define SUDO_HOOK_MKVERSION(x, y) ((x << 16) | y)
-#define SUDO_HOOK_VERSION SUDO_HOOK_MKVERSION(SUDO_HOOK_VERSION_MAJOR,\e
+#define SUDO_HOOK_VERSION SUDO_API_MKVERSION(SUDO_HOOK_VERSION_MAJOR,\e
SUDO_HOOK_VERSION_MINOR)
-
-/* Getters and setters for hook API version */
-#define SUDO_HOOK_VERSION_GET_MAJOR(v) ((v) >> 16)
-#define SUDO_HOOK_VERSION_GET_MINOR(v) ((v) & 0xffff)
-#define SUDO_HOOK_VERSION_SET_MAJOR(vp, n) do { \e
- *(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \e
-} while(0)
-#define SUDO_HOOK_VERSION_SET_MINOR(vp, n) do { \e
- *(vp) = (*(vp) & 0xffff0000) | (n); \e
-} while(0)
.RE
.fi
+.PP
+For getters and setters see the
+\fIPolicy plugin API\fR.
.SS "Remote command execution"
The
\fBsudo\fR
function is also available that can be used to display informational
or error messages to the user, which is usually more convenient for
simple messages where no use input is required.
+.PP
+\fIConversation function structures\fR
+.PP
+The conversation function takes as arguments pointers to the following
+structures:
.nf
.sp
.RS 0n
char *reply;
};
-/* Conversation callback API version major/minor */
-#define SUDO_CONV_CALLBACK_VERSION_MAJOR 1
-#define SUDO_CONV_CALLBACK_VERSION_MINOR 0
-#define SUDO_CONV_CALLBACK_MKVERSION(x, y) ((x << 16) | y)
-#define SUDO_CONV_CALLBACK_VERSION \e
- SUDO_CONV_CALLBACK_MKVERSION(SUDO_CONV_CALLBACK_VERSION_MAJOR, \e
- SUDO_CONV_CALLBACK_VERSION_MINOR)
-
typedef int (*sudo_conv_callback_fn_t)(int signo, void *closure);
struct sudo_conv_callback {
unsigned int version;
sudo_conv_callback_fn_t on_suspend;
sudo_conv_callback_fn_t on_resume;
};
-
-typedef int (*sudo_conv_t)(int num_msgs,
- const struct sudo_conv_message msgs[],
- struct sudo_conv_reply replies[],
- struct sudo_conv_callback *callback);
-
-typedef int (*sudo_printf_t)(int msg_type, const char *fmt, ...);
.RE
.fi
.PP
in to the plugin's
\fBopen\fR()
function when the plugin is initialized.
+The following type definitions can be used in the declaration of the
+\fBopen\fR()
+function:
+.nf
+.sp
+.RS 0n
+typedef int (*sudo_conv_t)(int num_msgs,
+ const struct sudo_conv_message msgs[],
+ struct sudo_conv_reply replies[],
+ struct sudo_conv_callback *callback);
+
+typedef int (*sudo_printf_t)(int msg_type, const char *fmt, ...);
+.RE
+.fi
.PP
To use the
\fBconversation\fR()
\fRstruct sudo_conv_callback\fR
pointer, if not
\fRNULL\fR,
-contains function pointers that are called when the
+should contain function pointers to be called when the
\fBsudo\fR
process is suspended and/or resumed during conversation input.
-The functions are passed the signal that caused
+The
+\fIon_suspend\fR
+and
+\fIon_resume\fR
+functions are called with the signal that caused
\fBsudo\fR
to be suspended and the
\fIclosure\fR
-pointer.
-This allows the plugin to release resources such as locks that
-should not be held indefinitely on suspend and reacquire them
-on resume.
+pointer from the
+\fRstruct sudo_conv_callback\fR.
+The intended use is to allow the plugin to release resources, such as locks,
+that should not be held indefinitely while suspended and then reacquire them
+when the process is resumed.
Note that the functions are not actually invoked from within a signal handler.
.PP
The plugin is responsible for freeing the reply buffer located in each
#define GROUP_API_VERSION_MINOR 0
#define GROUP_API_VERSION ((GROUP_API_VERSION_MAJOR << 16) | \e
GROUP_API_VERSION_MINOR)
-
-/* Getters and setters for group version */
-#define GROUP_API_VERSION_GET_MAJOR(v) ((v) >> 16)
-#define GROUP_API_VERSION_GET_MINOR(v) ((v) & 0xffff)
-#define GROUP_API_VERSION_SET_MAJOR(vp, n) do { \e
- *(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \e
-} while(0)
-#define GROUP_API_VERSION_SET_MINOR(vp, n) do { \e
- *(vp) = (*(vp) & 0xffff0000) | (n); \e
-} while(0)
.RE
.fi
+For getters and setters see the
+\fIPolicy plugin API\fR.
.SH "PLUGIN API CHANGELOG"
The following revisions have been made to the Sudo Plugin API.
.TP 6n
#define SUDO_API_VERSION_SET_MAJOR(vp, n) do { \e
*(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \e
} while(0)
-#define SUDO_VERSION_SET_MINOR(vp, n) do { \e
+#define SUDO_API_VERSION_SET_MINOR(vp, n) do { \e
*(vp) = (*(vp) & 0xffff0000) | (n); \e
} while(0)
.Ed
/* Hook API version major/minor */
#define SUDO_HOOK_VERSION_MAJOR 1
#define SUDO_HOOK_VERSION_MINOR 0
-#define SUDO_HOOK_MKVERSION(x, y) ((x << 16) | y)
-#define SUDO_HOOK_VERSION SUDO_HOOK_MKVERSION(SUDO_HOOK_VERSION_MAJOR,\e
+#define SUDO_HOOK_VERSION SUDO_API_MKVERSION(SUDO_HOOK_VERSION_MAJOR,\e
SUDO_HOOK_VERSION_MINOR)
-
-/* Getters and setters for hook API version */
-#define SUDO_HOOK_VERSION_GET_MAJOR(v) ((v) >> 16)
-#define SUDO_HOOK_VERSION_GET_MINOR(v) ((v) & 0xffff)
-#define SUDO_HOOK_VERSION_SET_MAJOR(vp, n) do { \e
- *(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \e
-} while(0)
-#define SUDO_HOOK_VERSION_SET_MINOR(vp, n) do { \e
- *(vp) = (*(vp) & 0xffff0000) | (n); \e
-} while(0)
.Ed
+.Pp
+For getters and setters see the
+.Sx Policy plugin API .
.Ss Remote command execution
The
.Nm sudo
function is also available that can be used to display informational
or error messages to the user, which is usually more convenient for
simple messages where no use input is required.
+.Pp
+.Em Conversation function structures
+.Pp
+The conversation function takes as arguments pointers to the following
+structures:
.Bd -literal
struct sudo_conv_message {
#define SUDO_CONV_PROMPT_ECHO_OFF 0x0001 /* do not echo user input */
char *reply;
};
-/* Conversation callback API version major/minor */
-#define SUDO_CONV_CALLBACK_VERSION_MAJOR 1
-#define SUDO_CONV_CALLBACK_VERSION_MINOR 0
-#define SUDO_CONV_CALLBACK_MKVERSION(x, y) ((x << 16) | y)
-#define SUDO_CONV_CALLBACK_VERSION \e
- SUDO_CONV_CALLBACK_MKVERSION(SUDO_CONV_CALLBACK_VERSION_MAJOR, \e
- SUDO_CONV_CALLBACK_VERSION_MINOR)
-
typedef int (*sudo_conv_callback_fn_t)(int signo, void *closure);
struct sudo_conv_callback {
unsigned int version;
sudo_conv_callback_fn_t on_suspend;
sudo_conv_callback_fn_t on_resume;
};
-
-typedef int (*sudo_conv_t)(int num_msgs,
- const struct sudo_conv_message msgs[],
- struct sudo_conv_reply replies[],
- struct sudo_conv_callback *callback);
-
-typedef int (*sudo_printf_t)(int msg_type, const char *fmt, ...);
.Ed
.Pp
Pointers to the
in to the plugin's
.Fn open
function when the plugin is initialized.
+The following type definitions can be used in the declaration of the
+.Fn open
+function:
+.Bd -literal
+typedef int (*sudo_conv_t)(int num_msgs,
+ const struct sudo_conv_message msgs[],
+ struct sudo_conv_reply replies[],
+ struct sudo_conv_callback *callback);
+
+typedef int (*sudo_printf_t)(int msg_type, const char *fmt, ...);
+.Ed
.Pp
To use the
.Fn conversation
.Li struct sudo_conv_callback
pointer, if not
.Dv NULL ,
-contains function pointers that are called when the
+should contain function pointers to be called when the
.Nm sudo
process is suspended and/or resumed during conversation input.
-The functions are passed the signal that caused
+The
+.Fa on_suspend
+and
+.Fa on_resume
+functions are called with the signal that caused
.Nm sudo
to be suspended and the
.Fa closure
-pointer.
-This allows the plugin to release resources such as locks that
-should not be held indefinitely on suspend and reacquire them
-on resume.
+pointer from the
+.Li struct sudo_conv_callback .
+The intended use is to allow the plugin to release resources, such as locks,
+that should not be held indefinitely while suspended and then reacquire them
+when the process is resumed.
Note that the functions are not actually invoked from within a signal handler.
.Pp
The plugin is responsible for freeing the reply buffer located in each
#define GROUP_API_VERSION_MINOR 0
#define GROUP_API_VERSION ((GROUP_API_VERSION_MAJOR << 16) | \e
GROUP_API_VERSION_MINOR)
-
-/* Getters and setters for group version */
-#define GROUP_API_VERSION_GET_MAJOR(v) ((v) >> 16)
-#define GROUP_API_VERSION_GET_MINOR(v) ((v) & 0xffff)
-#define GROUP_API_VERSION_SET_MAJOR(vp, n) do { \e
- *(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \e
-} while(0)
-#define GROUP_API_VERSION_SET_MINOR(vp, n) do { \e
- *(vp) = (*(vp) & 0xffff0000) | (n); \e
-} while(0)
.Ed
+For getters and setters see the
+.Sx Policy plugin API .
.Sh PLUGIN API CHANGELOG
The following revisions have been made to the Sudo Plugin API.
.Bl -tag -width 4n
#define SUDO_API_MKVERSION(x, y) ((x << 16) | y)
#define SUDO_API_VERSION SUDO_API_MKVERSION(SUDO_API_VERSION_MAJOR, SUDO_API_VERSION_MINOR)
-/* Getters and setters for API version */
+/* Getters and setters for plugin API versions */
#define SUDO_API_VERSION_GET_MAJOR(v) ((v) >> 16)
#define SUDO_API_VERSION_GET_MINOR(v) ((v) & 0xffff)
#define SUDO_API_VERSION_SET_MAJOR(vp, n) do { \
/* Conversation callback API version major/minor */
#define SUDO_CONV_CALLBACK_VERSION_MAJOR 1
#define SUDO_CONV_CALLBACK_VERSION_MINOR 0
-#define SUDO_CONV_CALLBACK_MKVERSION(x, y) ((x << 16) | y)
-#define SUDO_CONV_CALLBACK_VERSION SUDO_CONV_CALLBACK_MKVERSION(SUDO_CONV_CALLBACK_VERSION_MAJOR, SUDO_CONV_CALLBACK_VERSION_MINOR)
+#define SUDO_CONV_CALLBACK_VERSION SUDO_API_MKVERSION(SUDO_CONV_CALLBACK_VERSION_MAJOR, SUDO_CONV_CALLBACK_VERSION_MINOR)
/*
* Callback struct to be passed to the conversation function.
/* Hook API version major/minor */
#define SUDO_HOOK_VERSION_MAJOR 1
#define SUDO_HOOK_VERSION_MINOR 0
-#define SUDO_HOOK_MKVERSION(x, y) ((x << 16) | y)
-#define SUDO_HOOK_VERSION SUDO_HOOK_MKVERSION(SUDO_HOOK_VERSION_MAJOR, SUDO_HOOK_VERSION_MINOR)
-
-/* Getters and setters for hook API version */
-#define SUDO_HOOK_VERSION_GET_MAJOR(v) ((v) >> 16)
-#define SUDO_HOOK_VERSION_GET_MINOR(v) ((v) & 0xffff)
-#define SUDO_HOOK_VERSION_SET_MAJOR(vp, n) do { \
- *(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \
-} while(0)
-#define SUDO_HOOK_VERSION_SET_MINOR(vp, n) do { \
- *(vp) = (*(vp) & 0xffff0000) | (n); \
-} while(0)
+#define SUDO_HOOK_VERSION SUDO_API_MKVERSION(SUDO_HOOK_VERSION_MAJOR, SUDO_HOOK_VERSION_MINOR)
/*
* Hook function return values.
/* Sudoers group plugin version major/minor */
#define GROUP_API_VERSION_MAJOR 1
#define GROUP_API_VERSION_MINOR 0
-#define GROUP_API_VERSION ((GROUP_API_VERSION_MAJOR << 16) | GROUP_API_VERSION_MINOR)
+#define GROUP_API_VERSION SUDO_API_MKVERSION(GROUP_API_VERSION_MAJOR, GROUP_API_VERSION_MINOR)
-/* Getters and setters for group version */
-#define GROUP_API_VERSION_GET_MAJOR(v) ((v) >> 16)
-#define GROUP_API_VERSION_GET_MINOR(v) ((v) & 0xffff)
-#define GROUP_API_VERSION_SET_MAJOR(vp, n) do { \
- *(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \
-} while(0)
-#define GROUP_API_VERSION_SET_MINOR(vp, n) do { \
- *(vp) = (*(vp) & 0xffff0000) | (n); \
-} while(0)
+/* Getters and setters for group version (for source compat only) */
+#define GROUP_API_VERSION_GET_MAJOR(v) SUDO_API_VERSION_GET_MAJOR(v)
+#define GROUP_API_VERSION_GET_MINOR(v) SUDO_API_VERSION_GET_MINOR(v)
+#define GROUP_API_VERSION_SET_MAJOR(vp, n) SUDO_API_VERSION_SET_MAJOR(vp, n)
+#define GROUP_API_VERSION_SET_MINOR(vp, n) SUDO_API_VERSION_SET_MINOR(vp, n)
/*
* version: for compatibility checking
sudo_log = sudo_printf;
- if (GROUP_API_VERSION_GET_MAJOR(version) != GROUP_API_VERSION_MAJOR) {
+ if (SUDO_API_VERSION_GET_MAJOR(version) != GROUP_API_VERSION_MAJOR) {
sudo_log(SUDO_CONV_ERROR_MSG,
"group_file: incompatible major version %d, expected %d\n",
- GROUP_API_VERSION_GET_MAJOR(version),
+ SUDO_API_VERSION_GET_MAJOR(version),
GROUP_API_VERSION_MAJOR);
return -1;
}
return -1;
}
- if (GROUP_API_VERSION_GET_MAJOR(group_plugin->version) != GROUP_API_VERSION_MAJOR) {
+ if (SUDO_API_VERSION_GET_MAJOR(group_plugin->version) != GROUP_API_VERSION_MAJOR) {
fprintf(stderr,
"%s: incompatible group plugin major version %d, expected %d\n",
- path, GROUP_API_VERSION_GET_MAJOR(group_plugin->version),
+ path, SUDO_API_VERSION_GET_MAJOR(group_plugin->version),
GROUP_API_VERSION_MAJOR);
return -1;
}
goto done;
}
- if (GROUP_API_VERSION_GET_MAJOR(group_plugin->version) != GROUP_API_VERSION_MAJOR) {
+ if (SUDO_API_VERSION_GET_MAJOR(group_plugin->version) != GROUP_API_VERSION_MAJOR) {
sudo_warnx(U_("%s: incompatible group plugin major version %d, expected %d"),
- path, GROUP_API_VERSION_GET_MAJOR(group_plugin->version),
+ path, SUDO_API_VERSION_GET_MAJOR(group_plugin->version),
GROUP_API_VERSION_MAJOR);
goto done;
}
if (register_hook(hook) != 0) {
sudo_warn_nodebug(
U_("unable to register hook of type %d (version %d.%d)"),
- hook->hook_type,SUDO_HOOK_VERSION_GET_MAJOR(hook->hook_version),
- SUDO_HOOK_VERSION_GET_MINOR(hook->hook_version));
+ hook->hook_type, SUDO_API_VERSION_GET_MAJOR(hook->hook_version),
+ SUDO_API_VERSION_GET_MINOR(hook->hook_version));
}
}
}
sudo_log = sudo_printf;
- if (GROUP_API_VERSION_GET_MAJOR(version) != GROUP_API_VERSION_MAJOR) {
+ if (SUDO_API_VERSION_GET_MAJOR(version) != GROUP_API_VERSION_MAJOR) {
sudo_log(SUDO_CONV_ERROR_MSG,
"sysgroup_group: incompatible major version %d, expected %d\n",
- GROUP_API_VERSION_GET_MAJOR(version),
+ SUDO_API_VERSION_GET_MAJOR(version),
GROUP_API_VERSION_MAJOR);
return -1;
}
int rval;
debug_decl(register_hook, SUDO_DEBUG_HOOKS)
- if (SUDO_HOOK_VERSION_GET_MAJOR(hook->hook_version) != SUDO_HOOK_VERSION_MAJOR) {
+ if (SUDO_API_VERSION_GET_MAJOR(hook->hook_version) != SUDO_HOOK_VERSION_MAJOR) {
/* Major versions must match. */
errno = EINVAL;
rval = -1;
int rval = 0;
debug_decl(deregister_hook, SUDO_DEBUG_HOOKS)
- if (SUDO_HOOK_VERSION_GET_MAJOR(hook->hook_version) != SUDO_HOOK_VERSION_MAJOR) {
+ if (SUDO_API_VERSION_GET_MAJOR(hook->hook_version) != SUDO_HOOK_VERSION_MAJOR) {
/* Major versions must match. */
rval = -1;
} else {