Материал предоставлен https://it.rfei.ru

9 лет назад

Здравствуйте!

Мне не понятно откуда в команде взялся атрибут (OI), объясните пожалуйста. icacls.exe c:\accounting /grant Kim_Akers:(OI)M

9 лет назад

Добрый день, Алексей Сергеевич.

(OI)(CI) флаги наследования, говорят о том, что все вложенные директории и файлы будут наследовать эти права.

Если не использовать (OI)(CI) то права выставятся только на данный каталог и никаким объектам кроме.

Все ключи, которые возможно использовать с icacls.exe можно посмотреть в справке: icacls.exe /?.

Правда в том, что там мало что написано об использовании и определении флагов наследования.

Я поясню. Если следовать строго документации, то она определяет их так:

inheritance rights may precede either form and are applied only to directories:
 (OI) - object inherit
 (CI) - container inherit
 (IO) - inherit only
 (NP) - don’t propagate inherit

Также, следует обратить внимание сюда:

Using iCACLS

To edit a file you must already have the "Change" ACL (or be the file's owner)
To use the iCACLS command to change the permissions of a file requires "FULL Control" (or be the file's owner) File "Ownership" will always override all ACL's - you always have Full Control over files that you create.
Inherited folder permissions are displayed as:

 OI - Object inherit    - This folder and files. (no inheritance to subfolders)
 CI - Container inherit - This folder and subfolders.
 IO - Inherit only      - The ACE does not apply to the current file/directory

These can also be combined as folllows:
 (OI)(CI)	    This folder, subfolders, and files.
 (OI)(CI)(IO)	Subfolders and files only.
     (CI)(IO)  Subfolders only.
 (OI)    (IO)	Files only.

So BUILTIN\Administrators:(OI)(CI)F means that both files and Subdirectories will inherit 'F' (Fullcontrol)
similarly (CI)R means Directories will inherit 'R' (Read folders only = List permission)

When cacls is applied to the current folder only there is no inheritance and so no output.

Итак,

  • (OI)(CI) — Эта папка, подпапки и файлы.
  • (OI)(CI)(IO) — Только подпапки и файлы
  • (CI)(IO) — Только подпапки
  • (OI)(IO) — Только файлы.

Хороших вам выходных.

С уважением, Станислав Лахтин

9 лет назад

Добрый вечер, спасибо, и Вам хороших выходных! Большое спасибо за объяснение) Сохраню себе на заметку)

Ваш комментарий

Комментирование доступно только для авторизованных пользователей.