Because I'm being lazy and not wanting to create a test program to find this answer...
If I am signed on as JSMITH and swap the profile handle to QSECOFR and then create an object, is the object created by and/or owned by JSMITH or QSECOFR?
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Mark Waterbury
Sent: Thursday, May 19, 2022 3:15 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Failure to adopt authority
This is most likely because the IFS "no workie" with adopted authority.
You need to use the QSYGETPH, QWTSETP and QSYRLSPH APIs to temporarily change the current job to run "as" a user profile (like QSECOFR) that has sufficient authority over the IFS directories and files in question, because the IBM i IFS (Unix-like) APIs do not "adopt" authority.
Note that you probably need to be adopting authority to have authority to swap profiles, so you are half way there. :-)
Hope that helps,
Mark S. Waterbury
On Thursday, May 19, 2022, 03:05:27 PM EDT, <smith5646midrange@xxxxxxxxx> wrote:
I have to be overlooking something and I'm hoping one of you will see it.
I have an SQLRPGLE program named SCRTEST. It is owned by QSECOFR and is USRPRF(*OWNER);
In the program it needs to execute the below MOV command which is built on the fly. FYI - I'm using MOV because I can rename the file and move it to a different library at the same time.
MOV OBJ('/QSYS.LIB/OLDLIB.LIB/OLDFILE.FILE')
TOOBJ('/QSYS.LIB/NEWLIB.LIB/NEWFILE.FILE')
I have tried calls using both system() and QCMDEXC().
If I run the program with the QSECOFR profile, both versions work. If I run it with a *USER profile, both versions fail.
What am I missing? Do system() and QCMDEXC() not pass the adopted authority to the command that they call? If not, is there a different command that does?
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.