Solaris Common Messages and Troubleshooting Guide

/dev/fd/int: /dev/fd/int: cannot open

Cause

setuid and setgid shell scripts refuse to run - they simply return an error message similar to /dev/fd/3: /dev/fd/3: cannot open. (The number following /dev/fd/ is not necessarily 3.) The first line of the script properly starts a shell, and the filesystem containing the script is not mounted with the nosuid option.

Running truss on the shell script reveals that a call to open(2) is failing with error number 6 (ENXIO):


open("/dev/fd/3", O_RDONLY)                     Err#6 ENXIO

Action

Setuid and setgid shell scripts use the file descriptors in /dev/fd. The contents of /dev/fd are a File Descriptor Filesystem (fdfs) on Solaris 2 and have no connection with floppy disks!

Ensure that the fdfs is mounted as /dev/fd. The following line should appear in /etc/vfstab exactly like this (with NO initial comment symbol):


fd		-		/dev/fd		fd	-	no	-
before the machine is next rebooted.

It may be possible to remount /dev/fd without rebooting by running the following as root:


# mount fd /dev/fd
If this fails the machine must be rebooted after editing /etc/vfstab as detailed above, before setuid/setgid shell scripts are available.

Some administrators, unaware of what /dev/fd is for, comment out the entry in /etc/vfstab that mounts the fdfs (File Descriptor filesystem). This may go unnoticed until an attempt is made to run a setuid or setgid shell script.