dun / munge

MUNGE (MUNGE Uid 'N' Gid Emporium) is an authentication service for creating and validating user credentials.
GNU Lesser General Public License v3.0
250 stars 46 forks source link

Exceeded maximum length of socket pathname #106

Closed Tom-python0121 closed 3 years ago

Tom-python0121 commented 3 years ago

when i use:munge -n, some error happend.

Steps to reproduce the issue

[root@localhost sbin]# ./munged -S ../var/run/munge/munge.socket.2
[root@localhost sbin]# munge -n
-bash: munge: command not found
[root@localhost sbin]# cd ..
[root@localhost munge-0.5.14-226zewtxozsftf3gjc6ttnwskq4msqkj]# ls
bin  etc  include  lib  sbin  share  var
[root@localhost munge-0.5.14-226zewtxozsftf3gjc6ttnwskq4msqkj]# spack load munge
[root@localhost munge-0.5.14-226zewtxozsftf3gjc6ttnwskq4msqkj]# munge -n
munge: Error: Exceeded maximum length of socket pathname

Why would it happen?

dun commented 3 years ago

Communication with munged is over a UNIX domain socket. The name of this socket must fit within a 108-byte static array in struct sockaddr_un.

The default name for this socket is ${runstatedir}/munge/munge.socket.2. It can be overridden at buildtime with configure --with-munge-socket=PATH. It can also be overridden at runtime with munged --socket=PATH (for the server) and munge --socket=PATH (for the client). But the length of the socket pathname must be less than 108 bytes.

Tom-python0121 commented 3 years ago

@dun Is that what you mean? [root@localhost sbin]# ./munged --socket=../var/run/munge/munge.socket.2 [root@localhost sbin]# munge --socket=../var/run/munge/munge.socket.2

Why is it stuck here?It's not going down. It's stuck here.

dun commented 3 years ago

The munge -n command-line arg has nothing to do with the Error: Exceeded maximum length of socket pathname. You're getting that error because the software was configured with a socket name that exceeds the 108-byte static array. You can see the default socket name shown in brackets with: ./munged -h | grep socket=

If you don't specify -n to munge --socket=../var/run/munge/munge.socket.2, the munge client will read from stdin until it gets an EOF -- it's not stuck. Try entering ctrl-d, or add -n to the munge command.