# Fedora.linux\_system\_roles.sudo - bug in scan\_sudoers.py module

**URL:** <https://forum.ansible.com/t/fedora-linux-system-roles-sudo-bug-in-scan-sudoers-py-module/45832>\
**Category:** Get Help\
**Tags:** bug, fedora, linux-system-roles\
**Created:** [May 21, 2026, 3:26pm UTC](https://forum.ansible.com/t/fedora-linux-system-roles-sudo-bug-in-scan-sudoers-py-module/45832 "2026-05-21T15:26:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![XakV](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/xakv/32/896_2.png) [@XakV](https://forum.ansible.com/u/XakV)\
**Post date:** [May 21, 2026, 3:26pm UTC](https://forum.ansible.com/t/fedora-linux-system-roles-sudo-bug-in-scan-sudoers-py-module/45832/1 "2026-05-21T15:26:18Z")

</div>

I submitted this issue for the linux-system-roles / sudo repo.

> <https://github.com/linux-system-roles/sudo/issues/121>
>
> I can't take credit for this, a co-worker helped me solve it and suggested this …fix.
> 
> Problem: Sometimes the line-continuance character \`\\\` is parsed as a sudoers command.
> 
> Given this line in a sudoers file...
> 
> \`\`\`
> neko ALL=(root) NOPASSWD: REPAIRDISK, /bin/mount, /bin/umount, /usr/bin/iotop, /usr/sbin/lsof, /usr/sbin/iotop, /bin/cat /var/log/messages, \\
> /some/path/to/a/command/somewhere/that/i\_want\_to\_run.sh
> \`\`\`
> 
> The scan\_sudoers.py plugin parses the entry as:
> 
> \`\`\`
> {
> "commands": \[
> "REPAIRDISK",
> "/bin/mount",
> "/bin/umount",
> "/usr/bin/iotop",
> "/usr/sbin/lsof",
> "/usr/sbin/iotop",
> "/bin/cat /var/log/messages",
> "\\\\"
> \],
> "hosts": \[
> "ALL"
> \],
> "operators": \[
> "root"
> \],
> "tags": \[
> "NOPASSWD"
> \],
> "users": \[
> "neko"
> \]
> },
> \`\`\`
> 
> Which completely skips the wrapped line.
> 
> The suggested fix we came up with is in the \`def get\_config\_lines(path, params):\` function.
> 
> Just before iterating through the \`all\_lines\` read from the sudoers file ( ~ line 223 ) we suggest "unfolding" wrapped lines with re.sub like this...
> 
> \`\`\`python
> 
> # "Unfold" lines with a continuance character '\\' followed by 0 or more spaces or tabs
> # a newline '\\' and again 0 or more spaces or tabs.
> unfolded\_lines = re.sub(r'\\\\\\s\*\\n\\s\*', '', all\_lines)
> # Work on each line of sudoers file
> for sline in unfolded\_lines.strip().split("\\n"):
> line = sline.replace("\\n", "").replace(
> "\\t", " "
> ) # cleaning up chars we don't want
> \`\`\`

I could submit a PR, but I’d have to read the contrib guidelines and stuff 🙂 sorry.

The scan\_sudoers.py module doesn’t seem to pick up line continuation characters consistently, so I suggested a change that would use re.sub to “unwrap” lines before processing them with the regex.

Just FYI?
