From 34bb0c7431d4e41e506eb51cc4a39251110d3f49 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Tue, 13 Feb 2001 02:40:56 +0000 Subject: - (bal) Use chown() if fchown() does not exist in ftp-server.c patch by Tim Rice --- ChangeLog | 4 +++- configure.in | 6 +++--- sftp-server.c | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72566dca4..581181db9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ - (bal) Cleaned out bsd-snprintf.c. VARARGS have been banished and I did a base KNF over the whe whole file to make it more acceptable. (backed out of original patch and removed it from ChangeLog) + - (bal) Use chown() if fchown() does not exist in ftp-server.c patch by + Tim Rice 20010212 - (djm) Update Redhat specfile to allow --define "skip_x11_askpass 1", @@ -3910,4 +3912,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.752 2001/02/13 02:18:50 mouring Exp $ +$Id: ChangeLog,v 1.753 2001/02/13 02:40:56 mouring Exp $ diff --git a/configure.in b/configure.in index b52448f46..b61673acd 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.236 2001/02/13 01:11:17 djm Exp $ +# $Id: configure.in,v 1.237 2001/02/13 02:40:56 mouring Exp $ AC_INIT(ssh.c) @@ -325,10 +325,10 @@ AC_CHECK_FUNC(utimes, ) # Checks for header files. -AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h regex.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/queue.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stddef.h time.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h) +AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h regex.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/queue.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stdarg.h stddef.h time.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h) dnl Checks for library functions. -AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop) +AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop) dnl Checks for time functions AC_CHECK_FUNCS(gettimeofday time) dnl Checks for libutil functions diff --git a/sftp-server.c b/sftp-server.c index 346411e79..0291da206 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -609,7 +609,11 @@ process_fsetstat(void) status = errno_to_portable(errno); } if (a->flags & SSH2_FILEXFER_ATTR_UIDGID) { +#ifdef HAVE_FCHOWN ret = fchown(fd, a->uid, a->gid); +#else + ret = chown(name, a->uid, a->gid); +#endif if (ret == -1) status = errno_to_portable(errno); } -- cgit v1.2.3