IBM

ls_initrex

Initializes the LSF library for remote execution.

ls_initrex initializes the LSF library for remote execution. This routine must be called before any other remote execution LSLIB library routines 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.

#include <lsf/lsf.h>

int ls_initrex(int num, int options)

Parameters:
num The number of socket to be creat.
options Flags for ls_initrex. Currently its value is KEEPUID.
Data Structures:
none
Define Statements:
none
Returns:
int:numports
Function was successful.

int:-1
Function failed.

Errors:
If the function fails, lserrno is set to indicate the error.
Equivalent line commands:
none
Files:
${LSF_ENVDIR:-/etc}/lsf.conf
See also:
ls_connect


     
Date Modified: 16 Jul 2014

Terms of Use
Copyright © 1994-2014 International Business Machines Corp.
US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.