Fw: Uid set instead of gid in smb_set_file_unix_basic

David Disseldorp ddiss at samba.org
Mon Apr 9 12:31:54 UTC 2018

Thanks for the mail. Forwarding this through to the list until we have
the email rejection issue resolved...

Begin forwarded message:

Date: Mon, 9 Apr 2018 11:59:09 +0000
From: "Rungta, Vandana"
To: "samba-technical-owner"
Subject: Uid set instead of gid in smb_set_file_unix_basic


I tried to send the following email to the samba-technical mailing list – but the email was rejected.

Please check the following source code:

In file source3/smbd/trans2.c – in function smb_set_file_unix_basic –  under the section of code “Deal with the UNIX specific gid set” if fd != -1

  1.  The uid is being set instead of gid.
  2.  The log message right before that line displays set_owner instead of set_grp.

ret = SMB_VFS_FCHOWN(fsp, set_owner, (gid_t)-1);  ==> ret = SMB_VFS_FCHOWN(fsp, (uid_t)-1, set_grp);

                * Deal with the UNIX specific gid set.

                if ((set_grp != (uid_t)SMB_GID_NO_CHANGE) &&
                    (sbuf.st_ex_gid != set_grp)) {
                                int ret;

                                DEBUG(10,("smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC "
                                                  "changing group %u for file %s\n",
                                                  (unsigned int)set_owner,
                                if (fsp && fsp->fh->fd != -1) {
                                                ret = SMB_VFS_FCHOWN(fsp, set_owner, (gid_t)-1);

Vandana Rungta

More information about the samba-technical mailing list