ibm-midrangecontrol-languageibm-ifs

AS/400 IFS authorities issue


I got some headache managing AS/400 IFS authorities. The IFS files were created using CLE or ILE-COBOL via call to CPYTOIMPF. By default, permission setting under IFS will be 700. Problem is the ID (A) I used to create the file and the one who use it will be another ID (B). Therefore, B is not able to read the file even though A & B are on the same group, GP01.

I have tried CHGPGP the IFS root /RootDir/MyDir to the same group, say GP01. In addition, I also CHGAUT OBJ('/RootDir/MyDir') USER(*PUBLIC) DTAAUT(*RW) OBJAUT(*NONE). However, I still cannot access the file via ID B.

Please help out! Thanks in advance.


Solution

  • Take a look at the STMFAUT() parm of CPYTOIMPF..

    You probably want to use STMFAUT(*INDIR)

    *INDIR The authority settings of the output stream file are based on the authority for the directory where the stream file is to be created. The stream file is assigned the same public authority, private authorities, primary group, primary group authority, authorization list, and auditing value as the directory in which it is created. If the target file system does not support the *INDIR special value, the command will fail.

    Then just make sure the directory you are putting the file into has the authorities you need.