Appserver setuserid

enzo

New Member
HI, I have:
Progress 101a in suse linux 10,
Progress 101a in win xp sp2
Appserver is Up, I have a structured procedure ("pr.p") with many procedures and many temp-table definitions. One proc. "useridset" :

DEFINE INPUT PARAMETER usr AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pass AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER nombase AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER res AS LOG NO-UNDO.

res = SETUSERID(usr, pass , nombase).

In win xp :

DEFINE VARIABLE sh AS HANDLE NO-UNDO.
DEFINE VARIABLE lLog AS LOGICAL NO-UNDO.
DEFINE VARIABLE hc AS HANDLE NO-UNDO.

CREATE SERVER sh.
sh:CONNECT("-pf Buc_cpaas.pf").

RUN "pr.p" ON SERVER sh PERSISTENT SET hc .
RUN "useridset" IN hc ("sysprogress", "sys", "buc_cpa", OUTPUT lLog) .
MESSAGE lLog VIEW-AS ALERT-BOX INFO BUTTONS OK.

I get the error:
"Connection failure for host <host_name> port <port> transport TCP. (9407)"

Appserver`s log files show:
broker.log:

P-006211 T-S-0005 1 UB ---------- Posted EAbnormalShutdownServerEvent for PID: 6245

server.log

P-006245 T-000000 2 AS DYNOBJECTS Created PROCEDURE Handle:0 ( Line 0) pr.p
P-006245 T-000000 1 AS -- (Procedure: 'useridset pr.p' Line:2670) SYSTEM ERROR: Violacion de la memoria. (49)
P-006245 T-000000 1 AS -- (Procedure: 'useridset pr.p' Line:2670) ** Salve el fichero de nombre core para ser analizado por Progress Software Corporation. (439)
P-006245 T-000000 2 AS CONN Desconectando de base de datos buc_cpa, usuario numero 47. (9545)

Any suggestions?

Thanks!
 
try

RUN pr.p ON SERVER sh PERSISTENT SET hc .
RUN useridset IN hc ("sysprogress", "sys", "buc_cpa", OUTPUT lLog) .
MESSAGE lLog VIEW-AS ALERT-BOX INFO BUTTONS OK.
 
MaximMonin: Thats Dont work.
I tried the KB # 21213 with the connect.p procedure, but its raise a
"memory violation" too.


Thanks for answer me.
 
Memory violation (49) is system error. It means that problem maybe out of your source code and you should check appserver's settings or something else
 
If I do this:
"useridset.p" (separate .p file in server):

DEFINE INPUT PARAMETER usr AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pass AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER nombase AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER res AS LOG NO-UNDO.

res = SETUSERID(usr, pass , nombase).

Cliente side:
DO:
DEFINE VARIABLE lLog AS LOGICAL NO-UNDO.
RUN useridset ON SERVER sh ("q", "", "buc_cpa", OUTPUT lLog).
END.

Works fine. But if I add a call to a structured proc. the program raise the error:
Connection failure for host <host_name> port <port> transport <transport_name>. (9407)

I dont know how to change values of appserver outside Progress Explorer Tool.
 
And if you simply call the internal procedure without the SETUSERID?

Is there something in the procedure (auditing or database rights or so?) which make it invalid to actually be in the procedure when the user id is changed?
 
I was simply trying to eliminate the irrelevant parts - ie can you run internal procedures.
  1. What happens when you run both sources from a character client on Linux?
  2. What happens when you run both sources from a character client on Windows?
  3. What happens when you run both sources from a GUI client?
 
Great, so that means that the thread title can be changed from 'Appserver setuserid' to 'setuserid in a persistent procedure'.

I am assuming that when testing running the internal procedure, the useridset procedure is the only internal procedure in your .p?

I think its time to take this to Progress Tech Support - they should be able to tell you based on the contents of your protrace what the issue is.
 
Stefan. In the structured proc. :
* if useridset is alone -> works fine.
* if useridset is with other procedures -> useridset cause error.

Thanks.
 
Just a thought from my side: You don't say anything about the operating mode your AppServer is running. Most probably you could use the event procedures to do the user authentication (namely the connect, activate and deactivate procedures in conjunction with the SERVER-CONNECTION-CONTEXT attribute) depending on the operating mode you are running the AppServer. This is very well documented in the AppServer programming guide that comes with the documentation.

In general you should not reference any database objects in the procedure in which you do the SETUSERID because a change in the USERID could also mean that security restrictions prevent the procedure to run when the user you've authenticated does not have access rights to the database objects (tables, fields) which are referenced in the same procedure ...

Heavy Regards, RealHeavyDude.
 
Hi RealHeavyDude, the Appserver is running in State-reset mode. If I set the connect procedure with
SETUSERID, the connection crash and cause "memory violation".


Thanks.
 
The solution to use the connect and activate/deactivate response procedures (we use stateless and state-free AppServers only) to use SETUSERID or authenticate against the database with the CLIENT-PRINCIPAL object is something we are running without a fuzz for years.

Maybe, if you post the contents of your connect response procedure we could see what is going wrong. Otherwise I would suggest you to contact the Progress support.

Regards, RealHeavyDude.
 
AM
RealHeavyDude, thanks for reply me.

The following code dont works:
KB#21213:
AppServer connect procedure:


/* asConnect.p */


DEFINE INPUT PARAMETER pcUserID AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcPassWd AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcMisc AS CHARACTER NO-UNDO.


DEFINE VARIABLE iDB AS INTEGER NO-UNDO.


DEFINE VARIABLE lOk AS LOGICAL NO-UNDO.


/* If there is no value specified for pcUserID, that means the client
application could be a SmartObject application which passes these
values as the 3rd parameter. This assumes that the SmartObject
application is passing a comma separated list of userid and
password*/


IF pcUserID EQ "" OR
pcUserID EQ ? THEN
ASSIGN pcUserID = ENTRY(1,pcMisc)
pcPassWd = ENTRY(2,pcMisc).


/* Loop through the list of connected databases and authenticate the
userid and password. This will be more complicated if the various
databases require different userids and passwords.*/


DO iDB = 1 TO NUM-DBS:
lOk = SETUSERID(pcUserID,pcPassWd,LDBNAME(iDB)) NO-ERROR.
END.


IF ERROR-STATUS:ERROR OR
NOT lOk THEN
RETURN ERROR.


/* end asConnect.p */

The following code does not work:

DEFINE INPUT PARAMETER pcUserID AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcPassWd AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcMisc AS CHARACTER NO-UNDO.

SETUSERID(pcUserID,pcPassWd,"db-name") NO-ERROR.


Appserver is in State-free or stateless.

The only thing what I want is get the user-name in triggers for auditing. In the windows operations its all right,
but the problems appear through the appserver.

If there are some another way, or better way to do this, please guide me.

Thanks.
 
Back
Top