• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Job User Name And Current Job User

    May 19, 2015 Patrick Botz

    I see developers make one mistake way more often than any other. They assume that the job user name also represents the user profile under which a job is currently executing. This is, and always has been, an invalid assumption. The job user name only represents the userID under which the job was originally started. The user profile that a job is executing under at any given point in time (i.e., the current user) may or may not be the same as the job user. This may seem like a trivial and harmless mistake. But it often isn’t.

    In previous tips and posts (see the Related Stories below) I’ve described a security architecture that is effective, cheap to implement and, most importantly, creates an access control environment that is cheap to administer. Briefly, the preferred security architecture is one where:

    1. Administrators control access to the initial application program
    2. Applications control users’ access to business functions
    3. Developers ensure applications acquire the authority needed for authorized users to successfully execute authorized business functions provided by the application

    Using the job user instead of the current user often makes it much more costly to retrofit existing applications with this architecture. This is because many of the mechanisms provided by the OS for developers to use to accomplish item 3 above manipulate the current user and groups values. The system never uses the job user value to check authority to an object. (The one exception to this has no effect on this discussion.)

    When implementing an application, developers need to consider the how the security architecture is implemented before determining whether they need to use the job user or the current user. In nearly all cases, developers actually need the current user value. There may be the odd case where they really do want the job user, but this will usually only occur, in applications that were implemented with the preferred security architecture.

    So how do you find the current user for a job? Easy. You use the same tools you use to get the job user. You just refer to a different value.

    In CL, RTVJOBA command retrieves both values. The USER parameter contains the Job user. This is what nearly everyone uses. The CURUSER parameter contains the current user value. When retrofitting an application, the change is trivial. Assume you have existing CL code that retrieves the job user value. Something like the following code snippet appears in your CL program:

    DCL  &USRPRF     CHAR(10)            /* The user of the job */
    RTVJOBA          USER(&USRPRF)      /* Retrieve the user of the job */
    /* . . . rest of the code */
    

    You only need to make the following change to use the correct user information:

    RTVJOBA CURUSER(&USRPRF)
    /* . . . rest of the code */
    

    In RPG and other programming languages, the QUSRJOBI API returns the same values. One difference that could create some complexity, however, is that the current user value is only returned in the JOBI0600 receiver format. This format incurs a higher performance hit than the JOBI0100 format. If the performance of this particular application is of extreme importance, then you will want to do some performance testing before rolling the change into production.

    The changes required in your application will depend entirely on each specific call to the API. If the only reason you call the API is to get the name of the user under which the job is executing, then you will only need to change the format name and the offset from which you copy the user value. If, however, your code uses other values returned by the API, then more changes may be needed. You may need to add an extra call to the QUSRJOBI API to get the current user. Here is the link to the QUSRJOBI API documentation.

    As President and CTO of Botz & Associates, Patrick’s expertise includes security strategy, security policy enforcement, password management, single sign-on (SSO), industry and government compliance, and biometrics. He is the architect of the SSO stat! service. Previously he worked as Lead Security Architect at IBM, and he founded the IBM Lab Services security consulting team. You can connect with Pat here.

    RELATED STORIES

    Re-Adopt Authority Utility

    Low Risk Authority Changes

    Share this:

    • Share on Reddit (Opens in new window) Reddit
    • Share on Facebook (Opens in new window) Facebook
    • Share on LinkedIn (Opens in new window) LinkedIn
    • Share on X (Opens in new window) X
    • Email a link to a friend (Opens in new window) Email

    Tags:

    Sponsored by
    FalconStor

    Simplify Secure Offsite Data Protection for IBM Power with FalconStor Habanero™

    IBM i teams are under growing pressure to ensure data is protected, recoverable, and compliant—without adding complexity or disrupting stable environments.

    FalconStor Habanero™ provides secure, fully managed offsite data protection purpose-built for IBM Power. It integrates directly with existing IBM i backup tools and processes, enabling reliable offsite copies without new infrastructure, workflow changes, or added operational overhead.

    By delivering and managing the service end-to-end, FalconStor helps organizations strengthen cyber resilience, improve disaster recovery readiness, and meet compliance requirements with confidence. Offsite copies are securely maintained and available when needed, supporting recovery, audits, and business continuity.

    FalconStor Habanero offers a straightforward way to modernize offsite data protection for IBM i: focused on simplicity, reliability, and resilience.

    Learn More

    Share this:

    • Share on Reddit (Opens in new window) Reddit
    • Share on Facebook (Opens in new window) Facebook
    • Share on LinkedIn (Opens in new window) LinkedIn
    • Share on X (Opens in new window) X
    • Email a link to a friend (Opens in new window) Email

    Sponsored Links

    The Omni User:  Chicago's OMNI Technical Conference, June 4-5, Palos Hills, Illinois
    NGS:  The Many Faces of Query/Reporting/Analytics. Free, Live Webinar. May 20
    United Computer Group:  VAULT400 BaaS delivers secure cloud backup and DR solutions

    Prevent Overlapping In Range Tables Hadoop and IBM i: Not As Far Apart As One Might Think

    Leave a ReplyCancel reply

Volume 15, Number 10 -- May 19, 2015
THIS ISSUE SPONSORED BY:

ProData Computer Services
PowerTech
WorksRight Software

Table of Contents

  • Native Regular Expressions In DB2 For i 7.1 And 7.2
  • Prevent Overlapping In Range Tables
  • Job User Name And Current Job User

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM i PTF Guide, Volume 28, Number 28: A Crazy Number of Security Vulnerability Patches
  • Inside The Encryption Key Management Changes In IBM i 7.6
  • FalconStor Moved To The Blue Lagoon, And Is Poised For Growth Because Of It
  • Guru: Claude’s SQL Tip
  • Astera Makes Extracting Legacy Report Data an AI Specialty
  • IBM i PTF Guide, Volume 28, Number 27
  • Welcoming The New IBM i Chief Architect And Other New Top Brass
  • A Deep Dive Into That Power S1112 Entry Power11 Server
  • Guru: Beyond Three-Part Naming – Running SQL Across Remote IBM i Systems
  • How IBM Bolstered IBM i Resilience In The Summer Tech Refreshes

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle