mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Add an autoconf test and workaround for futimes(3).
Not every system provides it (e.g. uClibc-ng); if one does not, the Uppity SFTP server should now degrade sensibly to refusing attempts to set the utimes on an already-open file.
This commit is contained in:
@ -412,6 +412,16 @@ static void uss_fstat(SftpServer *srv, SftpReplyBuilder *reply,
|
||||
}
|
||||
}
|
||||
|
||||
#if !HAVE_FUTIMES
|
||||
static inline int futimes(int fd, const struct timeval tv[2])
|
||||
{
|
||||
/* If the OS doesn't support futimes(3) then we have to pretend it
|
||||
* always returns failure */
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The guts of setstat and fsetstat, macroised so that they can call
|
||||
* fchown(fd,...) or chown(path,...) depending on parameters.
|
||||
|
Reference in New Issue
Block a user