1996-10-11 11:12:18 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* hba.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* Interface to hba.c
|
1996-10-11 11:12:18 +02:00
|
|
|
*
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* $Id: hba.h,v 1.12 1999/02/13 23:21:35 momjian Exp $
|
1996-10-11 11:12:18 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef HBA_H
|
1997-09-07 07:04:48 +02:00
|
|
|
#define HBA_H
|
1996-10-11 11:12:18 +02:00
|
|
|
|
1998-01-26 02:42:53 +01:00
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
|
|
#include "libpq/libpq-be.h"
|
|
|
|
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define CONF_FILE "pg_hba.conf"
|
|
|
|
/* Name of the config file */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
|
|
|
#define MAP_FILE "pg_ident.conf"
|
1997-09-07 07:04:48 +02:00
|
|
|
/* Name of the usermap file */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
|
|
|
#define OLD_CONF_FILE "pg_hba"
|
1997-09-07 07:04:48 +02:00
|
|
|
/* Name of the config file in prior releases of Postgres. */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define MAX_LINES 255
|
|
|
|
/* Maximum number of config lines that can apply to one database */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define MAX_TOKEN 80
|
|
|
|
/* Maximum size of one token in the configuration file */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1998-02-26 05:46:47 +01:00
|
|
|
#define MAX_AUTH_ARG 80 /* Max size of an authentication arg */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
|
|
|
#define IDENT_PORT 113
|
1997-09-07 07:04:48 +02:00
|
|
|
/* Standard TCP port number for Ident service. Assigned by IANA */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define IDENT_USERNAME_MAX 512
|
|
|
|
/* Max size of username ident server can return */
|
1997-03-12 22:23:16 +01:00
|
|
|
|
1998-02-26 05:46:47 +01:00
|
|
|
typedef enum UserAuth
|
|
|
|
{
|
1998-01-26 02:42:53 +01:00
|
|
|
uaReject,
|
|
|
|
uaKrb4,
|
|
|
|
uaKrb5,
|
|
|
|
uaTrust,
|
|
|
|
uaIdent,
|
|
|
|
uaPassword,
|
|
|
|
uaCrypt
|
|
|
|
} UserAuth;
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
int hba_getauthmethod(SockAddr *raddr, char *user, char *database,
|
1998-06-13 06:27:18 +02:00
|
|
|
char *auth_arg, UserAuth *auth_method);
|
1998-09-01 06:40:42 +02:00
|
|
|
int authident(struct sockaddr_in * raddr, struct sockaddr_in * laddr,
|
1998-09-01 05:29:17 +02:00
|
|
|
const char *postgres_username, const char *auth_arg);
|
1996-10-11 11:12:18 +02:00
|
|
|
|
|
|
|
#endif
|