1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

r23106: Use lchown for symlinks.

Jeremy.
(This used to be commit b98175440b2c235fe223b4375441f15ea027a5b2)
This commit is contained in:
Jeremy Allison 2007-05-24 00:13:24 +00:00 committed by Gerald (Jerry) Carter
parent 57d6318a0b
commit f5038178a9

View File

@ -5268,9 +5268,18 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n",
*/
if ((set_owner != (uid_t)SMB_UID_NO_CHANGE) && (psbuf->st_uid != set_owner)) {
DEBUG(10,("smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC changing owner %u for file %s\n",
int ret;
DEBUG(10,("smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC changing owner %u for path %s\n",
(unsigned int)set_owner, fname ));
if (SMB_VFS_CHOWN(conn, fname, set_owner, (gid_t)-1) != 0) {
if (S_ISLNK(psbuf->st_mode)) {
ret = SMB_VFS_LCHOWN(conn, fname, set_owner, (gid_t)-1);
} else {
ret = SMB_VFS_CHOWN(conn, fname, set_owner, (gid_t)-1);
}
if (ret != 0) {
status = map_nt_error_from_unix(errno);
if (delete_on_fail) {
SMB_VFS_UNLINK(conn,fname);