3 source/file.c | 18 ++++++++++++++++--
4 1 file changed, 16 insertions(+), 2 deletions(-)
6 diff --quilt old/source/file.c new/source/file.c
9 @@ -69,6 +69,7 @@ static const char CVSID[] = "$Id: file.c
16 #include <Xm/ToggleB.h>
17 @@ -1361,6 +1362,7 @@ static int writeBckVersion(WindowInfo *w
21 + struct utimbuf utimbuf;
22 #define IO_BUFFER_SIZE ((size_t)(1024*1024))
24 /* Do only if version backups are turned on */
25 @@ -1390,8 +1392,8 @@ static int writeBckVersion(WindowInfo *w
28 /* Get permissions of the file.
29 - We preserve the normal permissions but not ownership, extended
30 - attributes, et cetera. */
31 + We preserve the normal permissions but not extended attributes,
33 if (fstat(in_fd, &statbuf) != 0) {
36 @@ -1410,6 +1412,14 @@ static int writeBckVersion(WindowInfo *w
37 return bckError(window, "fchmod() failed", bckname);
40 + /* Set ownership on new file */
41 + if (fchown(out_fd, statbuf.st_uid, statbuf.st_gid) != 0) {
45 + return bckError(window, "fchown() failed", bckname);
48 /* Allocate I/O buffer */
49 io_buffer = (char*) malloc(IO_BUFFER_SIZE);
50 if (NULL == io_buffer) {
51 @@ -1454,6 +1464,10 @@ static int writeBckVersion(WindowInfo *w
55 + utimbuf.actime = statbuf.st_atime;
56 + utimbuf.modtime = statbuf.st_mtime;
57 + utime(bckname, &utimbuf);