Blame SOURCES/0001-get-setcifsacl-fix-bad-bit-shifts.patch

40fde1
From 99d2a5a4517216a63cfdeef3ee30656938b3a98e Mon Sep 17 00:00:00 2001
40fde1
From: Jeff Layton <jlayton@samba.org>
40fde1
Date: Tue, 8 Oct 2013 21:07:24 -0400
40fde1
Subject: [PATCH] get/setcifsacl: fix bad bit-shifts
40fde1
MIME-Version: 1.0
40fde1
Content-Type: text/plain; charset=UTF-8
40fde1
Content-Transfer-Encoding: 8bit
40fde1
40fde1
A Coverity scan turned up this warning:
40fde1
40fde1
1. cifs-utils-6.2/setcifsacl.c:578:result_independent_of_operands – "(x & 0xff0000000000ULL) >> 48" is 0 regardless of the values of its operands. This occurs as the operand of assignment.
40fde1
40fde1
...which is entirely true. That shift should be 40 bits, not 48. Also
40fde1
fix a similar bug in getcifsacl.c.
40fde1
40fde1
Signed-off-by: Jeff Layton <jlayton@samba.org>
40fde1
---
40fde1
 getcifsacl.c | 2 +-
40fde1
 setcifsacl.c | 2 +-
40fde1
 2 files changed, 2 insertions(+), 2 deletions(-)
40fde1
40fde1
diff --git a/getcifsacl.c b/getcifsacl.c
40fde1
index b8998ef..33f36b4 100644
40fde1
--- a/getcifsacl.c
40fde1
+++ b/getcifsacl.c
40fde1
@@ -198,7 +198,7 @@ print_sid_raw:
40fde1
 	id_auth_val += (unsigned long long)csid->authority[3] << 16;
40fde1
 	id_auth_val += (unsigned long long)csid->authority[2] << 24;
40fde1
 	id_auth_val += (unsigned long long)csid->authority[1] << 32;
40fde1
-	id_auth_val += (unsigned long long)csid->authority[0] << 48;
40fde1
+	id_auth_val += (unsigned long long)csid->authority[0] << 40;
40fde1
 
40fde1
 	/*
40fde1
 	 * MS-DTYP states that if the authority is >= 2^32, then it should be
40fde1
diff --git a/setcifsacl.c b/setcifsacl.c
40fde1
index ce708eb..7eeeaa6 100644
40fde1
--- a/setcifsacl.c
40fde1
+++ b/setcifsacl.c
40fde1
@@ -575,7 +575,7 @@ raw_str_to_sid(const char *str, struct cifs_sid *csid)
40fde1
 	csid->authority[3] = (x & 0x000000ff0000ULL) >> 16;
40fde1
 	csid->authority[2] = (x & 0x0000ff000000ULL) >> 24;
40fde1
 	csid->authority[1] = (x & 0x00ff00000000ULL) >> 32;
40fde1
-	csid->authority[0] = (x & 0xff0000000000ULL) >> 48;
40fde1
+	csid->authority[0] = (x & 0xff0000000000ULL) >> 40;
40fde1
 
40fde1
 	/* now read the the subauthorities and store as __le32 vals */
40fde1
 	p = q + 1;
40fde1
-- 
40fde1
1.8.3.1
40fde1