hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sra...@apache.org
Subject svn commit: r1361025 - in /hadoop/common/branches/branch-1-win: CHANGES.txt src/winutils/chmod.c src/winutils/chown.c
Date Fri, 13 Jul 2012 00:59:19 GMT
Author: sradia
Date: Fri Jul 13 00:59:19 2012
New Revision: 1361025

URL: http://svn.apache.org/viewvc?rev=1361025&view=rev
Log:
HADOOP-8544 Move an assertion location in 'winutils chmod' (Chuan Liu via sanjay)

Modified:
    hadoop/common/branches/branch-1-win/CHANGES.txt
    hadoop/common/branches/branch-1-win/src/winutils/chmod.c
    hadoop/common/branches/branch-1-win/src/winutils/chown.c

Modified: hadoop/common/branches/branch-1-win/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/CHANGES.txt?rev=1361025&r1=1361024&r2=1361025&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1-win/CHANGES.txt Fri Jul 13 00:59:19 2012
@@ -62,6 +62,8 @@ branch-hadoop-1-win - unreleased
     HADOOP-8414 Address problems related to localhost resolving to 127.0.0.1 on Windows
     (Ivan Mitic via Sanjay Radia)
 
+    HADOOP-8544 Move an assertion location in 'winutils chmod' (Chuan Liu via sanjay)
+
 BUG FIXES
 
     HDFS-6527. Backport HADOOP-7389: Use of TestingGroups by tests causes

Modified: hadoop/common/branches/branch-1-win/src/winutils/chmod.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/winutils/chmod.c?rev=1361025&r1=1361024&r2=1361025&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/winutils/chmod.c (original)
+++ hadoop/common/branches/branch-1-win/src/winutils/chmod.c Fri Jul 13 00:59:19 2012
@@ -593,20 +593,22 @@ static USHORT ComputeNewMode(__in USHORT
   USHORT mask = 0;
   USHORT mode = 0;
 
-  // Operations are exclusive
+  // Operations are exclusive, and cannot be invalid
   //
   assert(op == CHMOD_OP_EQUAL || op == CHMOD_OP_PLUS || op == CHMOD_OP_MINUS);
 
-  // We should have only permissions or a reference target, not both.
+  // Nothing needs to be changed if there is not permission or reference
   //
-  assert((perm != CHMOD_PERM_NA && ref == CHMOD_WHO_NONE) ||
-    (perm == CHMOD_PERM_NA && ref != CHMOD_WHO_NONE));
-
   if(perm == CHMOD_PERM_NA && ref == CHMOD_WHO_NONE)
   {
     return oldMode;
   }
 
+  // We should have only permissions or a reference target, not both.
+  //
+  assert((perm != CHMOD_PERM_NA && ref == CHMOD_WHO_NONE) ||
+    (perm == CHMOD_PERM_NA && ref != CHMOD_WHO_NONE));
+
   if (perm != CHMOD_PERM_NA)
   {
     if ((perm & CHMOD_PERM_R) == CHMOD_PERM_R)

Modified: hadoop/common/branches/branch-1-win/src/winutils/chown.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/winutils/chown.c?rev=1361025&r1=1361024&r2=1361025&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/winutils/chown.c (original)
+++ hadoop/common/branches/branch-1-win/src/winutils/chown.c Fri Jul 13 00:59:19 2012
@@ -181,7 +181,7 @@ static BOOL CreateDaclForNewOwner(
 
   assert(pDACL != NULL && ppNewDACL != NULL);
   assert(pOldOwnerSid != NULL && pOldGroupSid != NULL);
-  assert(pNewOwnerSid != NULL || pNewOwnerSid != NULL);
+  assert(pNewOwnerSid != NULL || pNewGroupSid != NULL);
 
   if (!GetAclInformation(pDACL, (LPVOID)&aclSizeInfo,
     sizeof(ACL_SIZE_INFORMATION), AclSizeInformation))



Mime
View raw message