Project

General

Profile

Bug #7530 ยป 0001-NEX-6858-Non-admin-users-unable-to-mount-CIFS-shares.patch

Gordon Ross, 2016-11-03 03:38 PM

View differences:

usr/src/uts/common/fs/smbsrv/smb_tree.c
700 700
	char			*service = tcon->service;
701 701
	char			last_component[MAXNAMELEN];
702 702
	smb_tree_t		*tree;
703
	cred_t			*kcr;
703 704
	int			rc;
704 705
	uint32_t		access;
705 706
	smb_shr_execinfo_t	execinfo;
......
716 717

  
717 718
	/*
718 719
	 * Check that the shared directory exists.
720
	 * Client might not have access to the path _leading_ to the share,
721
	 * so we use "kcred" to get to the share root.
719 722
	 */
720
	rc = smb_pathname_reduce(sr, user->u_cred, si->shr_path, 0, 0, &dnode,
723
	kcr = zone_kcred();
724
	rc = smb_pathname_reduce(sr, kcr, si->shr_path, 0, 0, &dnode,
721 725
	    last_component);
722 726
	if (rc == 0) {
723
		rc = smb_fsop_lookup(sr, user->u_cred, SMB_FOLLOW_LINKS,
727
		rc = smb_fsop_lookup(sr, kcr, SMB_FOLLOW_LINKS,
724 728
		    sr->sr_server->si_root_smb_node, dnode, last_component,
725 729
		    &snode);
726 730

  
    (1-1/1)