Solved Sudo says - undefined symbol: memset_s

This error appears after the password challenge and the requested command does not run. If I set sudo to accept all users in group wheel without a password then the error does not appear. This is with a newly installed FreeBSD 11 system. This error happens with the port and the package. Something needs to be updated?
 
This is caused by trying to run a sudo binary on 11.0 which was compiled on 11.1.

libc on 11.0 doesn't contain memset_s() so the sudo configure script will fallback to compiling and using a builtin implementation of it named sudo_memset_s(). On 11.1 though the configure script will notice that libc exports memset_s() and will use that instead. Now if you try to run that 11.1 binary on 11.0 it's expecting the dynamic linker to find memset_s() but since it's nowhere to be found it errors with 'Undefined symbol.'

With that said, I'm assuming you're running an 11.0 system and the package repository you're pulling from was built on 11.1. You mention that you had this error even when compiling from ports which I would expect to fix this; so that's a little baffling. My guess is you're still using an 11.1 binary somehow and if you run file `which sudo` you'll see 'for FreeBSD 11.1.'
 
That was a phenomenal reply. Sure enough I did not do make reinstall or maybe even make install. It works now and through your reply it looks like it would have worked out of the box had I updated my installation media. Thanks again.
 
So I have the same problem. Running on FreeBSD 11.0 for the past year.
Having done several pkg update/upgrade since then.
Executing the update again today December 11, 2017:

Code:
[jac ~]$ sudo pkg update
Password:
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01   
Fetching packagesite.txz: 100%    6 MiB   6.1MB/s    00:01   
Processing entries: 100%
FreeBSD repository update completed. 26992 packages processed.
All repositories are up to date.
[jac ~]$ sudo pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (51 candidates): 100%
Processing candidates (51 candidates): 100%
The following 3 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
    tiff: 4.0.8 -> 4.0.9
    sudo: 1.8.21p2 -> 1.8.21p2_1
    ca_root_nss: 3.32.1 -> 3.34.1

Number of packages to be upgraded: 3

2 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/3] Fetching tiff-4.0.9.txz: 100%  813 KiB 832.3kB/s    00:01   
[2/3] Fetching sudo-1.8.21p2_1.txz: 100%  911 KiB 932.7kB/s    00:01   
[3/3] Fetching ca_root_nss-3.34.1.txz: 100%  298 KiB 305.2kB/s    00:01   
Checking integrity... done (0 conflicting)
[1/3] Upgrading tiff from 4.0.8 to 4.0.9...
[1/3] Extracting tiff-4.0.9: 100%
[2/3] Upgrading sudo from 1.8.21p2 to 1.8.21p2_1...
[2/3] Extracting sudo-1.8.21p2_1: 100%
You may need to manually remove /usr/local/etc/sudoers if it is no longer needed.
[3/3] Upgrading ca_root_nss from 3.32.1 to 3.34.1...
Extracting ca_root_nss-3.34.1: 100%

No issues with the password for the 2 sudo. As you can see Sudo is upgraded: 1.8.21p2 -> 1.8.21p2_1
Some more work done using sudo, no issues
Logged out, logged in some time later get the issue described. Run the command:

Code:
[jac ~]$ file `which sudo`
/usr/local/bin/sudo: setuid ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 11.1, FreeBSD-style, stripped

Based on previous response I would assume that the 11.0 repository contains the 11.1 sudo binary!
Am I now supposed to install the port collection to get this issue fixed? Or an upgrade to 11.1?
 
I have the same problem on a raspberry-pi running FreeBSD 11.0. After I have upgrade sudo today I cannot run it anymore.

I solved the problem by mounting the SD card on my desktop and changing the sudoers file so that sudo does not require a password.
Now I wonder if over time other programs will break if I stay with FreeBSD version 11.0 but as far as I know automatic version upgrade is not supported on a raspberry-pi. Is there a way to upgrade to 11.1 other than installing from scratch?
 
Is there a solution other than installing 11.1 from scratch?

Rebuild security/sudo from ports tree:
1. login as root
% su
2. fetch and extract ports tree, if it isn't exist in your system (if exist, just update it # portsnap fetch update)
# portsnap fetch extract
3. Then cd into sudo port and reinstall it
# cd /usr/ports/security/sudo
# make deinstall install clean

If you're in wheel group and know root password,
then you are able to use su, as a temporary solution,
it is possible to use it like this:
# su root -c "[i]your_command_here[/i]"

Or install doas, as a replacement of sudo (originated from OpenBSD)
# make -C /usr/ports/security/doas install clean
Then create /usr/local/etc/doas.conf with
Code:
permit keepenv :wheel
or
Code:
permit keepenv [i]your_username[/i]
inside. Then you'll be able to use doas as sudo.
Create an alias in your ~/.bashrc or ~/.zshrc:
Code:
alias sudo='doas'
Or add
Code:
alias sudo 'doas'
to ~/.cshrc.

But, after all, you need to update to 11.1, because 11.0 reached the end of life.
 
I ran into this when using the drm-next kernel (prior to it becoming a port). You may be able to get sudo working by using sudo -S <cmd>. As for doas, while it works, the persist feature doesn't work, (or at least didn't when Iast tried it) so you will continually have to type your password.
 
Back
Top