DO NOT REPLY [Bug 5027] Perms in do_mkstemp are not always valid

2007-10-19 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=5027





--- Comment #1 from [EMAIL PROTECTED]  2007-10-19 21:01 CST ---
Created an attachment (id=2947)
 -- (https://bugzilla.samba.org/attachment.cgi?id=2947action=view)
Make sure the user has write permission to the temp file


-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug, or are watching the QA contact.
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


DO NOT REPLY [Bug 5027] New: Perms in do_mkstemp are not always valid

2007-10-19 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=5027

   Summary: Perms in do_mkstemp are not always valid
   Product: rsync
   Version: 2.6.9
  Platform: x86
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P3
 Component: core
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
 QAContact: [EMAIL PROTECTED]


I'm trying to rsync (with -a to preserve permissions) to a mount point on an
NFS server, and it fails when copying a file that is read-only.  The problem is
that do_mkstemp creates the temp file with the desired user permissions (either
with open() or with fchmod().

SUSv3 says that the affect of chmod()/fchmod() on existing open file
descriptors is implemtation defined; it also says:

Any file descriptors currently open by any process on the file could
possibly become invalid if the mode of the file is changed to a value which
would deny access to that process. One situation where this could occur is
on a stateless file system. This behavior will not occur in a conforming
environment.

I guess I have a non-conforming environment (I'm talking to a unfs3 server).

If I remove HAVE_FCHMOD, it still doesn't work, because the call to open()
includes the read-only permissions as well (a case I don't really see
referenced in SUSv3 right off).

The following patch makes sure that the user always has write permission to the
temp file:

diff -urN rsync-2.6.9-dist/syscall.c rsync-2.6.9/syscall.c
--- rsync-2.6.9-dist/syscall.c  2007-10-19 20:49:29.0 -0500
+++ rsync-2.6.9/syscall.c   2007-10-19 20:53:02.0 -0500
@@ -190,6 +190,7 @@
 {
RETURN_ERROR_IF(dry_run, 0);
RETURN_ERROR_IF(read_only, EROFS);
+   perms |= S_IWUSR;

 #if defined HAVE_SECURE_MKSTEMP  defined HAVE_FCHMOD  (!defined
HAVE_OPEN64 || defined HAVE_MKSTEMP64)
{


-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug, or are watching the QA contact.
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


The Number One Success System Gifting

2007-10-19 Thread Tommy Lee
http://www.noss123.com/

is a party who acts as an intermediary between sellers and buyers of real
estate and attempts to find sellers who wish to sell and buyers who wish to
buy. In the United States, the relationship was originally established by
reference to the English common law of agency with the broker having a
fiduciary relationship with his clients. Estate agent is the term used in
the United Kingdom to describe a person or organization whose business is to
market real estate on behalf of clients.
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html