Getting Error as "relocation error: /lib64/libsemanage.so.1: symbol sepol_ibendport_modify, version LIBSEPOL_1.0 not defined in file libsepol.so.1 with link time reference" while adding user

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 7.9
  • shadow-utils

Issue

  • useradd is failing with the error:
[root@localhost ~ ]# useradd USERNAME
useradd: relocation error: /lib64/libsemanage.so.1: symbol sepol_ibendport_modify, version LIBSEPOL_1.0 not defined in file libsepol.so.1 with link time reference
[root@localhost ~ ]#

Resolution

  • Reinstall (or install if not present)the package:
 # yum install libsepol

 Or

 # yum reinstall libsepol
  • Verify the package:
 # rpm -V `rpm -qf /lib64/libsepol.so.1`

Diagnostic Steps

# strace -Tttvfs 1024 -o /tmp/useradd-issue_$(date +%s).strace useradd USERNAME
....
49711 10:37:44.810276 open("/lib64/libsepol.so.1", O_RDONLY|O_CLOEXEC) = 3 <0.000033>
49711 10:37:44.810357 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@W\0\0\0\0\0\0@\0\0\0\0\0\0\0\230\250\t\0\0\0\0\0\0\0\0\0@\08\0\7\0@\0\35\0\34\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$O\t\0\0\0\0\0$O\t\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0@[\t\0\0\0\0\0@[)\0\0\0\0\0@[)\0\0\0\0\0\370\16\0\0\0\0\0\0\240#\0\0\0\0\0\0\0\0 \0\0\0\0\0\2\0\0\0\6\0\0\0\300]\t\0\0\0\0\0\300])\0\0\0\0\0\300])\0\0\0\0\0\360\1\0\0\0\0\0\0\360\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0\310\1\0\0\0\0\0\0$\0\0\0\0\0\0\0$\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0P\345td\4\0\0\0\314\362\7\0\0\0\0\0\314\362\7\0\0\0\0\0\314\362\7\0\0\0\0\0\364.\0\0\0\0\0\0\364.\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0R\345td\4\0\0\0@[\t\0\0\0\0\0@[)\0\0\0\0\0@[)\0\0\0\0\0\300\4\0\0\0\0\0\0\300\4\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\276\241<)\320\205\37\227\332\"\215\2415\356\226\2l\325\0161\0\0\0\0\305\0\0\0K\0\0\0 \0\0\0\v\0\0\0X\23a\300\0\300!\0\0\30\08\30\1\0\0V\0\202P \t@H\200\"\0@&\2\1\20\22\261)`\201\305\32\0\0\0\300 J\0\0\5\0@\332\0\30\10\tHa\"\200\0\4R\340\204\0\20\0\0\0\4\300\0\22\25\0\27\20\20\0\v\0000@\210T\231\20\25\0\20\201\212\1\0@\310\6\10\f1T\22\264\6\3062\21\2h\30\204`\20\0\0\4`\1\225@\204n\n\0\201V\0@\300\0\20\5 \0!@\0\n\2\16\2\20`\223\1A\204\0\4\200 \2\10\10\0\21\200\252\4\3\240\300NP\0\4^\220\240\2 \4\0\1D\0`\0\0\200\0\20\200\200\0\t0\200\300B\0\0  \200\20\224e \206P\300!\0\0@\2\224@\34A   \nL\1\0\4\0B0\t\4\230\4(\2$\300%\0\0BLC\200@!\21\22H\201\0(\f\0\0H@\0\"\200\1\4HK\0\0\0M\0\0\0P\0\0\0R\0\0\0U\0\0\0\0\0\0\0\0\0\0\0V\0\0\0\0\0\0\0X\0\0\0Y\0\0\0[\0\0\0\\\0\0\0\0\0\0\0]\0\0\0^\0\0\0", 832) = 832 <0.000023>

49711 10:37:44.810438 fstat(3, {st_dev=makedev(253, 1), st_ino=3326, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=1240, st_size=634840, st_atime=1656791109 /* 2022-07-03T01:15:09.445577499+0530 */, st_atime_nsec=445577499, st_mtime=1470835511 /* 2016-08-10T18:55:11+0530 */, st_mtime_nsec=0, st_ctime=1656786027 /* 2022-07-02T23:50:27.255966011+0530 */, st_ctime_nsec=255966011}) = 0 <0.000020>

49711 10:37:44.814391 writev(2, [{iov_base="useradd", iov_len=7}, {iov_base=": ", iov_len=2}, {iov_base="relocation error", iov_len=16}, {iov_base=": ", iov_len=2}, {iov_base="/lib64/libsemanage.so.1", iov_len=23}, {iov_base=": ", iov_len=2}, {iov_base="symbol sepol_ibendport_modify, version LIBSEPOL_1.0 not defined in file libsepol.so.1 with link time reference", iov_len=110}, {iov_base="", iov_len=0}, {iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 10) = 163 <0.000039>
...
[root@localhost ~ ]#  rpm -V `rpm -qf /lib64/libsepol.so.1`
file /lib64/libsepol.so.1 is not owned by any package
[root@localhost ~ ]#  rpm -V `rpm -qf /lib64/libsemanage.so.1`
package /lib64/libsepol.so.1 is not installed
package is is not installed
package not is not installed
package owned is not installed
package by is not installed
package any is not installed
package package is not installed

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments