Mir

Merge lp:~alan-griffiths/mir/make-endpoint-accessible-option into lp:mir

Proposed by Alan Griffiths
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 2290
Merged at revision: 2300
Proposed branch: lp:~alan-griffiths/mir/make-endpoint-accessible-option
Merge into: lp:mir
Diff against target: 70 lines (+17/-1)
4 files modified
src/include/platform/mir/options/configuration.h (+1/-0)
src/platform/options/default_configuration.cpp (+2/-0)
src/platform/symbols.map (+8/-0)
src/server/frontend/default_configuration.cpp (+6/-1)
To merge this branch: bzr merge lp:~alan-griffiths/mir/make-endpoint-accessible-option
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Abstain
Alberto Aguirre (community) Approve
Kevin DuBois (community) Approve
Andreas Pokorny (community) Approve
Review via email: mp+248379@code.launchpad.net

Commit message

options: add a config option to "chmod a=rw <endpoint>" if exposed on filesystem

Description of the change

options: add a config option to "chmod a=rw <endpoint>" if exposed on filesystem

To post a comment you must log in.
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

looks good

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

okay overall, althoug I guess I like "globally-rw-file" over "arw-file". We might also want to control based on unix groups, and not need such broad permission

nits:
spacing:
61 + chmod(the_socket_file().c_str(), S_IRUSR|S_IWUSR| S_IRGRP|S_IWGRP | S_IROTH|S_IWOTH);

review: Approve
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

OK, makes it convenient for devs.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> okay overall, althoug I guess I like "globally-rw-file" over "arw-file". We
> might also want to control based on unix groups, and not need such broad
> permission

Well, the option could take a string we search for u|g|o|a - any votes?

--rw-file arg (=a) Make socket filename rw
                                        (equivalent to chmod <arg>=rw)

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> > okay overall, althoug I guess I like "globally-rw-file" over "arw-file". We
> > might also want to control based on unix groups, and not need such broad
> > permission
>
> Well, the option could take a string we search for u|g|o|a - any votes?
>
> --rw-file arg (=a) Make socket filename rw
> (equivalent to chmod <arg>=rw)

review: Needs Information
Revision history for this message
Chris Halse Rogers (raof) wrote :

I'm somewhat hesitant to introduce this; it's somewhat of a workaround for us not being able to run Mir in a window in X, which it looks like Cemil is actually going to do soon.

If we are going to introduce it, I think it should be as minimal as possible. I'd prefer “make utterly insecure socket” over “set security for socket”.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> I'm somewhat hesitant to introduce this; it's somewhat of a workaround for us
> not being able to run Mir in a window in X,

Actually, no - it isn't a workaround. This is what one of our downstream projects (USC) does and I think it is likely useful for the system compositor case (where the protection is done by other means).

> which it looks like Cemil is actually going to do soon.
>
> If we are going to introduce it, I think it should be as minimal as possible.
> I'd prefer “make utterly insecure socket” over “set security for socket”.

That was my thinking too.

review: Abstain
Revision history for this message
Chris Halse Rogers (raof) wrote :

Wait, USC publishes a world-readable socket? Sadface.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

New functions need a new stanza, I think...

35 +++ src/platform/symbols.map 2015-02-03 13:54:49 +0000
36 @@ -103,6 +103,7 @@
37 mir::graphics::Renderable::transformation*;
38 mir::graphics::UserDisplayConfigurationOutput::extents*;
39 mir::graphics::UserDisplayConfigurationOutput::UserDisplayConfigurationOutput*;
40 + mir::options::arw_server_socket_opt*;

review: Needs Fixing
2288. By Alan Griffiths

Separate new entry point into a new symbol map stanza

2289. By Alan Griffiths

merge lp:mir

2290. By Alan Griffiths

Fix spurious change

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) :
review: Approve
2291. By Alan Griffiths

merge lp:mir

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/include/platform/mir/options/configuration.h'
2--- src/include/platform/mir/options/configuration.h 2015-02-04 08:45:38 +0000
3+++ src/include/platform/mir/options/configuration.h 2015-02-04 17:40:42 +0000
4@@ -30,6 +30,7 @@
5 extern char const* const server_socket_opt;
6 extern char const* const prompt_socket_opt;
7 extern char const* const no_server_socket_opt;
8+extern char const* const arw_server_socket_opt;
9 extern char const* const enable_input_opt;
10 extern char const* const session_mediator_report_opt;
11 extern char const* const msg_processor_report_opt;
12
13=== modified file 'src/platform/options/default_configuration.cpp'
14--- src/platform/options/default_configuration.cpp 2015-02-04 08:45:38 +0000
15+++ src/platform/options/default_configuration.cpp 2015-02-04 17:40:42 +0000
16@@ -32,6 +32,7 @@
17 char const* const mo::server_socket_opt = "file,f";
18 char const* const mo::prompt_socket_opt = "prompt-file,p";
19 char const* const mo::no_server_socket_opt = "no-file";
20+char const* const mo::arw_server_socket_opt = "arw-file";
21 char const* const mo::enable_input_opt = "enable-input,i";
22 char const* const mo::session_mediator_report_opt = "session-mediator-report";
23 char const* const mo::msg_processor_report_opt = "msg-processor-report";
24@@ -116,6 +117,7 @@
25 (server_socket_opt, po::value<std::string>()->default_value(::mir::default_server_socket),
26 "Socket filename [string:default=$XDG_RUNTIME_DIR/mir_socket or /tmp/mir_socket]")
27 (no_server_socket_opt, "Do not provide a socket filename for client connections")
28+ (arw_server_socket_opt, "Make socket filename globally rw (equivalent to chmod a=rw)")
29 (prompt_socket_opt, "Provide a \"..._trusted\" filename for prompt helper connections")
30 (platform_graphics_lib, po::value<std::string>(),
31 "Library to use for platform graphics support (default: autodetect)")
32
33=== modified file 'src/platform/symbols.map'
34--- src/platform/symbols.map 2015-02-04 08:45:38 +0000
35+++ src/platform/symbols.map 2015-02-04 17:40:42 +0000
36@@ -259,3 +259,11 @@
37 };
38 local: *;
39 };
40+
41+MIRPLATFORM_6.1
42+{
43+global:
44+ extern "C++" {
45+ mir::options::arw_server_socket_opt*;
46+ };
47+} MIRPLATFORM_6;
48
49=== modified file 'src/server/frontend/default_configuration.cpp'
50--- src/server/frontend/default_configuration.cpp 2015-01-21 07:34:50 +0000
51+++ src/server/frontend/default_configuration.cpp 2015-02-04 17:40:42 +0000
52@@ -64,12 +64,17 @@
53 }
54 else
55 {
56- return std::make_shared<mf::PublishedSocketConnector>(
57+ auto const result = std::make_shared<mf::PublishedSocketConnector>(
58 the_socket_file(),
59 the_connection_creator(),
60 threads,
61 *the_emergency_cleanup(),
62 the_connector_report());
63+
64+ if (the_options()->is_set(options::arw_server_socket_opt))
65+ chmod(the_socket_file().c_str(), S_IRUSR|S_IWUSR| S_IRGRP|S_IWGRP | S_IROTH|S_IWOTH);
66+
67+ return result;
68 }
69 });
70 }

Subscribers

People subscribed via source and target branches