/usr/include/dovecot/master-auth.h is in dovecot-dev 1:2.2.9-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | #ifndef MASTER_AUTH_H
#define MASTER_AUTH_H
#include "net.h"
struct master_service;
/* Major version changes are not backwards compatible,
minor version numbers can be ignored. */
#define AUTH_MASTER_PROTOCOL_MAJOR_VERSION 1
#define AUTH_MASTER_PROTOCOL_MINOR_VERSION 1
/* Authentication client process's cookie size */
#define MASTER_AUTH_COOKIE_SIZE (128/8)
/* LOGIN_MAX_INBUF_SIZE should be based on this.*/
#define MASTER_AUTH_MAX_DATA_SIZE 1024
#define MASTER_AUTH_ERRMSG_INTERNAL_FAILURE \
"Internal error occurred. Refer to server log for more information."
enum mail_auth_request_flags {
/* Connection has TLS compression enabled */
MAIL_AUTH_REQUEST_FLAG_TLS_COMPRESSION = 0x01
};
/* Authentication request. File descriptor may be sent along with the
request. */
struct master_auth_request {
/* Request tag. Reply is sent back using same tag. */
unsigned int tag;
/* Authentication process, authentication ID and auth cookie. */
pid_t auth_pid;
unsigned int auth_id;
unsigned int client_pid;
uint8_t cookie[MASTER_AUTH_COOKIE_SIZE];
/* Local and remote IPs of the connection. The file descriptor
itself may be a local socketpair. */
struct ip_addr local_ip, remote_ip;
uint32_t flags;
/* request follows this many bytes of client input */
uint32_t data_size;
/* inode of the transferred fd. verified just to be sure that the
correct fd is mapped to the correct struct. */
ino_t ino;
};
enum master_auth_status {
MASTER_AUTH_STATUS_OK,
MASTER_AUTH_STATUS_INTERNAL_ERROR
};
struct master_auth_reply {
/* tag=0 are notifications from master */
unsigned int tag;
enum master_auth_status status;
/* PID of the post-login mail process handling this connection */
pid_t mail_pid;
};
/* reply=NULL if the auth lookup was cancelled due to some error */
typedef void master_auth_callback_t(const struct master_auth_reply *reply,
void *context);
struct master_auth *
master_auth_init(struct master_service *service, const char *path);
void master_auth_deinit(struct master_auth **auth);
/* Send an authentication request. The fd contains the file descriptor to
transfer, or -1 if no fd is wanted to be transferred. Returns tag which can
be used to abort the request (ie. ignore the reply from master).
request->tag is ignored. */
void master_auth_request(struct master_auth *auth, int fd,
const struct master_auth_request *request,
const unsigned char *data,
master_auth_callback_t *callback,
void *context, unsigned int *tag_r);
void master_auth_request_abort(struct master_auth *auth, unsigned int tag);
#endif
|