× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Fri, 2 Apr 2004 richard@xxxxxxxxxxx wrote:

> Here's a sample ILE RPG for SETUID that should work for you.
> No warranties implied :-)

No.  Your code is "change uid" rather than "set uid."   SetUID makes a
program run with the authority of a given userid, similar to the "Set
Profile (QWTSETP)" API or the "Set To Profile Token (QSYSETPT)" API.

Your code changes what the uid is in the user profile, which is similar to
the CHGUSRPRF command.

On top of that, you use the "B" data type in RPG, which can't support the
full range of possible values.  Though, this is largely irrelevant since
you're passing a 5P 0 field as a parameter -- so it's never going to allow
a uid higher than 99999 anyway.

And, your ERRRTN variable is wrong.  The first 4 bytes need to be an
integer representing the size of the variable.  Since you're passing
blanks, it thinks the ERRRTN variable 1077952576 bytes long (1077952576 =
x'40404040')

Plus, since you've got an error indicator set on the CALL op-code, and
then you're not checking it, if anything goes wrong it'll be undetected.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.