C AIX function call to get EXEC NAME

C AIX function call to get EXEC NAME

Post by John Smit » Fri, 13 Apr 2001 23:34:19



Hi There,

Is there a function in AIX that will return the current process name like
the Solaris function "getexecname()"??

Thanks,

Kristian.


 
 
 

C AIX function call to get EXEC NAME

Post by Paul Bennet » Sat, 14 Apr 2001 00:31:00



Quote:> Hi There,

> Is there a function in AIX that will return the current process name like
> the Solaris function "getexecname()"??

argv[0] ?

 
 
 

1. Calling 'exec()' functions as someone else under AIX

I know that there are many different flavors of this request floating
around out there, but here goes....

We have an application running on a client workstation which needs to
dynamically start our server process running under AIX.  This server
process needs to run within the profile of the given user. The current
implementation opens a remote login session using a TCP socket
connection from the exec port (512) on the client to the login port
(513) on the AIX server, performs the login request-response dance, runs
a script to launch the server, and then closes the login session.  The
problem with this lies in the login session itself: we are forced to
code delays in the workstation application in order to wait for the
responses to our requests, e.g., we need to wait a few seconds for the
login to complete before we start processing any command-line requests
within the session.  Under normal circumstances, this would not be a
problem, but it becomes one when our AIX box is under heavy
utilization.  At those times, processing of the login request takes
longer than normally expected, and our timing gets a little off.  At
that point, everything else starts to go haywire, and we have to fail
the request to start the remote server application.

What we would prefer to do would be to have a socket listener waiting
for connections from the workstations.  This listener application would
receive the user ID and password from the workstation, impersonate the
given user, spawn the server application and return the proper server
start-up response information, revert to self, and return to listening
for connections.  Everything would be fine with this, except for one
thing: we cannot have the listener running with 'root' authority, since
we are sharing our server with other 'sensitive data' applications and
no process from our application is supposed to have such authority.

The different solutions provided for other UNIX systems (ULTRIX, BSD,
etc.) all seem to revolve in some way or another around the 'setreuid()'
function, or one of its equivalents.  The problem is that these
functions are *severely* limited under AIX, where only 'root' can use
them effectively.  Therefore, they apparently will not work for me in
this scenario.

We would like to keep everything in a single C/C++ application for the
listener.  Does anyone have a programmatic way of doing this, other than
the login session workaround that we are currently using?

Thanks -

- Mark.

2. dial on demand - Problem unter SuSE 8.0

3. Name of the function/script that called the actual function?

4. dlink + redhat

5. how to know the instruction address of calling function within called function?

6. HEEELP! e2fsck errors with NCR and Conner

7. Browser calls CGI C function which sets an env var and call a c function crashes

8. ATI Mach 64 and GW2000

9. Function Calls - Getting Return Value

10. Function Calls - Getting Return Value Part2

11. Process name - function call

12. What is the 64 bit stat function call name for C in GNU

13. Tool that shows all called function name?