File: virtual.h

package info (click to toggle)
popa3d 1.0.2-7
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 328 kB
  • sloc: ansic: 2,234; sh: 103; makefile: 91
file content (34 lines) | stat: -rw-r--r-- 990 bytes parent folder | download | duplicates (8)
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
/*
 * Virtual domain support.
 */

#ifndef _POP_VIRTUAL_H
#define _POP_VIRTUAL_H

#include <pwd.h>
#include <sys/types.h>

/*
 * These are set by the authentication routine, below.
 */
extern char *virtual_domain;
extern char *virtual_spool;

/*
 * Initializes the virtual domain support at startup.  Note that this will
 * only be called once in standalone mode, so don't expect an open socket
 * here.  Returns a non-zero value on error.
 */
extern int virtual_startup(void);

/*
 * Tries to authenticate a username/password pair for the virtual domain
 * indicated either by the connected IP address (the socket is available
 * on fd 0), or as a part of the username.  If the virtual domain is known,
 * virtual_domain and virtual_spool are set appropriately.  If the username
 * is known as well, known is set.  Returns the template user to run as if
 * authentication succeeds, or NULL otherwise.
 */
extern struct passwd *virtual_userpass(char *user, char *pass, int *known);

#endif