Repository: WeblateOrg/weblate

Issue:
Cannot create new component "unable to fork (128)"
### Describe the issue

Hello!

- I've been using creating components in projects both manually and via rest api. It seem to have stopped working after upgrading to version 5 of weblate.
- The scenario of how to simulate issue is very simple. You just have to use repository that uses GitLab and Deploy Keys (not tokens).
- CLI error:
```bash
{"repo":["Could not fetch the repository: fatal: cannot exec '/app/data/ssh/bin-7c42cbab5cbeffea/ssh': Permission denied\nfatal: unable to fork\n (128)"]}
```
DOCO: https://docs.weblate.org/en/weblate-5.0.1/vcs.html#github-repositories

### I already tried

- [X] I've read and searched [the documentation](https://docs.weblate.org/).
- [X] I've searched for similar issues in this repository.

### Steps to reproduce the behavior

1. Create new private repo on GitLab
2. Create Deploy keys on that repo using Weblate SSH key
3. Create new project in Weblate.
4. Create new component. -> error

### Expected behavior

Create component/move to second page in UI. This should not fork, becuse branch is specified, it should do a PR/MR into specified branch. Fork will not work for GitLab Depoy Keys (they only can write, not fork etc). DOCO: https://docs.weblate.org/en/weblate-5.0.1/vcs.html#github-repositories

### Screenshots


<img width="1097" alt="image" src="https://github.com/WeblateOrg/weblate/assets/6751435/d6dea712-3716-41a4-8e62-e24cdf347461">


### Exception traceback

```bash
{"repo":["Could not fetch the repository: fatal: cannot exec '/app/data/ssh/bin-7c42cbab5cbeffea/ssh': Permission denied\nfatal: unable to fork\n (128)"]}
```

### How do you run Weblate?

Other

### Weblate versions

Helm Chart 5.0.1 Weblate bersion 5.0.2.1

### Weblate deploy checks

```shell
WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.
?: (security.W018) You should not have DEBUG set to True in deployment.

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
	HINT: https://docs.weblate.org/en/weblate-5.0.2/admin/install.html#collecting-errors
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
	HINT: https://docs.weblate.org/en/weblate-5.0.2/admin/backup.html
```


### Additional context

Running private repository usgin Weblate SSH key. Weblate on Kubernetes.


Discussion:
Maybe your data dir is mounted with noexec?
This issue has been marked as a question by a Weblate team member. Why? Because it belongs more to the professional [Weblate Care](https://care.weblate.org/) or community [Discussions](https://github.com/WeblateOrg/weblate/discussions) than here. We strive to answer these reasonably fast here, too, but [purchasing the support subscription](https://weblate.org/support/) is more responsible and faster for your business. And it makes Weblate stronger as well. Thanks!

In case your question is already answered, [making a donation](https://weblate.org/donate/) is the right way to say thank you!
I have reinstalled weblate and it worked. I think You were right. I assume this issue can be closed, since it occurred for me, because I was restoring ssh folder from backup and forgot +x.

Resolving patch:
diff --git a/weblate/vcs/ssh.py b/weblate/vcs/ssh.py
--- a/weblate/vcs/ssh.py
+++ b/weblate/vcs/ssh.py
@@ -341,13 +341,12 @@ def create(self):
         for command in ("ssh", "scp"):
             filename = os.path.join(self.path, command)
 
-            if os.path.exists(filename):
-                continue
-
-            with open(filename, "w") as handle:
-                handle.write(self.get_content(find_command(command)))
+            if not os.path.exists(filename):
+                with open(filename, "w") as handle:
+                    handle.write(self.get_content(find_command(command)))
 
-            os.chmod(filename, 0o755)  # noqa: S103, nosec
+            if not os.access(filename, os.X_OK):
+                os.chmod(filename, 0o755)  # noqa: S103, nosec
 
 
 SSH_WRAPPER = SSHWrapper()


Test patch: