When specifying wrong syntax in sudoers.d include files sudo throws a segmentation fault

Bug #1908438 reported by Jacobus Erasmus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sudo (Ubuntu)
New
Undecided
Unassigned

Bug Description

I made a mistake and used a relative rather than absolute path to the application:

The following file placed in the /etc/sudoers.d causes a segmentation fault in when and sudo command is run.

/etc/sudoers.d/reset_database

#Allows reset_database to be called as user jacobus
jacobus ALL=NOPASSWD: systemctl stop freeradius
jacobus ALL=NOPASSWD: systemctl start freeradius
jacobus ALL=NOPASSWD: systemctl restart postgresql

ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: sudo 1.9.1-1ubuntu1
ProcVersionSignature: Ubuntu 5.8.0-33.36-generic 5.8.17
Uname: Linux 5.8.0-33-generic x86_64
ApportVersion: 2.20.11-0ubuntu50.2
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Wed Dec 16 22:19:05 2020
InstallationDate: Installed on 2019-06-04 (561 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Release amd64 (20190416)
SourcePackage: sudo
UpgradeStatus: Upgraded to groovy on 2020-10-25 (52 days ago)
VisudoCheck:
 Error: command ['pkexec', '/usr/sbin/visudo', '-c'] failed with exit code 1: /etc/sudoers.d/reset_database: bad permissions, should be mode 0440
 /etc/sudoers: parsed OK
 /etc/sudoers.d/README: parsed OK
 /etc/sudoers.d/cephadm: parsed OK
 /etc/sudoers.d/openfortigui: parsed OK
modified.conffile..etc.sudoers: [inaccessible: [Errno 13] Permission denied: '/etc/sudoers']
modified.conffile..etc.sudoers.d.README: [inaccessible: [Errno 13] Permission denied: '/etc/sudoers.d/README']

Revision history for this message
Jacobus Erasmus (jacobus) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.