Deleting extended attribute set point in file

Сегодня, при запуске (после летающих огоньков), Windows неожиданно запустил CHKDSK. Оставил компьютер на пару минут, за это время CHKDSK выдал такое:

CHKDSK is verifying files (stage 1 of 3).
Deleting corrupt attribute record (128, "")
from file record segment 30218.
Deleting corrupt attribute record (128, "")
from file record segment 56152.
Deleted corrupt attribute list entry
with type code 128 in file 392968.
Deleting corrupt attribute record (128, "")
from file record segment 14655.
Deleting corrupt attribute record (128, "")
from file record segment 15386.

437248 file records processed. File verification completed.
Deleting orphan file record segment 14655.
Deleting orphan file record segment 15386.

183 large file records processed.
0 bad file records processed.
2 EA records processed.
265 reparse records processed.

Дальше пошел второй этап, там он удалил некоторые файлы *.tmp.
Интересный факт: компьютер работал уже включен довольно долго, решил перезагрузить после того, как перестали открываться некоторые файлы с исходниками. Notepad++ говорит что файл открыт в другой программе, блокнот — доступ запрещен.
Вопрос: хард скоро умрет? Бежать все бекапить? Вообще это ноутбук, и он еще на гарантии, есть ли смысл идти в гарантийный сервис? Они же не найдут ничего, скажут что сейчас все работает.

В данной теме я рассмотрю четыре вида метаданных, которые могут быть прикреплены к файлу или каталогу средствами файловой системы NTFS. Я опишу, в каких целях можно использовать тот или иной тип метаданных, приведу пример его применения в какой-либо технологии Microsoft или стороннем программном обеспечении.

Речь пойдёт о точках повторной обработки (reparse points), идентификаторах объектов (object id) и о других типах данных, которые может содержать файл помимо своего основного содержимого.

Object Id

Идентификатор объекта это 64 байта, которые можно прикрепить к файлу или каталогу. Из них первые 16 байт позволяют однозначно идентифицировать файл в пределах тома и обращаться к нему не по имени, а по идентификатору. Остальные 48 байт могут содержать произвольные данные.

Идентификаторы объектов существуют в NTFS со времён Windows 2000. В самой системе они используются для отслеживания расположения файла, на который ссылается ярлык (.lnk). Допустим, файл, на который ссылается ярлык, был перемещён в пределах тома. При запуске ярлыка он всё равно откроется. Специальная служба Windows в случае, если файл не найден, произведёт попытку открыть файл не по его имени, а по заранее созданному и сохранённому идентификатору. Если файл не был удалён и не покидал пределы тома, он откроется, а ярлык снова будет указывать на файл.

Идентификаторы объектов использовались в технологии iSwift Антивируса Касперского 7-ой версии. Вот как описана эта технология: Технология разработана для файловой системы NTFS. В этой системе каждому объекту присваевается NTFS-индентификатор. Этот индентификатор сравнивается с значениями специальной базы данных iSwift. Если значения базы данных с NTFS-индентификатором не совпадают, то объект проверяется или перепроверяется, если он был изменен.

Впрочем, переизбыток созданных идентификаторов вызывал проблемы со сканированием диска стандартной утилитой проверки chkdsk, она происходила слишком долго. В следующих версиях Антивируса Касперского отказались от использования NTFS Object Id.

Reparse Point

В файловой системе NTFS файл или каталог может содержать в себе reparse point, что переводится на русский язык как «точка повторной обработки». В файл или каталог добавляются специальные данные, файл перестаёт быть обычным файлом и обработать его может только специальный драйвер фильтра файловой системы.

В Windows присутствуют типы reparse point, которые могут быть обработаны самой системой. Например, через точки повторной обработки в Windows реализуются символьные ссылки (symlink) и соединения (junction point), а также точки монтирования томов в каталог (mount points).
Reparse-буфер, присоединяемый к файлу это буфер, имеющий максимальный размер 16 килобайт. Он характеризуется наличием тега, который говорит системе о том, к какому типу принадлежит точка повторной обработки. При использовании reparse-буфера собственного типа ещё необходимо задавать в нём GUID в специальном поле, а в reparse-буферах Microsoft он может отсутствовать.

Какие типы точек повторной обработки существуют? Перечислю технологии, в которых используются reparse point’ы. Это Single Instance Storage (SIS) и Cluster Shared Volumes в Windows Storage Server 2008 R2, Hierarchical Storage Management, Distributed File System (DFS), Windows Home Server Drive Extender. Это технологии Microsoft, здесь не упомянуты технологии сторонних компаний, использующие точки повторной обработки, хотя такие тоже есть.

Читайте также:  Попала вода в микрофон телефона что делать

Extended Attributes

Расширенные атрибуты файла. Про них был мой предыдущий топик. Здесь стоит упомянуть только то, что под Windows эта технология практически не применяется. Из известного мне программного обеспечения только Cygwin использует расширенные атрибуты для хранения POSIX прав доступа. У одного файла на NTFS могут быть или расширенные атрибуты, или буфер точки повторной обработки. Одновременная установка и того и другого невозможна. Максимальный размер всех расширенных атрибутов у одного файла составляет 64 Кб.

Alternate Data Streams

Дополнительные файловые потоки. Про них знает уже, наверное, каждый. Перечислю основные признаки этого вида метаданных: именованность (то есть у файла может быть несколько потоков, и у каждого своё имя), прямой доступ из файловой системы (их можно открывать, используя формат «имя файла, двоеточие, имя потока»), неограниченный размер, возможность запуска процесса прямо из потока (и возможность реализовать через это бесфайловый процесс).

Использовались в технологии iStream Антивируса Касперского. Используются в самой Windows, например при скачивании файла из интернета к нему прицепляется поток Zone.Identifier, содержащий информацию о том, из какого места получен данный файл. После запуска исполняемого файла пользователь может увидеть сообщение «Не удаётся проверить издателя. Вы действительно хотите запустить эту программу?».

Так пользователю даётся дополнительная защита от необдуманного запуска программ, полученных из интернета. Это лишь одно применение потоков, а так в них можно хранить самые разные данные. Упомянутый Антивирус Касперского хранил там контрольные суммы каждого файла, но позже от этой технологии тоже по какой-то причине отказались.

Что-нибудь ещё?

Есть ещё идентификатор безопасности, плюс стандартные атрибуты файла, к которым нет прямого доступа, несмотря на то, что они тоже реализованы как потоки файлов. И они, и расширенные атрибуты, и reparse и object id — всё это потоки файла с точки зрения системы. Напрямую изменять идентификатор безопасности, показанный на следующей картинке как ::$SECURITY_DESCRIPTOR смысла нет, пусть его изменением занимается система. К другим типам потоков сама система не даёт прямого доступа. Так что на этом всё.

Просмотр содержимого object id, точек повторной обработки, а также работа с расширенными атрибутами и альтернативными файловыми потоками возможна с помощью программы NTFS Stream Explorer, а также через системную консольную утилиту fsutil.

This chapter describes the Oracle WebCenter Content services available when using and customizing the Extended User Attributes component.

This chapter covers the following topics:

11.1 About Extended User Attributes Services

Information about what is a WebCenter Content service and how services can be used is provided in Section 2, "Using Services." Information about basic services structure, attributes, actions, and a service example is provided in Section 3, "Customizing Services." You should be familiar with this information before customizing current services or creating new services

The locations for specific Extended User Attributes services are listed within each individual service.

The most commonly used services have more extensive descriptions.

11.2 Extended User Attributes Services

The following Extended User Attributes component services are installed when the Content Server instance is installed:

The following services are extended to provide support for the Extended User Attributes component:

11.2.1 ADD_EXTENDED_USER_ATTRIBUTES

Service that adds extended attributes to a user. The user does not have to exist before using the service. If this service is asked to add extended attributes which already exist for the user, the service modifies the previous entries.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

dName: The user name.

ExtUserAttribInfo Resultset: A result set containing extended user attribution information.

Optional Service Parameters

CheckUserMustExist: If set to true, a limited check is performed to verify that the user exists before extended attributes are added. This check only works for local users; it is not recommended to set this value for typical service calls.

The following example from add_user_attr.txt illustrates the use of this service:

11.2.2 EDIT_EXTENDED_USER_ATTRIBUTES

Service that edits extended user attributes for a user. The user does not have to exist before using the service. All previously extended attributes are replaced by the new extended attributes provided.

Additional Required Service Parameters

dName: The user name.

ExtUserAttribInfo ResultSet: A result set containing extended user attribution information.

Optional Service Parameters

CheckUserMustExist: If set to true , a limited check is performed to verify that the user exists before extended attributes are added. This check only works for local users; it is not recommended to set this value for typical service calls.

Читайте также:  Почему на мотиве медленный мобильный интернет?

The following example from edit_user_attr.txt illustrates the use of this service:

11.2.3 DELETE_EXTENDED_USER_ATTRIBUTES

Service that deletes specific extended user attributes for a user.

Additional Required Service Parameters

dName: The user name.

ExtUserAttribInfo ResultSet: A result set containing extended user attribution information.

allowMissingAttributes: If set to true , the service suppresses errors when trying to delete attributes that do not exist (the default is false ).

Optional Service Parameters

CheckUserMustExist: If set to true , a limited check is performed to verify that the user exists before extended attributes are added. This check only works for local users; it is not recommended to set this value for typical service calls.

11.2.4 DELETE_EXTENDED_ATTRIBUTES_BY_APPLICATION

Service that deletes all extended attributes for a particular role/account for a specified application.

Additional Required Service Parameters

dAttributeType: The type of attribute to delete.

dAttributeName: The name of the attribute to delete.

dApplication: The application from which to delete the attribute.

The following example from delete_attr_by_app.txt illustrates the use of this service:

11.2.5 DELETE_ALL_EXTENDED_ATTRIBUTES_FOR_USER

Service that deletes all extended attributes for a user.

Additional Required Service Parameters

dName: The user name.

Optional Service Parameters

CheckUserMustExist: If set to true , a limited check is performed to verify that the user exists before extended attributes are added. This check only works for local users; it is not recommended to set this value for typical service calls.

The following example from delete_user_attr_all.txt illustrates the use of this service:

11.2.6 DELETE_ALL_EXTENDED_ATTRIBUTES_FOR_APPLICATION

Service that deletes all extended users attributes for an application.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

dApplication: The application.

The following example from del_all_attr_app.txt illustrates the use of this service:

11.2.7 QUERY_EXTENDED_USER_ATTRIBUTES

Service that places all of a user’s extended attributes into a result set in the binder. All of the data is put into the ExtUserAttribInfo ResultSet.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

dName: The user name.

Optional Service Parameters

dApplication: The application name for the attribute.

dAttributeType: The type of attribute.

dAttributeName: The name of the attribute.

Adding one or more of the optional parameters enables greater flexibility in narrowing the query. The following example from query_user_attr_ext.txt illustrates the use of this service:

11.2.8 QUERY_EXTENDED_ATTRIBUTE_MAPPINGS

Service that places all mapped extended attributes from a particular attribute into a result set in the binder. All of the data is put into the ExtUserAttribInfo ResultSet.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

dMappedAttributeName: The name of the attribute to be mapped.

Optional Service Parameters

dApplication: The application name for the attribute.

dAttributeType: The type of attribute.

dAttributeName: The name of the attribute.

Adding one or more of the optional parameters enables greater flexibility in narrowing the query. The following example from query_attr_map_ext.txt illustrates the use of this service:

11.2.9 EC_SET_PROPERTY

Service that sets an extended configuration property. It can be used to either add a new property or modify an existing property.

Location: IdcHomeDir / components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

dECPropType: The type of property.

dECPropKey: A key (generally relating to dECPropType).

dECPropValue: The property value.

Optional Service Parameters

dECPropSubKey: (Recommended) A second key; for example, the key can be a feature of what is defined by dECPropType and dEDPropKey.

The following example from set_property.txt illustrates the use of this service:

11.2.10 EC_DELETE_PROPERTY

Service that deletes an extended configuration property. It is important that the exact key be specified for deletion. This service does not automatically delete all subkeys under a key.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

dECPropType: The type of property.

dECPropKey: A key (generally relating to dECPropType).

Optional Service Parameters

dECPropSubKey: (Recommended) A second key; for example, the key can be a feature of what is defined by dECPropType and dEDPropKey.

The following example from del_property.txt illustrates the use of this service:

11.2.11 EC_GET_PROPERTY

Service that returns a specified extended configuration property in the ResultSet PROPERTY_LIST. It is important that the exact key be specified; if you want to search based on just the key (not subkey) use EC_GET_PROPERTY_BY_KEY.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

dECPropType: The type of property.

dECPropKey: A key (generally relating to dECPropType).

Optional Service Parameters

dECPropSubKey: (Recommended) A second key; for example, the key can be a feature of what is defined by dECPropType and dEDPropKey.

The following example from get_property.txt illustrates the use of this service:

Читайте также:  Nty страна производитель отзывы

11.2.12 EC_GET_PROPERTY_BY_KEY

Service that returns a specified extended configuration property in the ResultSet PROPERTY_LIST.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

dECPropType: The type of property.

dECPropKey: A key (generally relating to dECPropType).

The following example from get_property_by_key.txt illustrates the use of this service:

11.2.13 SET_DEFAULT_ATTRIBUTES

Service that sets some default attributes that will always be applied to a user. The type is defaults and the key is userattributes , so these do not need to be provided.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

dDefAttribs: The default attributes in the form of a comma-separated entry consisting of three items.

Optional Service Parameters

dECPropSubKey: A second key; the default attributes will load for all users whether or not this key is specified.

IsSecureDefaultAttribute: When set to 1 and used with the databinder when using the default web services ( ) then it registers defaults that only apply to logged in users. (By default, default attributes apply to all users, including anonymous .)

The following example from set_defs.txt illustrates the use of this service:

11.2.14 DELETE_DEFAULT_ATTRIBUTES

Service that deletes some default attributes that will always be applied to a user.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Optional Service Parameters

dECPropSubKey: A second key. If this parameter is not specified, the service will only remove the default attributes specified without a subkey; it will not remove other attributes.

IsSecureDefaultAttribute: If set to 1 and used with the databinder when using the default web services ( ) then it deletes defaults that only apply to logged in users. (By default, default attributes apply to all users, including anonymous .)

The following example from del_defs.txt illustrates the use of this service:

11.2.15 GET_DEFAULT_ATTRIBUTES

This service returns the default attributes that are applied to all users in the ResultSet DEFAULT_ATTRIBUTES.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Optional Service Parameters

dECPropSubKey: If specified, it narrows the search for the default attributes to only the one matching that subkey.

IsSecureDefaultAttribute: If set to 1 and used with the databinder when using the default web services ( ) then it retrieves defaults that only apply to logged in users. (By default, default attributes apply to all users, including anonymous .)

The following example from get_defs.txt illustrates the use of this service:

11.2.16 SET_EXTENDED_ATTRIBUTE_MAPPINGS

Service that sets mappings from one user attribute to another user attribute. Only mappings from roles to other attributes is supported (mapping does not work when the source is an account).

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

ExtUserAttribInfo: A result set containing extended user attribute information.

The following example from set_attr_mapping.txt illustrates the use of this service:

11.2.17 DELETED_EXTENDED_ATTRIBUTE_MAPPINGS

Service that deletes mappings from one user attribute to another user attribute.

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Additional Required Service Parameters

ExtUserAttribInfo: A result set containing extended user attribute information.

Optional Service Parameters

allowMissingAttributes: If set to true , the service suppresses errors when trying to delete attributes that do not exist. The default is false .

The following example from del_attr_mapping.txt illustrates the use of this service:

11.2.18 ADD_USER

The service has been altered to add extended user attributes at the same time the user is added. For additional information see Section 4.14.4, "ADD_USER."

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Optional Service Parameter

ExtUserAttribInfo ResultSet: A result set containing extended user attribution information. If it is not included, no extended attributes are added.

The following example from add_user.txt illustrates the use of this service:

11.2.19 EDIT_USER

This service has been altered to allow editing of extended user attributes at the same time. The old values are completely replaced by the new ones. For additional information, see Section 4.14.4, "ADD_USER."

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

Optional Service Parameters

ExtUserAttribInfo ResultSet: A result set containing extended user attribution information. If it is not included, the extended attributes are not replaced.

The following example from edit_user.txt illustrates the use of this service:

11.2.20 DELETE_USER

This service has been altered to delete a user’s extended attributes if they exist. For additional information, see Section 4.14.10, "DELETE_USER."

Location: IdcHomeDir /components/ExtendedUserAttributes/resources/extendeduserattributes_services.htm

The following example from delete_user.txt illustrates the use of this service:

11.2.21 QUERY_USER_ATTRIBUTES

This service acts as usual however the attributes it returns are contingent on the value of the getAllAttributes parameter. If the parameter is passed as true , this service returns a merger of both regular and extended user attributes. For additional information, see Section 4.14.24, "QUERY_USER_ATTRIBUTES."

Оцените статью
Добавить комментарий

Adblock
detector