Sudo stopped working...

Colin_In_Belgium

macrumors newbie
Original poster
Feb 2, 2020
7
0
Belgium
Sudo stopped working yesterday with the following message:

sudo: 4294967295: invalid value

I was trying to delete a TM backup : sudo tmutil deletelocalsnapshots 2020-01-22-092840

I have tried other commands with the same error message.
Any idea how to fix this, without reinstalling the o/s?
I'm logged in as Admin.
The sudo version command still works (sudo -V):

Sudo version 1.8.29
Sudoers policy plugin version 1.8.29
Sudoers file grammar version 46
Sudoers I/O plugin version 1.8.29


The permissions are:
-r-s--x--x 1 root wheel 438672 Jan 24 10:14 /usr/bin/sudo

Thanks.
 

Honza1

macrumors 6502
Nov 30, 2013
472
161
US
Backup (just in case) and reinstall "in place" by running the current installer for Mojave from App Store. Reinstall in place (simply run over existing system without wiping the disk) will preserve data, Apps, and settings; it will reinstall system files and may reset this. It is quite fast (~30 minutes on my system at most) and can heal the system.
 

KALLT

macrumors 601
Sep 23, 2008
4,994
3,051
What has changed since yesterday? Installed any software, updated the system?

How does your /etc/sudoers file look? Any configurations in /etc/sudoers.d? Does sudo visudo -cs work and return an error?
 

Colin_In_Belgium

macrumors newbie
Original poster
Feb 2, 2020
7
0
Belgium
Backup (just in case) and reinstall "in place" by running the current installer for Mojave from App Store. Reinstall in place (simply run over existing system without wiping the disk) will preserve data, Apps, and settings; it will reinstall system files and may reset this. It is quite fast (~30 minutes on my system at most) and can heal the system.
Thanks Honza. If nothing else works, I'll do that next week.
 

Colin_In_Belgium

macrumors newbie
Original poster
Feb 2, 2020
7
0
Belgium
What has changed since yesterday? Installed any software, updated the system?

How does your /etc/sudoers file look? Any configurations in /etc/sudoers.d? Does sudo visudo -cs work and return an error?
I believe it was working for the last time just before 29 Jan.
And, on 29th, there were Security Updates installed:
Screenshot 2020-02-02 at 18.02.52.png

Unfortunately, sudo visudo -cs gives me the same error.
I copied the sudoers file and attached it, just in case that's useful.
/etc/sudoers.d is empty.
Screenshot 2020-02-02 at 18.18.59.png
 

Attachments

KALLT

macrumors 601
Sep 23, 2008
4,994
3,051
The sudoers file looks fine.

It probably isn’t a coincidence that it stopped working after installing a security update, as sudo is a system component that should’t have control over. Coincidentally, the latest security update did modify sudo.

Have you tried using sudo with an absolute path? e.g. /usr/bin/sudo visudo -cs

What is the output of echo $PATH?
 
Last edited:

KALLT

macrumors 601
Sep 23, 2008
4,994
3,051
It does seem that sudo is throwing the error. It must be getting some wrong input from somewhere. The number 4294967295 (being the highest number of a 32-bit unsigned integer and usually being reserved for the -1 in programs) can denote an input error.

Are the user and group IDs set correctly? → id (should include “80(admin)”)
Does the sudoers file have to correct permissions? → ls -l /etc/sudoers (should be “-r--r----- 1 root wheel”)

Without anything else to go by, I would also suggest you try the reinstall/repair route suggested above.
 

Colin_In_Belgium

macrumors newbie
Original poster
Feb 2, 2020
7
0
Belgium
[...] Are the user and group IDs set correctly? → id (should include “80(admin)”)
Does the sudoers file have to correct permissions? → ls -l /etc/sudoers (should be “-r--r----- 1 root wheel”)

Without anything else to go by, I would also suggest you try the reinstall/repair route suggested above.
This is what I see for Id and permissions:
Screenshot 2020-02-03 at 06.38.42.png

So, permissions seem ok...
Id includes 80(admin).
I compared the results with those of my partner's Mac (same model with Mojave).
On her machine, sudo works okay.

The only difference I see is that I have :
701(com.apple.sharepoint.group.1)​
702(com.apple.sharepoint.group.2)​
703(com.apple.sharepoint.group.3)​

and she has:
701(com.apple.sharepoint.group.1)​
703(com.apple.sharepoint.group.2)​

A bit strange maybe that her sharepoint groups are 1 with 701 and 2 with 703, and not with 702.

So, unless this changes something, it looks like we all agree, a reinstall is the way to go.
I really appreciate your excellent help, and that of Honza1.
 

bogdanw

macrumors 6502a
Mar 10, 2009
549
300