Troubles with SUID sandbox on linux

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Troubles with SUID sandbox on linux

Postby Tom741 » Fri Jun 24, 2016 7:48 am

Hello everyone,
First some background: I already succeeded to play with CEF on windows.
Now that I need to port my project on linux, I faced a looooot of issues (never really tried linux until few weeks for this project ^^). I'm sorry by advance if the problem come from my limited knowledge on this plateform :?

My project is a gtk+ gui application that I build with code::blocks.
I successfully linked cef on it and I was really happy to see the method CefInitialize returning true :).

However, I saw no browser in my window.

By looking at the debug.log, I have this error:
[0624/143514:ERROR:browser_main_loop.cc(217)] Running without the SUID sandbox! See https://chromium.googlesource.com/chrom ... lopment.md for more information on developing with the sandbox on.

Tried to have a look on the page, on some other on the internet but... still not working.

Code: Select all
void Cef_Client_App::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr< CefCommandLine > command_line)
{
   command_line->AppendSwitch("no-sandbox");
   command_line->AppendSwitch("disable-setuid-sandbox");
}

No effect

Adding --no-sandbox as argument when the app is debugged: No effect

The last thing I tried was: I have cefsimple and cefclient working well, no error like this. So I looked in the makelists files and saw SET_LINUX_SUID_PERMISSIONS.
I magically found something on the internet:
Code: Select all
macro(SET_LINUX_SUID_PERMISSIONS target executable)
  add_custom_command(
    TARGET ${target}
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E echo ""
    COMMAND ${CMAKE_COMMAND} -E echo "*** Run the following command manually to set SUID permissions ***"
    COMMAND ${CMAKE_COMMAND} -E echo "EXE=\"${executable}\" && sudo -- chown root:root $EXE && sudo -- chmod 4755 $EXE"
    COMMAND ${CMAKE_COMMAND} -E echo ""
    VERBATIM
    )
endmacro()

But I don't understand exactly this command (don't know anyway if it's still used).
So I tried to use chmod (on both my app and chrome-sandbox) with 4755
But still the error message.

On the chromium help page they say to use build/update-linux-sandbox.sh, but I don't see this file.

Is there something I missed or I did wrong ?
Also, does the end user (not on my dev machine) will need to set something like this ?

Many thanks,
Tom741
Techie
 
Posts: 31
Joined: Tue Aug 19, 2014 9:16 am

Re: Troubles with SUID sandbox on linux

Postby chellio » Fri Jun 24, 2016 8:06 am

CEF looks for sandbox and for other required files in folder where executable is placed, not in project folder. This is behaviour on Linux if you create CodeBlocks project from scratch. I don't know why switches that turning off sandbox, doesn't cancel the requirement of the presence of chrome-sandbox file.
chellio
Techie
 
Posts: 27
Joined: Fri May 20, 2016 9:26 am
Location: Poland

Re: Troubles with SUID sandbox on linux

Postby Tom741 » Fri Jun 24, 2016 8:13 am

Hello,
In Code::Blocks I put this in the build targets:
Execution working dir: bin/Debug/

I also added the cef required file in this directory (.pak, locales, bins as well as chrome-sandbox).

I guess it's looking on the corect dir (/debug), cause when I remove the .pak files it says that it can't find them ^^.

What's the difference between no-sandbox and disable-setuid-sandbox ?
Is it maybe cause I put them both ?
Tom741
Techie
 
Posts: 31
Joined: Tue Aug 19, 2014 9:16 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 50 guests