libsmbios icon indicating copy to clipboard operation
libsmbios copied to clipboard

smbios-battery-ctl can't change settings when a admin password is set

Open flyingflo opened this issue 4 years ago • 5 comments

Even with the --password option, the program returns sucessfully, but changes are not applied. This is fedora 34 on a Dell XPS 13.

% sudo smbios-sys-info                                                                       :(
Libsmbios version:      2.4.3
Product Name:           XPS 13 9380
Vendor:                 Dell Inc.
BIOS Version:           1.15.0
[......]

For example, I'm trying to set the charging mode to standard. It works if no password is set in the BIOS setup program.

% sudo smbios-battery-ctl --get-charging-cfg
Charging mode: primarily_ac
flo@floprimesign ~ 
% sudo smbios-battery-ctl --set-charging-mode=standard --trace --password=${PASSWD}
ENTER TokenTable()
ENTER __init__(<libsmbios_c.smbios_token._TokenTable object at 0x7f053f41bf40>, 1, )
ENTER _errorOnNullPtrFN(<libsmbios_c.smbios_token.LP__TokenTable object at 0x7f053f2d81c0>, <_FuncPtr object at 0x7f053f3257c0>, (1,), )
RAN CTYPES FUNCTION: token_table_factory
LEAVE _errorOnNullPtrFN --> <libsmbios_c.smbios_token.LP__TokenTable object at 0x7f053f2d81c0>

LEAVE __init__ --> None

LEAVE TokenTable --> <libsmbios_c.smbios_token._TokenTable object at 0x7f053f41bf40>

ENTER __getitem__(<libsmbios_c.smbios_token._TokenTable object at 0x7f053f41bf40>, 838, )
LEAVE __getitem__ --> <libsmbios_c.Token ID 0x0346>

ENTER activate(<libsmbios_c.Token ID 0x0346>, )
ENTER _errorOnNegativeFN(0, <_FuncPtr object at 0x7f053f325dc0>, (<libsmbios_c.Token ID 0x0346>,), )
RAN CTYPES FUNCTION: token_obj_activate
LEAVE _errorOnNegativeFN --> 0

LEAVE activate --> 0

Charging mode has been set to: standard


% sudo smbios-battery-ctl --get-charging-cfg                                        
Charging mode: primarily_ac

flyingflo avatar Sep 06 '21 06:09 flyingflo

For comparison, that's the trace without a password:

% sudo smbios-battery-ctl --get-charging-cfg
Charging mode: primarily_ac

% sudo smbios-battery-ctl --set-charging-mode=standard --trace
ENTER TokenTable()
ENTER __init__(<libsmbios_c.smbios_token._TokenTable object at 0x7f8255a4af40>, 1, )
ENTER _errorOnNullPtrFN(<libsmbios_c.smbios_token.LP__TokenTable object at 0x7f82559081c0>, <_FuncPtr object at 0x7f82559547c0>, (1,), )
RAN CTYPES FUNCTION: token_table_factory
LEAVE _errorOnNullPtrFN --> <libsmbios_c.smbios_token.LP__TokenTable object at 0x7f82559081c0>

LEAVE __init__ --> None

LEAVE TokenTable --> <libsmbios_c.smbios_token._TokenTable object at 0x7f8255a4af40>

ENTER __getitem__(<libsmbios_c.smbios_token._TokenTable object at 0x7f8255a4af40>, 838, )
LEAVE __getitem__ --> <libsmbios_c.Token ID 0x0346>

ENTER activate(<libsmbios_c.Token ID 0x0346>, )
ENTER _errorOnNegativeFN(0, <_FuncPtr object at 0x7f8255954dc0>, (<libsmbios_c.Token ID 0x0346>,), )
RAN CTYPES FUNCTION: token_obj_activate
LEAVE _errorOnNegativeFN --> 0

LEAVE activate --> 0

Charging mode has been set to: standard

% sudo smbios-battery-ctl --get-charging-cfg             
Charging mode: standard

The only diff is the addresses..

flyingflo avatar Sep 06 '21 07:09 flyingflo

I wonder how I could help to resolve this issue? Does anybody have an idea how to investigate this? Found something interessting: Altough an admin password is set, smbios-passwd shows NOT installed:

smbios-passwd --info                 
User password
        Password stored as: ASCII
        Password MAX length: 32
        NOT installed
Admin password
        Password stored as: ASCII
        Password MAX length: 32
        NOT installed
Owner password
        Password stored as: ASCII
        Password MAX length: 32
        NOT installed

flyingflo avatar Apr 04 '22 09:04 flyingflo

Same output on a Dell XPS 9500, Debian.

cipollone avatar Nov 19 '22 13:11 cipollone

Same on Dell Precision 7530, Pop OS

SirDogey avatar Jul 16 '23 18:07 SirDogey

Same here: Libsmbios version: 2.4.3 Product Name: XPS 13 9343 Vendor: Dell Inc. BIOS Version: A04 System ID: 0x0665

NeuerUser avatar Jan 22 '24 11:01 NeuerUser