Skip to content

[Bug]: win_lgpo_reg: value name with period causes state failure #68565

@dafyddj

Description

@dafyddj

What happened?

A lgpo_reg.value_present state that previously worked on versions up to v3006.14 now results in failure.
The value name has a period/dot in it.
Example:

# salt DESKTOP-G7IDEEE -t 10 state.single lgpo_reg.value_present SCRNSAVE.EXE key='Software\Policies\Microsoft\Windows\Control Panel\Desktop' v_data=screensaver v_type=REG_SZ policy_class=User
DESKTOP-G7IDEEE:                                                   
----------                                                         
          ID: SCRNSAVE.EXE                                         
    Function: lgpo_reg.value_present
      Result: False                                                
     Comment: Failed to set User policy value
              - key: Software\Policies\Microsoft\Windows\Control Panel\Desktop
              - name: SCRNSAVE.EXE
              - v_data: screensaver
              - v_type: REG_SZ                                     
     Started: 21:12:10.100401                                      
    Duration: 23.807 ms                                            
     Changes:                                                      

Summary for DESKTOP-G7IDEEE                                        
------------                                                       
Succeeded: 0                                                       
Failed:    1                                                       
------------                                                       
Total states run:     1                                            
Total run time:  23.807 ms                                         
ERROR: Minions returned with non-zero exit code

or state:

SCRNSAVE.EXE:
  lgpo_reg.value_present:
    - key: Software\Policies\Microsoft\Windows\Control Panel\Desktop
    - v_data: screensaver
    - v_type: REG_SZ
    - policy_class: User

Note: the state is actually applied successfully but the return result is False.

# salt DESKTOP-G7IDEEE -t 10 lgpo_reg.read_reg_pol User                                                             
DESKTOP-G7IDEEE:                                                   
    ----------                                                                                                                         
    Software\Policies\Microsoft\Windows\Control Panel\Desktop:                                                                         
        ----------                                                                                                                     
        SCRNSAVE.EXE:                                                                                                                  
            ----------                                                                                                                 
            data:                                                                                                                      
                screensaver                                        
            type:                                                  
                REG_SZ

This issue seems to be related to code changes introduced in #68192.

FAO @twangboy

Type of salt install

Official exe

Major version

3007.x, 3006.x

What supported OS are you seeing the problem on? Can select multiple. (If bug appears on an unsupported OS, please open a GitHub Discussion instead)

windows-desktop-11

salt --versions-report output

Salt Version:
              Salt: 3006.18
     
    Python Version:
            Python: 3.10.19 (heads/main:e8bbdd8, Dec 16 2025, 10:04:27) [MSC v.1944 64 bit (AMD64)]
     
    Dependency Versions:
              cffi: 2.0.0
          cherrypy: 18.6.1
      cryptography: 42.0.5
          dateutil: 2.8.1
         docker-py: Not Installed
             gitdb: 4.0.7
         gitpython: 3.1.41
            Jinja2: 3.1.6
           libgit2: Not Installed
      looseversion: 1.0.2
          M2Crypto: Not Installed
              Mako: Not Installed
           msgpack: 1.0.2
      msgpack-pure: Not Installed
      mysql-python: Not Installed
         packaging: 24.0
         pycparser: 2.21
          pycrypto: Not Installed
      pycryptodome: 3.19.1
            pygit2: Not Installed
      python-gnupg: 0.4.8
            PyYAML: 6.0.1
             PyZMQ: 25.0.2
            relenv: 0.22.1
             smmap: 4.0.0
           timelib: 0.2.4
           Tornado: 4.5.3
               ZMQ: 4.3.4
     
    System Versions:
              dist:   
            locale: utf-8
           machine: AMD64
           release: 10
            system: Windows
           version: 10 10.0.26100 SP0 Multiprocessor Free

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbroken, incorrect, or confusing behaviorneeds-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions