diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 01bdc91a2..ee740be84 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,7 @@ +2004-08-27 Andrew V. Samoilov <sav bcs zp ua> + + * smbfs.c (smbfs_open_readwrite): Implement O_APPEND via smbfs_lseek(). + 2004-08-26 Roland Illig <roland.illig@gmx.de> * undelfs.c (undelfs_lstat): Adjusted declaration. diff --git a/vfs/smbfs.c b/vfs/smbfs.c index cd52847a5..2eea575bf 100644 --- a/vfs/smbfs.c +++ b/vfs/smbfs.c @@ -1746,8 +1746,10 @@ smbfs_open_readwrite (smbfs_handle *remote_handle, char *rname, int flags, int m DEBUG (3, ("smbfs_open: O_TRUNC\n")); remote_handle->fnum = - cli_open (remote_handle->cli, rname, flags & O_CREAT ? flags : O_RDONLY, - DENY_NONE); + cli_open (remote_handle->cli, rname, ((flags & O_CREAT) + || (flags == + (O_WRONLY | O_APPEND))) ? + flags : O_RDONLY, DENY_NONE); if (remote_handle->fnum == -1) { message (1, MSG_ERROR, _(" %s opening remote file %s "), @@ -1776,6 +1778,12 @@ smbfs_open_readwrite (smbfs_handle *remote_handle, char *rname, int flags, int m return NULL; } + if ((flags == (O_WRONLY | O_APPEND)) /* file.c:copy_file_file() -> do_append */ + && smbfs_lseek (remote_handle, 0, SEEK_END) == -1) { + cli_close (remote_handle->cli, remote_handle->fnum); + return NULL; + } + return remote_handle; }