View Issue Details

IDProjectCategoryView StatusLast Update
0028391Open CASCADEOCCT:Foundation Classespublic2017-09-29 16:24
Reporterkgv Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindows 
Product Version7.1.0 
Target Version7.2.0Fixed in Version7.2.0 
Summary0028391: Foundation Classes - OSD_Directory returns incorrect protection flags for shared directory on Windows
DescriptionWhile fetching information for shared directory on the server (Samba), OSD_Directory::Protection() returns incorrect values - all zeros (no access).

This is because flags parser does not handle possible values like FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE (as a bitmask, not as raw values):
static OSD_SingleProtection __fastcall _get_protection_dir ( DWORD mask ) {

 OSD_SingleProtection retVal;

 switch ( mask ) {
 
  case GENERIC_READ:

   retVal = OSD_R;

  break;

  case GENERIC_WRITE:

   retVal = OSD_W;

  break;

  case GENERIC_READ | GENERIC_WRITE:

   retVal = OSD_RW;

  break;

  case GENERIC_EXECUTE:

   retVal = OSD_X;

  break;

  case GENERIC_READ | GENERIC_EXECUTE:

   retVal = OSD_RX;

  break;

  case GENERIC_WRITE | GENERIC_EXECUTE:

   retVal = OSD_WX;

  break;

  case GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE:

   retVal = OSD_RWX;

  break;

  case DELETE:

   retVal = OSD_D;

  break;

  case GENERIC_READ | DELETE:

   retVal = OSD_RD;

  break;

  case GENERIC_WRITE | DELETE:

   retVal = OSD_WD;

  break;

  case GENERIC_READ | GENERIC_WRITE | DELETE:

   retVal = OSD_RWD;

  break;

  case GENERIC_EXECUTE | DELETE:

   retVal = OSD_XD;

  break;

  case GENERIC_READ | GENERIC_EXECUTE | DELETE:

   retVal = OSD_RXD;

  break;

  case GENERIC_WRITE | GENERIC_EXECUTE | DELETE:

   retVal = OSD_WXD;

  break;

  case FILE_ALL_ACCESS:
  case GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | DELETE:

   retVal = OSD_RWXD;

  break;

  case 0:
  default:

   retVal = OSD_None;
 
 }  // end switch

 return retVal;

}  // end _get_protection_dir
TagsNo tags attached.
Test case numberNot needed

Activities

git

2017-01-25 17:51

administrator   ~0063038

Branch CR28391 has been created by kgv.

SHA-1: 50e606a40b31b6e73162cac865b87b27f31c328d


Detailed log of new commits:

Author: kgv
Date: Wed Jan 25 17:51:03 2017 +0300

    0028391: Foundation Classes - OSD_Directory returns incorrect protection flags for shared directory on Windows
    
    Redirect Folder reading flags to File reading flags when Folder flags are not found.

kgv

2017-01-25 17:51

developer   ~0063039

Patch is ready for review.

abv

2017-01-26 12:26

manager   ~0063077

No remarks, please test

git

2017-01-26 17:34

administrator   ~0063099

Branch CR28391 has been updated forcibly by apv.

SHA-1: ce3eeed343102d0b87f9fed54fa5da3482b0dd36

apv

2017-01-26 17:35

tester   ~0063100

Branch CR28391 has been rebased on IR-2017-01-26

apv

2017-01-27 13:30

tester   ~0063113

Dear BugMaster,

Branch CR28391 from occt git-repository (and IR-2017-01-26 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: ce3eeed343102d0b87f9fed54fa5da3482b0dd36

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 63
   Windows: 0
   MacOS: 1132

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 92049970 / 92312736 [-0.28%]
Total CPU difference: 19922.620000000115 / 19913.910000000214 [+0.04%]

Testing on Windows:
Total MEMORY difference: 57618584 / 57618048 [+0.00%]
Total CPU difference: 18344.812794198457 / 18683.178963198647 [-1.81%]

git

2017-02-08 11:36

administrator   ~0063627

Branch CR28391 has been deleted by kgv.

SHA-1: ce3eeed343102d0b87f9fed54fa5da3482b0dd36

Related Changesets

occt: master 2b3e2b78

2017-01-25 14:51:03

kgv


Committer: apn Details Diff
0028391: Foundation Classes - OSD_Directory returns incorrect protection flags for shared directory on Windows

Redirect Folder reading flags to File reading flags when Folder flags are not found.
Affected Issues
0028391
mod - src/OSD/OSD_File.cxx Diff File

Issue History

Date Modified Username Field Change
2017-01-25 17:07 kgv New Issue
2017-01-25 17:07 kgv Assigned To => abv
2017-01-25 17:49 kgv Summary Foundation Classes - OSD_Directory returns incorrect protection flags for shared directory => Foundation Classes - OSD_Directory returns incorrect protection flags for shared directory on Windows
2017-01-25 17:49 kgv Platform => Windows
2017-01-25 17:51 git Note Added: 0063038
2017-01-25 17:51 kgv Note Added: 0063039
2017-01-25 17:51 kgv Status new => resolved
2017-01-26 12:26 abv Note Added: 0063077
2017-01-26 12:26 abv Assigned To abv => bugmaster
2017-01-26 12:26 abv Status resolved => reviewed
2017-01-26 17:24 apv Assigned To bugmaster => apv
2017-01-26 17:34 git Note Added: 0063099
2017-01-26 17:35 apv Note Added: 0063100
2017-01-27 12:52 apv Test case number => Not needed
2017-01-27 13:30 apv Note Added: 0063113
2017-01-27 13:30 apv Assigned To apv => bugmaster
2017-01-27 13:30 apv Status reviewed => tested
2017-02-03 16:52 apn Changeset attached => occt master 2b3e2b78
2017-02-03 16:52 apn Assigned To bugmaster => apn
2017-02-03 16:52 apn Status tested => verified
2017-02-03 16:52 apn Resolution open => fixed
2017-02-08 11:36 git Note Added: 0063627
2017-09-29 16:21 aiv Fixed in Version => 7.2.0
2017-09-29 16:24 aiv Status verified => closed