Ignore:
Timestamp:
Jul 2, 2011, 4:01:14 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update vendor to version 3.5.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/smbd/dosmode.c

    r594 r597  
    794794        }
    795795
     796        /*
     797         * From the chmod 2 man page:
     798         *
     799         * "If the calling process is not privileged, and the group of the file
     800         * does not match the effective group ID of the process or one of its
     801         * supplementary group IDs, the S_ISGID bit will be turned off, but
     802         * this will not cause an error to be returned."
     803         *
     804         * Simply refuse to do the chmod in this case.
     805         */
     806
     807        if (S_ISDIR(smb_fname->st.st_ex_mode) && (unixmode & S_ISGID) &&
     808                        geteuid() != sec_initial_uid() &&
     809                        !current_user_in_group(smb_fname->st.st_ex_gid)) {
     810                DEBUG(3,("file_set_dosmode: setgid bit cannot be "
     811                        "set for directory %s\n",
     812                        smb_fname_str_dbg(smb_fname)));
     813                errno = EPERM;
     814                return -1;
     815        }
     816
     817
    796818        ret = SMB_VFS_CHMOD(conn, smb_fname->base_name, unixmode);
    797819        if (ret == 0) {
Note: See TracChangeset for help on using the changeset viewer.