diff options
author | Damien Miller <djm@mindrot.org> | 1999-11-11 17:57:39 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-11-11 17:57:39 +1100 |
commit | 5ce662a9202240a2f5fa6a9334d58186bdaba50c (patch) | |
tree | 9fe37122fa27f070abc3c9c28531877d43673b7f /ssh.h | |
parent | ab5e0d0c27e00dca463c67395c2b5941e778836e (diff) |
- Merged more OpenBSD CVS changes:
- [auth-krb4.c auth-passwd.c] remove x11- and krb-cleanup from fatal()
+ krb-cleanup cleanup
- [clientloop.c log-client.c log-server.c ]
[readconf.c readconf.h servconf.c servconf.h ]
[ssh.1 ssh.c ssh.h sshd.8]
add LogLevel {QUIET, FATAL, ERROR, INFO, CHAT, DEBUG} to ssh/sshd,
obsoletes QuietMode and FascistLogging in sshd.
Diffstat (limited to 'ssh.h')
-rw-r--r-- | ssh.h | 132 |
1 files changed, 59 insertions, 73 deletions
@@ -13,26 +13,14 @@ Generic header file for ssh. | |||
13 | 13 | ||
14 | */ | 14 | */ |
15 | 15 | ||
16 | /* RCSID("$Id: ssh.h,v 1.9 1999/11/10 23:40:23 damien Exp $"); */ | 16 | /* RCSID("$Id: ssh.h,v 1.10 1999/11/11 06:57:40 damien Exp $"); */ |
17 | 17 | ||
18 | #ifndef SSH_H | 18 | #ifndef SSH_H |
19 | #define SSH_H | 19 | #define SSH_H |
20 | 20 | ||
21 | #include <netinet/in.h> /* For struct sockaddr_in */ | 21 | #include <netinet/in.h> /* For struct sockaddr_in */ |
22 | #include <pwd.h> /* For struct pw */ | 22 | #include <pwd.h> /* For struct pw */ |
23 | 23 | #include <stdarg.h> /* For va_list */ | |
24 | #ifndef SHUT_RDWR | ||
25 | enum | ||
26 | { | ||
27 | SHUT_RD = 0, /* No more receptions. */ | ||
28 | #define SHUT_RD SHUT_RD | ||
29 | SHUT_WR, /* No more transmissions. */ | ||
30 | #define SHUT_WR SHUT_WR | ||
31 | SHUT_RDWR /* No more receptions or transmissions. */ | ||
32 | #define SHUT_RDWR SHUT_RDWR | ||
33 | }; | ||
34 | #endif | ||
35 | |||
36 | 24 | ||
37 | #include "rsa.h" | 25 | #include "rsa.h" |
38 | #include "cipher.h" | 26 | #include "cipher.h" |
@@ -234,9 +222,58 @@ only by root, whereas ssh_config should be world-readable. */ | |||
234 | #define SSH_CMSG_HAVE_AFS_TOKEN 65 /* token (s) */ | 222 | #define SSH_CMSG_HAVE_AFS_TOKEN 65 /* token (s) */ |
235 | 223 | ||
236 | 224 | ||
237 | /* Includes that need definitions above. */ | 225 | /*------------ Definitions for logging. -----------------------*/ |
226 | |||
227 | /* Supported syslog facilities and levels. */ | ||
228 | typedef enum | ||
229 | { | ||
230 | SYSLOG_FACILITY_DAEMON, | ||
231 | SYSLOG_FACILITY_USER, | ||
232 | SYSLOG_FACILITY_AUTH, | ||
233 | SYSLOG_FACILITY_LOCAL0, | ||
234 | SYSLOG_FACILITY_LOCAL1, | ||
235 | SYSLOG_FACILITY_LOCAL2, | ||
236 | SYSLOG_FACILITY_LOCAL3, | ||
237 | SYSLOG_FACILITY_LOCAL4, | ||
238 | SYSLOG_FACILITY_LOCAL5, | ||
239 | SYSLOG_FACILITY_LOCAL6, | ||
240 | SYSLOG_FACILITY_LOCAL7 | ||
241 | } SyslogFacility; | ||
242 | |||
243 | typedef enum | ||
244 | { | ||
245 | SYSLOG_LEVEL_QUIET, | ||
246 | SYSLOG_LEVEL_FATAL, | ||
247 | SYSLOG_LEVEL_ERROR, | ||
248 | SYSLOG_LEVEL_INFO, | ||
249 | SYSLOG_LEVEL_CHAT, | ||
250 | SYSLOG_LEVEL_DEBUG | ||
251 | } LogLevel; | ||
252 | |||
253 | /* Initializes logging. */ | ||
254 | void log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr); | ||
255 | |||
256 | /* Logging implementation, depending on server or client */ | ||
257 | void do_log(LogLevel level, const char *fmt, va_list args); | ||
258 | |||
259 | /* Output a message to syslog or stderr */ | ||
260 | void fatal(const char *fmt, ...); | ||
261 | void error(const char *fmt, ...); | ||
262 | void log(const char *fmt, ...); | ||
263 | void chat(const char *fmt, ...); | ||
264 | void debug(const char *fmt, ...); | ||
265 | |||
266 | /* same as fatal() but w/o logging */ | ||
267 | void fatal_cleanup(void); | ||
268 | |||
269 | /* Registers a cleanup function to be called by fatal()/fatal_cleanup() before exiting. | ||
270 | It is permissible to call fatal_remove_cleanup for the function itself | ||
271 | from the function. */ | ||
272 | void fatal_add_cleanup(void (*proc)(void *context), void *context); | ||
273 | |||
274 | /* Removes a cleanup function to be called at fatal(). */ | ||
275 | void fatal_remove_cleanup(void (*proc)(void *context), void *context); | ||
238 | 276 | ||
239 | #include "readconf.h" | ||
240 | 277 | ||
241 | /*------------ definitions for login.c -------------*/ | 278 | /*------------ definitions for login.c -------------*/ |
242 | 279 | ||
@@ -276,6 +313,10 @@ int ssh_connect(const char *host, struct sockaddr_in *hostaddr, | |||
276 | If login fails, this function prints an error and never returns. | 313 | If login fails, this function prints an error and never returns. |
277 | This initializes the random state, and leaves it initialized (it will also | 314 | This initializes the random state, and leaves it initialized (it will also |
278 | have references from the packet module). */ | 315 | have references from the packet module). */ |
316 | |||
317 | /* for Options */ | ||
318 | #include "readconf.h" | ||
319 | |||
279 | void ssh_login(int host_key_valid, RSA *host_key, const char *host, | 320 | void ssh_login(int host_key_valid, RSA *host_key, const char *host, |
280 | struct sockaddr_in *hostaddr, Options *options, | 321 | struct sockaddr_in *hostaddr, Options *options, |
281 | uid_t original_real_uid); | 322 | uid_t original_real_uid); |
@@ -381,59 +422,6 @@ int load_public_key(const char *filename, RSA *pub, | |||
381 | int load_private_key(const char *filename, const char *passphrase, | 422 | int load_private_key(const char *filename, const char *passphrase, |
382 | RSA *private_key, char **comment_return); | 423 | RSA *private_key, char **comment_return); |
383 | 424 | ||
384 | /*------------ Definitions for logging. -----------------------*/ | ||
385 | |||
386 | /* Supported syslog facilities. */ | ||
387 | typedef enum | ||
388 | { | ||
389 | SYSLOG_FACILITY_DAEMON, | ||
390 | SYSLOG_FACILITY_USER, | ||
391 | SYSLOG_FACILITY_AUTH, | ||
392 | SYSLOG_FACILITY_LOCAL0, | ||
393 | SYSLOG_FACILITY_LOCAL1, | ||
394 | SYSLOG_FACILITY_LOCAL2, | ||
395 | SYSLOG_FACILITY_LOCAL3, | ||
396 | SYSLOG_FACILITY_LOCAL4, | ||
397 | SYSLOG_FACILITY_LOCAL5, | ||
398 | SYSLOG_FACILITY_LOCAL6, | ||
399 | SYSLOG_FACILITY_LOCAL7 | ||
400 | } SyslogFacility; | ||
401 | |||
402 | /* Initializes logging. If debug is non-zero, debug() will output something. | ||
403 | If quiet is non-zero, none of these will log send anything to syslog | ||
404 | (but maybe to stderr). */ | ||
405 | void log_init(char *av0, int on_stderr, int debug, int quiet, | ||
406 | SyslogFacility facility); | ||
407 | |||
408 | /* Outputs a message to syslog or stderr, depending on the implementation. | ||
409 | The format must guarantee that the final message does not exceed 1024 | ||
410 | characters. The message should not contain newline. */ | ||
411 | void log(const char *fmt, ...); | ||
412 | |||
413 | /* Outputs a message to syslog or stderr, depending on the implementation. | ||
414 | The format must guarantee that the final message does not exceed 1024 | ||
415 | characters. The message should not contain newline. */ | ||
416 | void debug(const char *fmt, ...); | ||
417 | |||
418 | /* Outputs a message to syslog or stderr, depending on the implementation. | ||
419 | The format must guarantee that the final message does not exceed 1024 | ||
420 | characters. The message should not contain newline. */ | ||
421 | void error(const char *fmt, ...); | ||
422 | |||
423 | /* Outputs a message to syslog or stderr, depending on the implementation. | ||
424 | The format must guarantee that the final message does not exceed 1024 | ||
425 | characters. The message should not contain newline. | ||
426 | This call never returns. */ | ||
427 | void fatal(const char *fmt, ...); | ||
428 | |||
429 | /* Registers a cleanup function to be called by fatal() before exiting. | ||
430 | It is permissible to call fatal_remove_cleanup for the function itself | ||
431 | from the function. */ | ||
432 | void fatal_add_cleanup(void (*proc)(void *context), void *context); | ||
433 | |||
434 | /* Removes a cleanup frunction to be called at fatal(). */ | ||
435 | void fatal_remove_cleanup(void (*proc)(void *context), void *context); | ||
436 | |||
437 | /*---------------- definitions for channels ------------------*/ | 425 | /*---------------- definitions for channels ------------------*/ |
438 | 426 | ||
439 | /* Sets specific protocol options. */ | 427 | /* Sets specific protocol options. */ |
@@ -547,9 +535,6 @@ void x11_request_forwarding(void); | |||
547 | This should be called in the client only. */ | 535 | This should be called in the client only. */ |
548 | void x11_request_forwarding_with_spoofing(const char *proto, const char *data); | 536 | void x11_request_forwarding_with_spoofing(const char *proto, const char *data); |
549 | 537 | ||
550 | /* Local Xauthority file (server only). */ | ||
551 | extern char *xauthfile; | ||
552 | |||
553 | /* Sends a message to the server to request authentication fd forwarding. */ | 538 | /* Sends a message to the server to request authentication fd forwarding. */ |
554 | void auth_request_forwarding(void); | 539 | void auth_request_forwarding(void); |
555 | 540 | ||
@@ -596,7 +581,8 @@ struct envstring { | |||
596 | 0 if the client could not be authenticated, and 1 if authentication was | 581 | 0 if the client could not be authenticated, and 1 if authentication was |
597 | successful. This may exit if there is a serious protocol violation. */ | 582 | successful. This may exit if there is a serious protocol violation. */ |
598 | int auth_krb4(const char *server_user, KTEXT auth, char **client); | 583 | int auth_krb4(const char *server_user, KTEXT auth, char **client); |
599 | int ssh_tf_init(uid_t uid); | 584 | int krb4_init(uid_t uid); |
585 | void krb4_cleanup_proc(void *ignore); | ||
600 | 586 | ||
601 | #ifdef AFS | 587 | #ifdef AFS |
602 | #include <kafs.h> | 588 | #include <kafs.h> |