Knowledge Center         Contents    Previous  Next    
Platform Computing Corp.

ls_initrex()

Initializes the LSF library for remote execution.

DESCRIPTION

ls_initrex() initializes the LSF library for remote execution. This routine must be called before any other remote execution LSLIB library routines (see ls_rex()) can be used.

Two remote execution security options are supported in LSF. The first option is to set the effective user ID of an LSF application to root, as other UNIX applications that access remote resources (e.g., rlogin) do. Using this option, numports of the application's file descriptors are bound to privileged ports by ls_initrex(). These sockets are used only for remote connections to RES. If numports is 0, then the system will use the default value LSF_DEFAULT_SOCKS defined in <lsf/lsf.h>. If successful, the number of socket descriptors starting from FIRST_RES_SOCK (defined in <lsf/lsf.h>) that are actually bound to privileged ports is returned, -1 otherwise. To use this option for authentication, the application must be installed as setuid to root. The second security option is to use an authentication daemon supporting the Ident protocol (RFC 931/1413/1414). In this case, this routine returns the value of the input parameter numports if it succeeds, -1 otherwise.

ls_initrex() selects the security option according to the following rule: if the application program invoking it has the effective uid of root, then privileged ports are created; otherwise, no such port is created, and RES will contact an authentication daemon on a connection request (see ls_connect()).

Currently, the only option that can be specified in options is KEEPUID, which instructs ls_initrex() to preserve the current user ID. If the KEEPUID bit is not set in options (i.e. options is zero), then ls_initrex() will change the real, effective and saved user ID to the real user ID.

Any program using this API must be setuid to root if LSF_AUTH is not defined in the lsf.conf file.

This function must be called before calling any other remote execution function.

SYNOPSIS

#include <lsf/lsf.h> 
int ls_initrex(int numports, int options) 

PARAMETERS

numports

hostname

RETURN VALUES

integer:numports

Function was successful.

integer:-1

Function failed.

ERRORS

If the function fails, lserrno is set to indicate the error.

SEE ALSO

Related APIs

ls_connect()

ls_rex()

Equivalent line command

none

Files

${LSF_ENVDIR-/etc}/lsf.conf


Platform Computing Inc.
www.platform.com
Knowledge Center         Contents    Previous  Next