* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
-extern struct current_user current_user;
-
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
-static int fake_perms_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf)
+static int fake_perms_stat(vfs_handle_struct *handle,
+ struct smb_filename *smb_fname)
{
int ret = -1;
- ret = SMB_VFS_NEXT_STAT(handle, fname, sbuf);
+ ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
if (ret == 0) {
- if (S_ISDIR(sbuf->st_mode)) {
- sbuf->st_mode = S_IFDIR | S_IRWXU;
+ if (S_ISDIR(smb_fname->st.st_ex_mode)) {
+ smb_fname->st.st_ex_mode = S_IFDIR | S_IRWXU;
} else {
- sbuf->st_mode = S_IRWXU;
+ smb_fname->st.st_ex_mode = S_IRWXU;
}
- sbuf->st_uid = current_user.ut.uid;
- sbuf->st_gid = current_user.ut.gid;
+ smb_fname->st.st_ex_uid = handle->conn->server_info->utok.uid;
+ smb_fname->st.st_ex_gid = handle->conn->server_info->utok.gid;
}
return ret;
}
-static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
+static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
{
int ret = -1;
- ret = SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf);
+ ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
if (ret == 0) {
- if (S_ISDIR(sbuf->st_mode)) {
- sbuf->st_mode = S_IFDIR | S_IRWXU;
+ if (S_ISDIR(sbuf->st_ex_mode)) {
+ sbuf->st_ex_mode = S_IFDIR | S_IRWXU;
} else {
- sbuf->st_mode = S_IRWXU;
+ sbuf->st_ex_mode = S_IRWXU;
}
- sbuf->st_uid = current_user.ut.uid;
- sbuf->st_gid = current_user.ut.gid;
+ sbuf->st_ex_uid = handle->conn->server_info->utok.uid;
+ sbuf->st_ex_gid = handle->conn->server_info->utok.gid;
}
return ret;
}