File: conf.h

package info (click to toggle)
calife 2.8.4-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 400 kB
  • ctags: 72
  • sloc: sh: 1,656; perl: 1,330; ansic: 992; makefile: 65
file content (152 lines) | stat: -rw-r--r-- 3,383 bytes parent folder | download
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/** conf.h
 **
 ** Fichier de configuration pour calife.c
 **
 ** cree pour simplifier calife.c
 **
 ** Copyright (c) 1991-1995 par O. ROBERT
 **
 ** $Id: //depot/security/calife/main/conf.h#24 $
 **/

#ifndef CONF_H                  /* evite les includes multiples */
#define CONF_H

#define ROOT_LOGIN      "root"

#ifdef SUNOS4
#define _PATH_UTMP  "/etc/utmp" /* sigh */
#endif

                                /* for Gould NP1 */
#ifdef GOULD
#define BSD
#endif

#if (defined(BSD) && (BSD >= 199306))   /* for both NetBSD & FreeBSD */
#define ADMIN_LOG   "/var/log/calife"
#define HAVE_SYSCONF
#endif /* __386BSD__ */


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

#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif /* HAVE_SYS_PARAM_H */

#if defined(HAVE_SYS_WAIT_H) || defined(HAVE_NON_POSIX_WAIT_H)
#include <sys/wait.h>
#endif /* HAVE_SYS_WAIT_H && HAVE_NON_POSIX_WAIT_H */

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif /* HAVE_STDLIB_H */

#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif /* HAVE_SYSLOG_H */

#include <signal.h>
#include <stdio.h>
#include <time.h>
#include <pwd.h>
#include <grp.h>

#ifdef SUNOS4
# include <sys/time.h>
# include <utmp.h>
#endif /* SunOS */

#ifdef HAVE_SHADOW_H
#include <shadow.h>
#endif /* HAVE_SHADOW_H */

#include <errno.h>

#ifdef HAVE_STRING_H
#include <string.h>
#endif /* HAVE_STRING_H */

#ifdef NEED_STRINGS_H
#include <strings.h>
#endif /* NEED_STRINGS_H */

#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif /* HAVE_FCNTL_H */

#ifdef HAVE_RLIMIT
#include <sys/resource.h>
#endif /* HAVE_RLIMIT */


                                /* A verifier */
#ifdef BSD
#if !defined(__FreeBSD__) && !defined(HAVE_SYS_WAIT_H)
#define WEXITSTATUS(x)  ((x).w_retcode)
#define WCOREDUMP(x)    ((x).w_coredump)
#define WTERMSIG(x)     ((x).w_termsig)
#endif
#endif

#define MAX_STRING  1024        /* "safe" value */

#ifndef MAXLOGNAME
#define MAXLOGNAME  8
#endif

#ifdef STDC_HEADERS
  int open_databases (void);
  void verify_password (char *, char *, char *, char *);
  int verify_auth_info (char *, char *);
  void exec_shell (char *);
# ifndef HAVE_BASENAME
  char * basename (char * file_name);
# endif /* HAVE_BASENAME */
  void * xalloc (size_t size);
  void die (int err, const char * fmt,...);
#else /* !STDC_HEADERS */
  int open_databases ();
  void verify_password ();
  int verify_auth_info ();
  void exec_shell ();
# ifndef HAVE_BASENAME
  char * basename ();
# endif /* HAVE_BASENAME */
  void * xalloc ();
  void die (int err, const char * fmt,...);
#endif /* STDC_HEADERS */

#ifndef MAIN_MODULE
extern  FILE    * fp, * log;    /* fichier d'auth. et log */
extern  int     custom_shell;   /* modification du shell ? */
extern  char    * shell;        /* nom du shell */
extern  uid_t   ssid;   		/* POSIX saved uid */
#endif /* !MAIN_MODULE */

extern  int errno;

#ifdef DEBUG
#define MESSAGE(x) fprintf (stderr, (x)); \
                   fflush (stderr)
#define MESSAGE_1(x,y) fprintf (stderr, (x), (y)); \
                       fflush (stderr)
#define MESSAGE_2(x,y,z) fprintf (stderr, (x), (y), (z)); \
                         fflush (stderr)
#else
#define MESSAGE(x)
#define MESSAGE_1(x,y)
#define MESSAGE_2(x,y,z)
#endif /* DEBUG */

#ifdef NO_SYSLOG
#define ADMIN_LOG   "/var/log/calife.log"
#endif /* NO_SYSLOG */

#endif /* CONF_H */