One solution is to force XCOM to create all incoming files with a fixed, user defined UMASK on remotely initiated transfers. How is this possible? When a file is received by XCOM, it is received into a temporary file. Only when the filetransfer is complete, is that file closed and then renamed to the target filename specified in the transfer request. We can force XCOM to open this temporary file with a particular UMASK. When the temporary file rename occurs, the UMASK is retained for the specified filename. The mechanics for setting this up are as follows:
How to set appropriate permissions for incoming file transfers
Code the xcompp post processing script (found in /usr/lib/xcom) to perform a chmod against the temporary file created by XCOM when receiving the file. At the very end of the xcompp script (where it says "POSTPROCESS HERE") code:
chmod xxx $tmp_file
where 'xxx' is the numeric file permissions, e.g., '644'.
Also, change the following two lines in the xcompp script:
'tmp_file==$1' should be changed to 'tmp_file=$1' and
'file==$1' should be changed to ' file=$1'
This will change the permissions of every incoming file being transferred to XCOM/UNIX.
An important note: Response time and timing issues differ from UNIX system to UNIX system. On some systems it is possible that the transfer will proceed so quickly that the post processing script will not have the opportunity to modify the UMASK prior to the opening of the temporary file when it begins to accept the transferred data. If such is the case on your system, use the variable $file in the script, and not $tmp_file. So for this scenario, code the xcompp post processing script (found in /usr/lib/xcom) to perform the chmod as: chmod xxx $tmp_file
where 'xxx' is the numeric file permissions, e.g., '644'."
at the very end of the xcompp script (where it says "POSTPROCESS HERE").
Lastly, we should mention that prior to XCOM for UNIX version 3.00.0104d,transfers that created a file where either FILE_OPTION=REPLACE or FILE_OPTION=APPEND was specified, XCOM for UNIX would create the file with a UMASK of 666 instead of the value specified by the CA XCOM UMASK parameter. In versions 3.00.0104d or later, the CA-XCOM UMASK parameter is honored for locally initiated transfers.