prosyslab-classroom / cs348-information-security

61 stars 10 forks source link

[Question][Hw4] Typo in capability.ml #282

Closed kaist-kihwan closed 1 year ago

kaist-kihwan commented 1 year ago

Name: Kim Kihwan

Inside of capability.ml, there's lookup function which is

let lookup sub obj acl =
  try
    let submap = ObjectMap.find obj acl in
    SubjectMap.find sub submap
  with _ -> []

This code is identical to lookup in acl.ml. I think this is kind of copy-and-paste issue. This code raise type error, so please check.

sujin0529 commented 1 year ago

Hi, sorry for confusion. Capability's lookup code should be changed as below.

let lookup sub obj acl =
  try
    let objmap = SubjectMap.find sub acl in
    ObjectMap.find obj objmap
  with _ -> [] 

Thanks