Skip to content

Add option to allow disabling root password check for halt, reboot and suspend.#3

Open
madpilot78 wants to merge 1 commit intoiwamatsu:masterfrom
madpilot78:hrsauth_opt
Open

Add option to allow disabling root password check for halt, reboot and suspend.#3
madpilot78 wants to merge 1 commit intoiwamatsu:masterfrom
madpilot78:hrsauth_opt

Conversation

@madpilot78
Copy link
Copy Markdown

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!


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

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
Copy Markdown

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");

Copy link
Copy Markdown

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
Copy Markdown
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.

netfab pushed a commit to netfab/slim that referenced this pull request May 8, 2025
…for DM mode too

(Tested on a Gentoo box with two screens)


git-svn-id: https://svn.code.sf.net/p/slim-fork/code/trunk@64 6f9459de-4fed-4680-8dc7-46f465f3487e
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