QProcess execute linux commands on WebAssembly
-
Hi,
Does anyone know if it is possible to call the QProcess function with a Linux command (e.g. "ls -al /root") in a Qt WebAssembly application?
I tried to run a simple application with a QProcess call, it compiles normally for WebAssembly but the web app it seems to cause Firefox slow performance issues and it's probably hunged.
Thanks!
-
I don't know if QProcess is supported on WASM at all.
But an even bigger problem is looming here: WebAssembly runs in web browser sandbox. It does not have access to the filesystem (that would be a massive security risk!), nor does it allow you to run system commands.
I'm not sure what you are trying to do, but it's either a totally wrong approach or something completely impossible.
-
I don't know if QProcess is supported on WASM at all.
But an even bigger problem is looming here: WebAssembly runs in web browser sandbox. It does not have access to the filesystem (that would be a massive security risk!), nor does it allow you to run system commands.
I'm not sure what you are trying to do, but it's either a totally wrong approach or something completely impossible.
Hi @sierdzio ,
I am currently working on the development of a Qt desktop application but we were discussing the ability to extend, using Qt WebAssembly, the application usage in a web browser too.
So, I am currently investigating based on our development so far whether it's feasible or not since I had no prior experience with Qt WebAssembly. Until now, the main roadblocks seem to be Linux system commands execution and local persistent storage (SQLite). That's why I was wondering if I am doing something wrong with my approach to call QProcess from web app or even if it's completely impossible.
Do you have in mind a better approach in such cases where native access to the filesystem or/and run system commands is impossible ?
Thanks.
-
Hi @sierdzio ,
I am currently working on the development of a Qt desktop application but we were discussing the ability to extend, using Qt WebAssembly, the application usage in a web browser too.
So, I am currently investigating based on our development so far whether it's feasible or not since I had no prior experience with Qt WebAssembly. Until now, the main roadblocks seem to be Linux system commands execution and local persistent storage (SQLite). That's why I was wondering if I am doing something wrong with my approach to call QProcess from web app or even if it's completely impossible.
Do you have in mind a better approach in such cases where native access to the filesystem or/and run system commands is impossible ?
Thanks.
@nsourl said in QProcess execute linux commands on WebAssembly:
Do you have in mind a better approach in such cases where native access to the filesystem or/and run system commands is impossible ?
This is not a Qt WebAssembly limitation, it is a WebAssembly at limitation/security issue.
As @sierdzio already told before, WebAssembly is sanboxed ==> https://webassembly.github.io/spec/core/intro/introduction.html#security-considerationsYou cannot have access to local processes / file system.
-
@nsourl said in QProcess execute linux commands on WebAssembly:
Do you have in mind a better approach in such cases where native access to the filesystem or/and run system commands is impossible ?
This is not a Qt WebAssembly limitation, it is a WebAssembly at limitation/security issue.
As @sierdzio already told before, WebAssembly is sanboxed ==> https://webassembly.github.io/spec/core/intro/introduction.html#security-considerationsYou cannot have access to local processes / file system.
Hi @KroMignon ,
Thank you for your reply, now it's clear to me that it depends on WebAssembly limitation.
Let's assume that the Qt WebAssembly app will be running on a Linux device, do you think it could be a suitable approach to create another Qt app(service) that will communicate via websockets or REST API with Qt WebAssembly app and be able to run Linux commands and access local file system?
Thanks.
-
You can use websockify or similar proxy server to communicate with webassembly (which is client only).