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 option to allow disabling root password check for halt, reboot and suspend. #3

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

Conversation

madpilot78
Copy link

This is more an hack than a real implementation, but I'd like some feedback and maybe this can be made in something that can be included in the official sources.

Thanks!

@@ -421,7 +421,7 @@ void App::Run()
}

#ifdef USE_PAM
bool App::AuthenticateUser(bool focuspass)
bool App::AuthenticateUser(bool focuspass, bool hrsauth)
Copy link

Choose a reason for hiding this comment

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

You need to add the , bool hrsauth passing to the non-PAM version of the function too at #448

Comment on lines +476 to +479
if(hrsauth)
pw = getpwnam("root");
else
return true
Copy link

Choose a reason for hiding this comment

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

Suggested change
if(hrsauth)
pw = getpwnam("root");
else
return true
if(!hrsauth) return true;
pw = getpwnam("root");

Choose a reason for hiding this comment

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

I don't think this change is quite right. The function should return true in the "if (!focuspass)" clause just above, where the "This is simply fake!" comment is. I believe that comment is misleading - it's actually the mechanism by which the Exit and Console actions are accepted without requesting a password.

@madpilot78
Copy link
Author

Hi,

I proposed this a lot of time ago, but have not been using slim for years now.

So you can consider this PR abandoned by me. But feel free to work on it and grab these patches if they are useful to you.

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.

3 participants