MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / getSecurity

Method getSecurity

pager_lib/smb/SMBConnection.py:280–309  ·  view source on GitHub ↗

Retrieve the security descriptor of the file at *path* on the *service_name*. :param string/unicode service_name: the name of the shared folder for the *path* :param string/unicode path: Path of the file on the remote server. If the file cannot be opened for reading, an :do

(self, service_name, path, timeout = 30)

Source from the content-addressed store, hash-verified

278 return results[0]
279
280 def getSecurity(self, service_name, path, timeout = 30):
281 """
282 Retrieve the security descriptor of the file at *path* on the *service_name*.
283
284 :param string/unicode service_name: the name of the shared folder for the *path*
285 :param string/unicode path: Path of the file on the remote server. If the file cannot be opened for reading, an :doc:`OperationFailure<smb_exceptions>` will be raised.
286 :return: A :class:`smb.security_descriptors.SecurityDescriptor` instance containing the security information of the file.
287 """
288 if not self.sock:
289 raise NotConnectedError('Not connected to server')
290
291 results = [ ]
292
293 def cb(info):
294 self.is_busy = False
295 results.append(info)
296
297 def eb(failure):
298 self.is_busy = False
299 raise failure
300
301 self.is_busy = True
302 try:
303 self._getSecurity(service_name, path, cb, eb, timeout)
304 while self.is_busy:
305 self._pollForNetBIOSPacket(timeout)
306 finally:
307 self.is_busy = False
308
309 return results[0]
310
311 def retrieveFile(self, service_name, path, file_obj, timeout = 30, show_progress = False, tqdm_kwargs = {}):
312 """

Callers

nothing calls this directly

Calls 2

_pollForNetBIOSPacketMethod · 0.95
NotConnectedErrorClass · 0.70

Tested by

no test coverage detected