|
Tomáš Mráz |
e01ed6 |
--- openssh-3.9p1/log.h.log-chroot 2006-02-22 10:54:04.000000000 +0100
|
|
Tomáš Mráz |
e01ed6 |
+++ openssh-3.9p1/log.h 2006-02-22 10:53:29.000000000 +0100
|
|
Tomáš Mráz |
e01ed6 |
@@ -63,4 +63,6 @@
|
|
Tomáš Mráz |
e01ed6 |
|
|
Tomáš Mráz |
e01ed6 |
void do_log(LogLevel, const char *, va_list);
|
|
Tomáš Mráz |
e01ed6 |
void cleanup_exit(int) __dead;
|
|
Tomáš Mráz |
e01ed6 |
+
|
|
Tomáš Mráz |
e01ed6 |
+void open_log(void);
|
|
Tomáš Mráz |
e01ed6 |
#endif
|
|
Tomáš Mráz |
e01ed6 |
--- openssh-3.9p1/log.c.log-chroot 2006-02-22 13:29:48.000000000 +0100
|
|
Tomáš Mráz |
e01ed6 |
+++ openssh-3.9p1/log.c 2006-02-22 10:56:01.000000000 +0100
|
|
Tomáš Mráz |
e01ed6 |
@@ -48,6 +48,7 @@
|
|
Tomáš Mráz |
e01ed6 |
static int log_on_stderr = 1;
|
|
Tomáš Mráz |
e01ed6 |
static int log_facility = LOG_AUTH;
|
|
Tomáš Mráz |
e01ed6 |
static char *argv0;
|
|
Tomáš Mráz |
e01ed6 |
+static int log_fd_keep;
|
|
Tomáš Mráz |
e01ed6 |
|
|
Tomáš Mráz |
e01ed6 |
extern char *__progname;
|
|
Tomáš Mráz |
e01ed6 |
|
|
Tomáš Mráz |
e01ed6 |
@@ -330,9 +331,20 @@
|
|
Tomáš Mráz |
e01ed6 |
syslog_r(pri, &sdata, "%.500s", fmtbuf);
|
|
Tomáš Mráz |
e01ed6 |
closelog_r(&sdata);
|
|
Tomáš Mráz |
e01ed6 |
#else
|
|
Tomáš Mráz |
e01ed6 |
+ if (!log_fd_keep) {
|
|
Tomáš Mráz |
e01ed6 |
openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility);
|
|
Tomáš Mráz |
e01ed6 |
+ }
|
|
Tomáš Mráz |
e01ed6 |
syslog(pri, "%.500s", fmtbuf);
|
|
Tomáš Mráz |
e01ed6 |
+ if (!log_fd_keep) {
|
|
Tomáš Mráz |
e01ed6 |
closelog();
|
|
Tomáš Mráz |
e01ed6 |
+ }
|
|
Tomáš Mráz |
e01ed6 |
#endif
|
|
Tomáš Mráz |
e01ed6 |
}
|
|
Tomáš Mráz |
e01ed6 |
}
|
|
Tomáš Mráz |
e01ed6 |
+
|
|
Tomáš Mráz |
e01ed6 |
+void
|
|
Tomáš Mráz |
e01ed6 |
+open_log(void)
|
|
Tomáš Mráz |
e01ed6 |
+{
|
|
Tomáš Mráz |
e01ed6 |
+ openlog(argv0 ? argv0 : __progname, LOG_PID|LOG_NDELAY, log_facility);
|
|
Tomáš Mráz |
e01ed6 |
+ log_fd_keep = 1;
|
|
Tomáš Mráz |
e01ed6 |
+}
|
|
Tomáš Mráz |
e01ed6 |
--- openssh-3.9p1/sshd.c.log-chroot 2006-01-11 13:42:32.000000000 +0100
|
|
Tomáš Mráz |
e01ed6 |
+++ openssh-3.9p1/sshd.c 2006-02-22 18:58:24.000000000 +0100
|
|
Tomáš Mráz |
e01ed6 |
@@ -565,6 +565,10 @@
|
|
Tomáš Mráz |
e01ed6 |
memset(pw->pw_passwd, 0, strlen(pw->pw_passwd));
|
|
Tomáš Mráz |
e01ed6 |
endpwent();
|
|
Tomáš Mráz |
e01ed6 |
|
|
Tomáš Mráz |
e01ed6 |
+ /* Open the syslog permanently so the chrooted process still
|
|
Tomáš Mráz |
e01ed6 |
+ can write to syslog. */
|
|
Tomáš Mráz |
e01ed6 |
+ open_log();
|
|
Tomáš Mráz |
e01ed6 |
+
|
|
Tomáš Mráz |
e01ed6 |
/* Change our root directory */
|
|
Tomáš Mráz |
e01ed6 |
if (chroot(_PATH_PRIVSEP_CHROOT_DIR) == -1)
|
|
Tomáš Mráz |
e01ed6 |
fatal("chroot(\"%s\"): %s", _PATH_PRIVSEP_CHROOT_DIR,
|