Add pointer to a printf like function to plugin open functon.

This can be used instead of the conversation function to display
info and error messages.
This commit is contained in:
Todd C. Miller
2010-05-04 19:17:31 -04:00
parent b60b28abd1
commit 9fbec34fed
11 changed files with 160 additions and 157 deletions

View File

@@ -106,28 +106,3 @@ _warning(int use_errno, const char *fmt, va_list ap)
memset(&repl, 0, sizeof(repl));
sudo_conv(nmsgs, msg, repl);
}
void
print_error(int nmsgs, ...)
{
struct sudo_conv_message *msg;
struct sudo_conv_reply *repl;
va_list ap;
int i;
if (nmsgs <= 0)
return;
msg = emalloc2(nmsgs, sizeof(*msg));
repl = emalloc2(nmsgs, sizeof(*repl));
memset(repl, 0, nmsgs * sizeof(*repl));
va_start(ap, nmsgs);
for (i = 0; i < nmsgs; i++) {
msg[i].msg_type = SUDO_CONV_ERROR_MSG;
msg[i].msg = va_arg(ap, char *);
}
va_end(ap);
sudo_conv(nmsgs, msg, repl);
}