home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume22
/
bigb
/
part01
/
bigb.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-13
|
4KB
|
131 lines
#ifndef __BIGB_H_
#define __BIGB_H_
/* Define qualifiers to restrict the scope of variables and functions */
#ifndef PRIVATE
# define PRIVATE static
# define PUBLIC extern
#endif
/* If QUICK is defined then look directly at the security database files.
* This reduces the cpu load by about a factor of 20 but it would
* cause problems if the location of the special files gets changed.
* This is unlikely to happen but anything is possible in version n+1
*/
#define QUICK
/* Required by subsequent include files */
#define SecureWare
#include <sys/types.h>
#include <sys/security.h>
#include <sys/audit.h>
#include <prot.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
/* Safer to define these myself */
#ifndef TRUE
# define TRUE 1
# define FALSE 0
#endif
/* A few variations on the theme of NULL to make things easier */
#define FNULL ((FILE *) NULL)
#define CNULL ((char *) NULL)
#define MNULL ((struct member *) NULL)
/* Longer than any user or terminal name */
#define MAX_LEN 15
/* Define a member of the linked lists used to hold terminals and users
* to check or not as the case may be. Using linked lists allows any length
* of list and also allows the data to be easily replaced.
*/
struct member {
struct member *previous; /* Points to previous member ( or MNULL) */
struct member *next; /* Points to next member ( or MNULL ) */
char data[MAX_LEN]; /* The actual data */
};
/* The maximum length of a full file name */
#define PATH_MAX 128
/* General scratch area */
char temp[PATH_MAX];
/* The filenames containing the terminals to check/not to check */
char terminal_check_file[PATH_MAX];
char terminal_nocheck_file[PATH_MAX];
/* The filenames containing the users to check/not to check */
char user_check_file[PATH_MAX];
char user_nocheck_file[PATH_MAX];
/* Just for neatness */
typedef int flag_t;
/* Check specific entries, all but some, all or none */
#define CHECK_SPECIFIC ((flag_t) 1)
#define CHECK_EXCLUDE ((flag_t) 2)
#define CHECK_ALL ((flag_t) 4)
#define CHECK_NONE ((flag_t) 8)
/* The linked lists containing terminal data */
struct member *terminals_to_check;
struct member *terminals_to_exclude;
flag_t terminal_check; /* E.G. CHECK_ALL */
/* The linked lists containing user data */
struct member *users_to_check;
struct member *users_to_exclude;
flag_t user_check; /* E.G. CHECK_ALL */
/* When to start worrying */
int max_term_failures;
int max_login_failures;
/* Warn when root logs on ( 'yes' or 'no' ) */
char checkroot[4];
int check_root_selected; /* As above but faster to check */
/* The time of the last round of checks */
time_t last_checked;
/* The time to pause between checks */
int sleeptime;
/* The requested nice value to run at */
int nicevalue;
/* Where to send the messages */
char error_display_name[PATH_MAX]; /* Usually /dev/console */
char error_file_name[PATH_MAX]; /* Usually /usr/adm/warnings */
FILE *error_display_chan; /* For error_display_name[] */
FILE *error_file_chan; /* For error_file_name [] */
#ifdef QUICK
#define TERMINALFILE "/etc/auth/system/ttys"
#define USERFILES "/tcb/files/auth/"
#endif
/* The global function declarations */
PUBLIC void check_terminals(void);
PUBLIC void check_users(void);
PUBLIC void check_root(void);
PUBLIC char *find_relevant_terminal(int, int, time_t);
PUBLIC int read_from_list(const struct member *, struct member *, const char *);
PUBLIC int find_in_list(const struct member *, const char *);
PUBLIC int read_config(void);
PUBLIC void get_params(void);
PUBLIC void update_data(void);
PUBLIC char *date(time_t);
PUBLIC void neaten(char *);
PUBLIC void print_warning(const char *);
PUBLIC int read_list(struct member **, FILE *);
PUBLIC void print_list(const struct member *);
PUBLIC void free_list(struct member **);
#endif /* __BIGB_H_ */