OS-USERID¶
Starting in FWD branch 3821c revision 11837, FWD provides a new "built-in function" OS-USERID
. This revision is not yet available in FWD trunk. The original task for developing this feature was #5009. It has useful information about the implementation.
Introduction¶
OS-USERID
acts like a global variable that is always available. It reports the current user's operating system userid/user name. It obtains this using native OS code and returns the result as a character
type.
This feature is not yet available in the FWD trunk branch.
Syntax¶
OS-USERID
Behavior¶
This will return the userid/user name as a character value. The value will be as reported by the operating system for the specific session's FWD client JVM process. If the OS userid/user name cannot be determined, then the "" (empty string) is returned.
Example¶
message "OS-USERID = '" + os-userid + "'; USERID = '" + USERID + "'".
If the current user's name is "greg" and there is no _user
database login active, then this will result in the following message text:
OS-USERID = 'greg'; USERID = ''
Implementation¶
The Java implementation exists in SecurityOps.getOSUserId()
. It reads the value from a set of client-side parameters that are queried when the FWD client starts. This client-side code uses native operating system API calls to obtain this value:
OS | API |
---|---|
Windows | GetUserNameA |
Linux | geteuid() and getpwuid() |
Please see #5009 for more implementation details.
© 2020 Golden Code Development Corporation. ALL RIGHTS RESERVED.