[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bash as a static lib in my application
From: |
Praneeth Tss |
Subject: |
Bash as a static lib in my application |
Date: |
Thu, 18 Jun 2020 16:22:05 +0530 |
Hi,
Need some advice on my approach. So, my motive was to develop an
application which has a console on a web page and execute shell commands
from the browser. I have sorted out all the communication between the
browser and the user machine.
These are the approaches I have taken once my c++ application receives the
command from browser
i) Use forkpty and fork a child process of bash of an existing terminal
instance and pipe in commands and take out the stdout.
ii.) Build a static library out of bash and use it in my application.
Execute the command and get the output from the bash lib's code.
I don't want to go with the first approach due to security reasons. So, I
need some advice if the second approach is feasible or if there are any
issues that I can get into with the second approach. Any help would be
appreciated.
Regards,
Praneeth TSS
- Bash as a static lib in my application,
Praneeth Tss <=