Bug 877 - evaluate errno value in vfswrap_rename
Summary: evaluate errno value in vfswrap_rename
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 2.2
Classification: Unclassified
Component: File Services (show other bugs)
Version: 2.2.8a
Hardware: All All
: P5 minor
Target Milestone: ---
Assignee: Gerald (Jerry) Carter (dead mail address)
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
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 (dead mail address) 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.