141k views
0 votes
Problem (Commands): Let c be a copy flag and let a computer system have the set of rights {read, write, execute, append, list, modify, own}. 1. Using the syntax of commands discussed in class, write a command copy_all_rights (p, q, o) that copies all rights that p has over o to q. 2. Modify your command so that only those rights with an associated copy flag are copied. The new copy should not have the flag copy. 3. In the previous part, what conceptually would be the effect of copying the copy flag along with the right?

1 Answer

6 votes

Answer:

Aee explaination

Step-by-step explanation:

1.

command copy_all_rights(p,q,s)

if read in a[p,s]

then

enter read into a[q,s];

if write in a[p,s]

then

enter write into a[q,s];

if execute in a[p,s]

then

enter execute into a[q,s];

if append in a[p,s]

then

enter append into a[q,s];

if list in a[p,s]

then

enter list into a[q,s];

if modify in a[p,s]

then

enter modify into a[q,s];

if own in a[p,s]

then

enter own into a[q,s];

end

2.

command copy_all_rights(p,q,s)

if own in a[p,s] and copy in a[p,s]

then

enter own into a[q,s];

if modify in a[p,s] and copy in a[p,s]

then

enter modify into a[q,s];

if list in a[p,s] and copy in a[p,s]

then

enter list into a[q,s];

if append in a[p,s] and copy in a[p,s]

then

enter append into a[q,s];

if execute in a[p,s] and copy in a[p,s]

then

enter execute into a[q,s];

if write in a[p,s] and copy in a[p,s]

then

enter write into a[q,s];

if read in a[p,s] and copy in a[p,s]

then

enter read into a[q,s];

delete copy in a[q,s];

end

3.

"q" would be the effect of copying the copy flag along with the right, because q would have copy right to transfter to another, which may not be intended.

User TomJ
by
5.7k points