Skip to content

docs: Update example in chapter 8 to use sudo #263

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

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

pao0626
Copy link
Contributor

@pao0626 pao0626 commented Jul 2, 2024

In chapter 8, the example code for setting permissions is as follows:

static struct kobj_attribute myvariable_attribute =
    __ATTR(myvariable, 0660, myvariable_show, (void *)myvariable_store);

We have two options:

  1. Instruct users to access the file with sudo.
  2. Relax the permission setting to 0666.

This commit adopts the sudo method to maintain security constraints.

@pao0626 pao0626 force-pushed the command-permission-changes branch from 82b7652 to 019ba02 Compare July 3, 2024 04:45
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Read https://cbea.ms/git-commit/ carefully and refine.

@pao0626 pao0626 force-pushed the command-permission-changes branch from 019ba02 to d054d61 Compare July 3, 2024 07:19
@pao0626
Copy link
Contributor Author

pao0626 commented Jul 3, 2024

I actually wrote my initial commit message after carefully reviewing the content from the link you provided (https://cbea.ms/git-commit/), and also referred to https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/ for adding a to the title. However, I couldn't find the best way to express it.

I have now rethought and submitted a new commit message. If there are still areas that can be improved, please let me know.

Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Don't specify the title as "Update lkmpg.tex" since we have one Tex document file. You have to summarize in more informative manner.

Add sudo to commands in Chapter 8 for example module interaction.

The "myvariables" in the module are set with 0660 permissions
via __ATTR(), preventing direct user access.

Options to fix this:
1. Instruct users to use 'sudo' to read/write files.
2. Relax the permission settings to 0666.

This commit adopts the sudo method to maintain security constraints.
@pao0626 pao0626 force-pushed the command-permission-changes branch from d054d61 to be16ad6 Compare July 3, 2024 08:40
@pao0626
Copy link
Contributor Author

pao0626 commented Jul 3, 2024

Thank you for the feedback.

I initially referred to #169 for improvements. I have now rethought the title to include more informative content.

@jserv jserv merged commit 7bcc4fb into sysprog21:master Jul 3, 2024
1 check passed
@jserv
Copy link
Contributor

jserv commented Jul 3, 2024

Thank @pao0626 for contributing!

@pao0626 pao0626 deleted the command-permission-changes branch July 3, 2024 09:08
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.

2 participants