Skip to content

"Error 13 Permission denied" when executing a plugin created by another user #4

@davafons

Description

@davafons

Context: Two or more users must be using the same computer as the bridge.

Expected Behavior

Both users should be able to use the same computer as the bridge, executing the same plugins.

Actual Behavior

If one user executes a plugin, and the other one tries to execute the same plugin after it, the following error will pop on the bot log:

2019-06-20 16:36:14,782 - telegram.ext.dispatcher - ERROR - An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/home/david/cmsysbot-telegram/venv/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 279, in process_update
    handler.handle_update(update, self)
  File "/home/david/cmsysbot-telegram/venv/lib/python3.6/site-packages/telegram/ext/conversationhandler.py", line 305, in handle_update
    new_state = self.current_handler.handle_update(update, dispatcher)
  File "/home/david/cmsysbot-telegram/venv/lib/python3.6/site-packages/telegram/ext/callbackqueryhandler.py", line 143, in handle_update
    return self.callback(dispatcher.bot, update, **optional_args)
  File "/home/david/cmsysbot-telegram/cmsysbot/controller/conversation.py", line 40, in start_plugin_from_callback
    return collect_arguments(bot, update, user_data)
  File "/home/david/cmsysbot-telegram/cmsysbot/controller/conversation.py", line 86, in collect_arguments
    return execute_plugin(bot, update, user_data=user_data)
  File "/home/david/cmsysbot-telegram/cmsysbot/controller/conversation.py", line 94, in execute_plugin
    for name, ip, stdout, stderr in plugin.run(session):
  File "/home/david/cmsysbot-telegram/cmsysbot/system/plugin.py", line 76, in run
    session.copy_to_bridge(self.server_path, self.bridge_path, 0o777)
  File "/home/david/cmsysbot-telegram/cmsysbot/utils/session.py", line 121, in copy_to_bridge
    sftp.chmod(bridge_path, permissions)
  File "/home/david/cmsysbot-telegram/venv/lib/python3.6/site-packages/paramiko/sftp_client.py", line 541, in chmod
    self._request(CMD_SETSTAT, path, attr)
  File "/home/david/cmsysbot-telegram/venv/lib/python3.6/site-packages/paramiko/sftp_client.py", line 813, in _request
    return self._read_response(num)
  File "/home/david/cmsysbot-telegram/venv/lib/python3.6/site-packages/paramiko/sftp_client.py", line 865, in _read_response
    self._convert_status(msg)
  File "/home/david/cmsysbot-telegram/venv/lib/python3.6/site-packages/paramiko/sftp_client.py", line 896, in _convert_status
    raise IOError(errno.EACCES, text)
PermissionError: [Errno 13] Permission denied

Steps to Reproduce the Problem

  1. Connect to a bridge computer with any user, and use any plugin on it.
  2. The plugin will be copied from the server to the bridge, and then executed successfully.
  3. Connect to the same bridge computer with a different user, and use the same plugin again.

NOTE: Don't turn off the bridge computer, nor delete the plugin file, during the process.

  1. The exception should now pop on the console log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions