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

add safeguard to prevent moss from eating your current operating system #423

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cameronbraid
Copy link

Only provide a default value for "root" global argument if the current system is identified as a serpent os.

Currently uses the MACHTYPE env for detection

Manually tested on a arch system :

> moss list installed
Error: args: Root directory is required, but not provided

And when we fake then env we get an expected error

> MACHTYPE=serpent moss list installed
Error: list: client: db: diesel connection: Unable to open the database file

Only provide a default value for "root" global argument if the current system is identified as a serpent os.

Currently uses the MACHTYPE env for detection
@CLAassistant
Copy link

CLAassistant commented Feb 13, 2025

CLA assistant check
All committers have signed the CLA.

@Quackdoc
Copy link

Would it not be better to check /usr/lib/os-release ? I know MACHTYPE can sometimes change depending on shell.

also this seems like it would limit moss to working on serpent as the system package manager. perhaps there could be a better way of doing this. Could this be set via config or something?

@cameronbraid
Copy link
Author

What about changing the default back to / and add an assertion that "$root/.moss" folder is present

@cameronbraid
Copy link
Author

cameronbraid commented Feb 13, 2025

Although, this might suggest that a separate moss init command should be added as the only means to create a .moss installation... then all other commands could fail if the directory its not a valid installation

@ermo
Copy link
Contributor

ermo commented Feb 14, 2025

The idea of having a well thought out moss init feature that checks for the relevant preconditions etc. sounds compelling.

This migh also tie nicely into potentially setting up the proper minimum SELinux policy for /.moss and /usr in the future.

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