reberhardt7 / cplayground

GNU General Public License v3.0
115 stars 14 forks source link

Don't hardcode uid/gid in kernel module #28

Closed reberhardt7 closed 4 years ago

reberhardt7 commented 4 years ago

The cplayground debugger reads data from the /proc/cplayground procfile, which is generated by our kernel module. In order to make this file readable by the (unprivileged) node server process, we set the procfile to be owned by the user running the server process: https://github.com/reberhardt7/cplayground/blob/6366368c28ab820d4bad9d81eed5012469339747/src/server/kernel-mod/cplayground.c#L305 Right now, that's hardcoded, but that obviously causes problems when we try to run/test this on other peoples' machines, or when we go to deploy this in production.

We should have some way to adapt this based on the environment that is being used, e.g. use a compile-time environment variable via make, or something like that. This will be less important when #21 is addressed, but it's still important.

glen3b commented 4 years ago

I'd think module command line parameters should be good for this purpose. I'll take a look this weekend.