SMBIOD(8)

SMB Client I/O Daemon

SMBFS I/O Daemon

static string to hold the path of the door jamb even though it is defined as a macro elsewhere:

static const char door_path[] = SMBIOD_SVC_DOOR;

Server procedure svc_dispatch allows a null argument (see the Liveness Check pattern).

void
svc_dispatch(void *cookie, char *argp, size_t argsz,
    door_desc_t *dp, uint_t n_desc)
{
    if (argp == NULL) {
        int32_t rc = 0;
        door_return((void *)&rc, sizeof (rc), NULL, 0);
    }

    /* ... actual code ... */
}

A liveness check can also determine whether a door server is already running, to prevent a second instance of the server from (attempting to) clobber the jamb:

    /*
     * If a user runs this command (i.e. by accident)
     * don't interfere with any already running IOD.
     */
    err = smb_iod_open_door(&door_fd);
    if (err == 0) {
        close(door_fd);
        door_fd = -1;
        DPRINT("%s: already running\n", argv[0]);
        exit(SMF_EXIT_OK);
    }

SMB Development Tool

This tool doesn't seem to have a manual entry, but here is the issue which introduces it: https://www.illumos.org/issues/9874

Because this is a testing tool, it has some hardcoded "mock" behavior:

/*
 * Make sure we don't call the real IOD here.
 */
int
smb_iod_open_door(int *fdp)
{
    *fdp = -1;
    return (ENOTSUP);
}

Since doors have such unusual control flow, resources (including the door itself) may be cleaned up at non-obvious times:


    /*
     * In the error case, the caller may try again
     * with new auth. info, so keep the door open.
     * Error return will close in smb_ctx_done.
     */
    return (err);