diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.c | 21 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.h | 5 |
4 files changed, 31 insertions, 5 deletions
@@ -1,3 +1,7 @@ | |||
1 | 20020507 | ||
2 | - (tim) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h] | ||
3 | Add truncate() emulation to address Bug 208 | ||
4 | |||
1 | 20020506 | 5 | 20020506 |
2 | - (djm) Unbreak auth-passwd.c for PAM and SIA | 6 | - (djm) Unbreak auth-passwd.c for PAM and SIA |
3 | - (djm) Unbreak PAM auth for protocol 1. Report from Pekka Savola | 7 | - (djm) Unbreak PAM auth for protocol 1. Report from Pekka Savola |
@@ -535,4 +539,4 @@ | |||
535 | - (stevesk) entropy.c: typo in debug message | 539 | - (stevesk) entropy.c: typo in debug message |
536 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ | 540 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ |
537 | 541 | ||
538 | $Id: ChangeLog,v 1.2095 2002/05/08 02:27:55 djm Exp $ | 542 | $Id: ChangeLog,v 1.2096 2002/05/08 02:51:31 tim Exp $ |
diff --git a/configure.ac b/configure.ac index a092aaadb..cc79ce8ad 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.53 2002/04/25 18:17:05 stevesk Exp $ | 1 | # $Id: configure.ac,v 1.54 2002/05/08 02:51:32 tim Exp $ |
2 | 2 | ||
3 | AC_INIT | 3 | AC_INIT |
4 | AC_CONFIG_SRCDIR([ssh.c]) | 4 | AC_CONFIG_SRCDIR([ssh.c]) |
@@ -572,7 +572,7 @@ AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \ | |||
572 | realpath recvmsg rresvport_af sendmsg setdtablesize setegid \ | 572 | realpath recvmsg rresvport_af sendmsg setdtablesize setegid \ |
573 | setenv seteuid setlogin setproctitle setresgid setreuid setrlimit \ | 573 | setenv seteuid setlogin setproctitle setresgid setreuid setrlimit \ |
574 | setsid setvbuf sigaction sigvec snprintf socketpair strerror \ | 574 | setsid setvbuf sigaction sigvec snprintf socketpair strerror \ |
575 | strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes \ | 575 | strlcat strlcpy strmode strsep sysconf tcgetpgrp truncate utimes \ |
576 | vhangup vsnprintf waitpid __b64_ntop _getpty) | 576 | vhangup vsnprintf waitpid __b64_ntop _getpty) |
577 | 577 | ||
578 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen | 578 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 7bf46dd75..237f93931 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | 26 | ||
27 | RCSID("$Id: bsd-misc.c,v 1.5 2001/10/10 20:38:56 mouring Exp $"); | 27 | RCSID("$Id: bsd-misc.c,v 1.6 2002/05/08 02:51:32 tim Exp $"); |
28 | 28 | ||
29 | char *get_progname(char *argv0) | 29 | char *get_progname(char *argv0) |
30 | { | 30 | { |
@@ -99,3 +99,22 @@ int utimes(char *filename, struct timeval *tvp) | |||
99 | return(utime(filename, &ub)); | 99 | return(utime(filename, &ub)); |
100 | } | 100 | } |
101 | #endif | 101 | #endif |
102 | |||
103 | #ifndef HAVE_TRUNCATE | ||
104 | int truncate (const char *path, off_t length) | ||
105 | { | ||
106 | int fd, ret, saverrno; | ||
107 | |||
108 | fd = open(path, O_WRONLY); | ||
109 | if (fd < 0) | ||
110 | return -1; | ||
111 | |||
112 | ret = ftruncate(fd, length); | ||
113 | saverrno = errno; | ||
114 | (void) close (fd); | ||
115 | if (ret == -1) | ||
116 | errno = saverrno; | ||
117 | return(ret); | ||
118 | } | ||
119 | #endif /* HAVE_TRUNCATE */ | ||
120 | |||
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index 2ca0f3704..9475a2945 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | /* $Id: bsd-misc.h,v 1.3 2001/04/09 14:50:56 stevesk Exp $ */ | 25 | /* $Id: bsd-misc.h,v 1.4 2002/05/08 02:51:32 tim Exp $ */ |
26 | 26 | ||
27 | #ifndef _BSD_MISC_H | 27 | #ifndef _BSD_MISC_H |
28 | #define _BSD_MISC_H | 28 | #define _BSD_MISC_H |
@@ -72,5 +72,8 @@ struct timeval { | |||
72 | int utimes(char *filename, struct timeval *tvp); | 72 | int utimes(char *filename, struct timeval *tvp); |
73 | #endif /* HAVE_UTIMES */ | 73 | #endif /* HAVE_UTIMES */ |
74 | 74 | ||
75 | #ifndef HAVE_TRUNCATE | ||
76 | int truncate (const char *path, off_t length); | ||
77 | #endif /* HAVE_TRUNCATE */ | ||
75 | 78 | ||
76 | #endif /* _BSD_MISC_H */ | 79 | #endif /* _BSD_MISC_H */ |