# Popen in sandboxed app

**URL:** <https://forum.legato.io/t/popen-in-sandboxed-app/3925>\
**Category:** Legato Application Framework\
**Created:** [December 5, 2018, 12:18pm UTC](https://forum.legato.io/t/popen-in-sandboxed-app/3925 "2018-12-05T12:18:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben.o](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@ben.o](https://forum.legato.io/u/ben.o)\
**Post date:** [December 5, 2018, 12:18pm UTC](https://forum.legato.io/t/popen-in-sandboxed-app/3925/1 "2018-12-05T12:18:51Z")

</div>

Hi,

I’m willing to make a system call from my legato application using **popen()**.

What I don’t understand is that as soon as I put **sandboxed** to **true** , my popen() call doesn’t return anything. If I put it to false, I will either have the correct return of my command or a **sh: /bin/notACommand: No such file or directory** if I put a command which doesn’t exist.

I understand that in order to use echo for instance in a sandbox I’d need to declare the files in my adef file like the following (note that it didn’t work in sandbox either though):

```
requires:
{
	file:
	{
		/bin/echo /usr/local/bin/
	}
}

```

But I would expect at least to have an error if the command cannot be found. Did I miss something here?

Thanks for your help,  
Ben

---

<div class="post-metadata">

**Author:** ![lotam](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lotam](https://forum.legato.io/u/lotam)\
**Post date:** [December 12, 2018, 8:27am UTC](https://forum.legato.io/t/popen-in-sandboxed-app/3925/2 "2018-12-12T08:27:51Z")

</div>

Hi Ben,  
Please try add below in the requires: file: section to run as sandbox:

> /bin/sh /bin/sh

Thx

---

<div class="post-metadata">

**Author:** ![ben.o](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@ben.o](https://forum.legato.io/u/ben.o)\
**Post date:** [December 12, 2018, 10:02am UTC](https://forum.legato.io/t/popen-in-sandboxed-app/3925/3 "2018-12-12T10:02:27Z")

</div>

Hi lotam, thanks for your answer.

I had to move out from this solution anyway but it really looks like the problem comes from not having sh indeed, I’ll give it a go when I have a chance.

Thanks again,  
Best regards,  
Ben
