Skip to content

Sudoers files that contain group names with spaces in their name don't work (illegal escape sequence) #1282

@parapente

Description

@parapente

Describe the bug
I have some ubuntu workstations connected to an active directory domain controller and I have created some sudoers files in /etc/sudoers.d/ to give some extra permissions to the users of the group "Domain Admins". Testing sudo-rs I am no longer able to use those files as I get an error when parsing them (illegal escape sequence).

To Reproduce
Steps to reproduce the behavior:

  1. Create a sudoers file /etc/sudoers.d/domain-admins with the line:
%Domain\ Admins ALL=(ALL:ALL) NOPASSWD:ALL
  1. Run sudo -i
  2. See error:
/etc/sudoers.d/domain-admins:1:9: illegal escape sequence
%Domain\ Admins ALL=(ALL:ALL) NOPASSWD:ALL
        ^

Expected behavior
To open root shell

Environment (please complete the following information):

  • Ubuntu 25.10
  • sudo-rs 0.2.8

Additional context
Using group id works as expected via %#2000512 ALL=(ALL:ALL) NOPASSWD:ALL

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-parserParser/ASTbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions