Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57675e6e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] Fix typo in previous commit
  [CIFS] Fix define for new proxy cap to match documentation
  [CIFS] Fix UNC path prefix on QueryUnixPathInfo to have correct slash
  [CIFS] Reserve new proxy cap for WAFS
  [CIFS] Add various missing flags and defintions
  [CIFS] make cifs_dfs_automount_list_static
  [CIFS] Fix oops when slow oplock process races with unmount
  [CIFS] Fix acl length when very short ACL being modified by chmod
  [CIFS] Fix looping on reconnect to Samba when unexpected tree connect fail on reconnect
  [CIFS] minor update to change log
parents 02f37050 a7f796a6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@ of second share to disconnected server session (autoreconnect on this).
Add ability to modify cifs acls for handling chmod (when mounted with
cifsacl flag). Fix prefixpath path separator so we can handle mounts
with prefixpaths longer than one directory (one path component) when
mounted to Windows servers.
mounted to Windows servers.  Fix slow file open when cifsacl
enabled.

Version 1.51
------------
+8 −1
Original line number Diff line number Diff line
@@ -3,7 +3,14 @@ features such as hierarchical dfs like namespace, hardlinks, locking and more.
It was designed to comply with the SNIA CIFS Technical Reference (which 
supersedes the 1992 X/Open SMB Standard) as well as to perform best practice 
practical interoperability with Windows 2000, Windows XP, Samba and equivalent 
servers.  
servers.  This code was developed in participation with the Protocol Freedom
Information Foundation.

Please see
  http://protocolfreedom.org/ and
  http://samba.org/samba/PFIF/
for more details.


For questions or bug reports please contact:
    sfrench@samba.org (sfrench@us.ibm.com) 
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#include "dns_resolve.h"
#include "cifs_debug.h"

LIST_HEAD(cifs_dfs_automount_list);
static LIST_HEAD(cifs_dfs_automount_list);

/*
 * DFS functions
+8 −6
Original line number Diff line number Diff line
@@ -516,7 +516,7 @@ static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len,

/* Convert permission bits from mode to equivalent CIFS ACL */
static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
				int acl_len, struct inode *inode, __u64 nmode)
				struct inode *inode, __u64 nmode)
{
	int rc = 0;
	__u32 dacloffset;
@@ -692,14 +692,14 @@ void acl_to_uid_mode(struct inode *inode, const char *path, const __u16 *pfid)
int mode_to_acl(struct inode *inode, const char *path, __u64 nmode)
{
	int rc = 0;
	__u32 acllen = 0;
	__u32 secdesclen = 0;
	struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */
	struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */

	cFYI(DBG2, ("set ACL from mode for %s", path));

	/* Get the security descriptor */
	pntsd = get_cifs_acl(&acllen, inode, path, NULL);
	pntsd = get_cifs_acl(&secdesclen, inode, path, NULL);

	/* Add three ACEs for owner, group, everyone getting rid of
	   other ACEs as chmod disables ACEs and set the security descriptor */
@@ -709,20 +709,22 @@ int mode_to_acl(struct inode *inode, const char *path, __u64 nmode)
		   set security descriptor request security descriptor
		   parameters, and secuirty descriptor itself */

		pnntsd = kmalloc(acllen, GFP_KERNEL);
		secdesclen = secdesclen < DEFSECDESCLEN ?
					DEFSECDESCLEN : secdesclen;
		pnntsd = kmalloc(secdesclen, GFP_KERNEL);
		if (!pnntsd) {
			cERROR(1, ("Unable to allocate security descriptor"));
			kfree(pntsd);
			return (-ENOMEM);
		}

		rc = build_sec_desc(pntsd, pnntsd, acllen, inode, nmode);
		rc = build_sec_desc(pntsd, pnntsd, inode, nmode);

		cFYI(DBG2, ("build_sec_desc rc: %d", rc));

		if (!rc) {
			/* Set the security descriptor */
			rc = set_cifs_acl(pnntsd, acllen, inode, path);
			rc = set_cifs_acl(pnntsd, secdesclen, inode, path);
			cFYI(DBG2, ("set_cifs_acl rc: %d", rc));
		}

+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#define NUM_SUBAUTHS 5 /* number of sub authority fields */
#define NUM_WK_SIDS 7 /* number of well known sids */
#define SIDNAMELENGTH 20 /* long enough for the ones we care about */
#define DEFSECDESCLEN 192 /* sec desc len contaiting a dacl with three aces */

#define READ_BIT        0x4
#define WRITE_BIT       0x2
Loading