Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Система";
Текущий архив: 2002.08.19;
Скачать: [xml.tar.bz2];

Вниз

Кто использует файл на серваке?   Найти похожие ветки 

 
Oleg_er   (2002-06-03 15:33) [0]

Приветствую!
подскажите, как узнать с локального места кто использует файл на сетевом диске?
сервак - winnt server 4


 
ZZ   (2002-06-03 16:17) [1]

Может тебе поможет NetFileGetInfo ??


 
Севостьянов Игорь   (2002-06-03 16:21) [2]

Есьт такое понятие как аудит - установи его на файл и смотри кто и что делает...

У меня есть компоненты для NT - среди них есть TNTAddFileSecurity

Так же смотри: LookupAccountName, GetFileSecurity, InitializeSecurityDescriptor, GetSecurityDescriptorDacl, GetAclInformation, InitializeAcl, AddAccessAllowedAce, AddAce, GetAce, SetSecurityDescriptorDacl, SetFileSecurity

Вопросы по мылу...


 
Севостьянов Игорь   (2002-06-03 16:24) [3]

А в принципе может и NetFileGetInfo + FILE_INFO_3 подойдет

The NetFileGetInfo function retrieves information about a particular opening of a server resource.

Security Requirements
Only members of the Administrators or Account Operators local group can successfully execute the NetFileGetInfo function.

NET_API_STATUS NetFileGetInfo(
LPWSTR servername,
DWORD fileid,
DWORD level,
LPBYTE *bufptr
);
Parameters
servername
[in] Pointer to a Unicode string specifying the name of the remote server on which the function is to execute. The string must begin with \\. If this parameter is NULL, the local computer is used.
fileid
[in] Specifies the file identifier of the open resource for which to return information. The value of this parameter must have been returned in a previous enumeration call. For more information, see the following Remarks section.
level
[in] Specifies the information level of the data. This parameter can be one of the following values. Value Meaning
2 Return the file identification number. The bufptr parameter is a pointer to a FILE_INFO_2 structure.
3 Return the file identification number and other information about the file. The bufptr parameter is a pointer to a FILE_INFO_3 structure.


bufptr
[out] Pointer to the address of the buffer that receives the information. The format of this data depends on the value of the level parameter. This buffer is allocated by the system and must be freed using the NetApiBufferFree function.
Return Values
If the function succeeds, the return value is NERR_Success.

If the function fails, the return value can be one of the following error codes.

Value Meaning
ERROR_ACCESS_DENIED The user does not have access to the requested information.
ERROR_FILE_NOT_FOUND The file was not found.
ERROR_INVALID_LEVEL The value specified for the level parameter is invalid.
ERROR_NOT_ENOUGH_MEMORY Insufficient memory is available.
NERR_BufTooSmall The supplied buffer is too small.


Remarks
You can call the NetFileEnum function to retrieve information about multiple files open on a server.

If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to achieve the same functionality you can achieve by calling NetFileGetInfo. For more information, see IADsResource and IADsFileServiceOperations.

--------------------------------------
FILE_INFO_3
The FILE_INFO_3 structure contains the identification number and other pertinent information about files, devices, and pipes.

typedef struct _FILE_INFO_3 {
DWORD fi3_id;
DWORD fi3_permissions;
DWORD fi3_num_locks;
LPWSTR fi3_pathname;
LPWSTR fi3_username;
} FILE_INFO_3, *PFILE_INFO_3, *LPFILE_INFO_3;
Members
fi3_id
Specifies a DWORD value that contains the identification number assigned to the resource when it is opened.
fi3_permissions
Specifies a DWORD value that contains the access permissions associated with the opening application. This member can be one or more of the following values. Value Meaning
PERM_FILE_READ Permission to read a resource and, by default, execute the resource.
PERM_FILE_WRITE Permission to write to a resource.
PERM_FILE_CREATE Permission to create a resource; data can be written when creating the resource.


fi3_num_locks
Specifies a DWORD value that contains the number of file locks on the file, device, or pipe.
fi3_pathname
Pointer to a Unicode string that specifies the path of the opened resource.
fi3_username
Pointer to a Unicode string that specifies which user (on servers that have user-level security) or which computer (on servers that have share-level security) opened the resource.


 
Oleg_er   (2002-06-04 07:20) [4]

а как убить открытие?


 
Севостьянов Игорь   (2002-06-04 12:56) [5]

Если запретить, то тем же Аудитом
А убить можно закрыв NetFileClose

Вопросы по мылу...

P.S. Ради интереса щас сам попробую наваять для себя


 
ZZ   (2002-06-04 16:13) [6]

Севостьянов Игорь
Если запретить, то тем же Аудитом
Чего-то я не понимаю при чем тут аудит то???


 
Севостьянов Игорь   (2002-06-04 19:53) [7]

ZZ © (04.06.02 16:13)
Да это ты прав - не аудитом, а правами на шару



Страницы: 1 вся ветка

Форум: "Система";
Текущий архив: 2002.08.19;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.47 MB
Время: 0.006 c
1-60737
Smok_er
2002-08-07 11:18
2002.08.19
XP and TToolBar


1-60646
Link
2002-08-08 21:54
2002.08.19
Shell Link


3-60523
alexvan
2002-07-30 13:00
2002.08.19
Ошибка при редактировании таблицы.


3-60507
Evgenij
2002-07-29 12:03
2002.08.19
в чём ошибка?


1-60670
anod
2002-08-06 01:09
2002.08.19
Как удалить





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский