Bug 877 - evaluate errno value in vfswrap_rename
evaluate errno value in vfswrap_rename
Status: RESOLVED WONTFIX
Product: Samba 2.2
Classification: Unclassified
Component: File Services
2.2.8a
All All
: P5 minor
: ---
Assigned To: Gerald (Jerry) Carter
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-10 22:04 UTC by YAMASAKI Hiroyuki
Modified: 2004-02-17 08:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description YAMASAKI Hiroyuki 2003-12-10 22:04:43 UTC
In samba 2.2.8a and 3.0.1rc1, 
smbd/vfs-wrap.c/vfswrap_rename() call rename() and evaluate errno value without 
checking return value of rename().

I think correct condition is "result != 0 && errno == EXDEV".

--------------------------------------------------------
int vfswrap_rename(...)
{
	int result;

	START_PROFILE(syscall_rename);
	result = rename(old, new);
	if (errno == EXDEV) {
         ^^^^^^^^^^^^^^^^^^^^^^
		/* Rename across filesystems needed. */
		result = copy_reg(old, new);
	}

	END_PROFILE(syscall_rename);
	return result;
}
--------------------------------------------------------
Comment 1 Gerald (Jerry) Carter 2004-02-17 08:45:31 UTC
Sorry, but the 2.2 is not under development any longer.
If you can reproduce this bug against the latest 3.0 release, 
please reopen this bug and change the version in the report.
Thanks.