Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement template support #12

Merged
merged 1 commit into from
Jun 4, 2021
Merged

Implement template support #12

merged 1 commit into from
Jun 4, 2021

Conversation

LaakkonenJussi
Copy link
Contributor

Add two patches which change profile loading to be delayed until all
arguments are parsed. This is due to the template key replacement, since
templates are to be given as arguments as well. Each line in the profile
line is checked and if one template is found they are replaced with the
corresponding value. If no changes are required the profile line is
untouched.

@LaakkonenJussi
Copy link
Contributor Author

@okodron review is appreciated.

For @Tomin1 and @spiiroin please see also LaakkonenJussi/firejail#1 which contains the changes made here as directly on top of Sailfish OS patches + upstream git fork.

Copy link
Member

@Tomin1 Tomin1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for what we currently need. I think we may need to revisit those allowed characters a little if we use these for directory paths later.

@LaakkonenJussi
Copy link
Contributor Author

This works for what we currently need. I think we may need to revisit those allowed characters a little if we use these for directory paths later.

Could you be more specific if you have some concerns somewhere? That part could be improved anyways a bit.

@Tomin1
Copy link
Member

Tomin1 commented May 28, 2021

This works for what we currently need. I think we may need to revisit those allowed characters a little if we use these for directory paths later.

Could you be more specific if you have some concerns somewhere? That part could be improved anyways a bit.

So, IIUC this doesn't allow dashes but I think we do want to keep them in directory names. Otherwise it's probably fine.

@LaakkonenJussi
Copy link
Contributor Author

LaakkonenJussi commented May 28, 2021

This works for what we currently need. I think we may need to revisit those allowed characters a little if we use these for directory paths later.

Could you be more specific if you have some concerns somewhere? That part could be improved anyways a bit.

So, IIUC this doesn't allow dashes but I think we do want to keep them in directory names. Otherwise it's probably fine.

I could add them as supported chars since the actual D-Bus names are checked by the dbus.c:dbus_check_name() - and I guess those are allowed in sailjail.

@Tomin1
Copy link
Member

Tomin1 commented May 28, 2021

This works for what we currently need. I think we may need to revisit those allowed characters a little if we use these for directory paths later.

Could you be more specific if you have some concerns somewhere? That part could be improved anyways a bit.

So, IIUC this doesn't allow dashes but I think we do want to keep them in directory names. Otherwise it's probably fine.

I could add them as supported chars since the actual D-Bus names are checked by the dbus.c:dbus_check_name() - and I guess those are allowed in sailjail.

Looks like sailjail allows organization_name.application_name D-Bus service as is. I thought it would be doing some sort of substitution.

Add two patches which change profile loading to be delayed until all
arguments are parsed. This is due to the template key replacement, since
templates are to be given as arguments as well. Each line in the profile
line is checked and if one template is found they are replaced with the
corresponding value. If no changes are required the profile line is
untouched.

Signed-off-by: Jussi Laakkonen <[email protected]>
@LaakkonenJussi
Copy link
Contributor Author

This works for what we currently need. I think we may need to revisit those allowed characters a little if we use these for directory paths later.

Could you be more specific if you have some concerns somewhere? That part could be improved anyways a bit.

So, IIUC this doesn't allow dashes but I think we do want to keep them in directory names. Otherwise it's probably fine.

I could add them as supported chars since the actual D-Bus names are checked by the dbus.c:dbus_check_name() - and I guess those are allowed in sailjail.

Looks like sailjail allows organization_name.application_name D-Bus service as is. I thought it would be doing some sort of substitution.

I did remove the substitutions as there was no proper reason to do that. And I added better way to this to handle chars _-/..

@LaakkonenJussi
Copy link
Contributor Author

Since this does not depend on any other component in our case I'm merging this to be tested in devel.

@LaakkonenJussi LaakkonenJussi merged commit 1fdd673 into master Jun 4, 2021
@LaakkonenJussi LaakkonenJussi deleted the jb54034 branch June 4, 2021 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants