~brian.curtin/ubuntuone-client/820350-fix-readonly-readwrite

Viewing all changes in revision 1187.

  • Committer: Brian Curtin
  • Date: 2012-02-07 22:45:30 UTC
  • Revision ID: brian.curtin@canonical.com-20120207224530-nusf4vvklx690p3o
Adjust set_dir_readonly and set_dir_readwrite to properly function.

*readonly needs to not only set GENERIC_READ access for users but also
needs to keep the proper previous access intact for the administrator
and system groups.

The same is true of *readwrite except in that it needs to be careful
to not give back too much access. The USER_SID remains at GENERIC_READ
but needs to re-acquire DELETE access (leave that off and try deleting
the folder, it won't work). AUTH_USERS at this point will re-gain the 
GENERIC_WRITE access. At this point, the folder should be back to normal -
deletable and writeable.

Most testing of this was done by comparing the results of "cacls <path>"
before and after going through a creation/readonly/readwrite cycle.
The results are not exact, but I've found no way to actually get before
and after to match. Someone speculated that cacls is using shorthand in
it's simple one-letter display. By definition, though, I think we have a
pretty solid match of the access being granted.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: