Page 1 of 1

Cannot get encrypted password from parameter set

Posted: Mon Aug 18, 2014 2:21 am
by SIHM
I want to write a generic routine to get the encrypted password from a parameterset. However when I get the encrypted password it returns a value of -16 using the following functions

paramList = DSGetJobInfo(JobHandle , DSJ.PARAMLIST);
param = Field(paramList, ',', P);
paramVal = DSGetParamInfo(JobHandle, param, DSJ.PARAMDEFAULT);

The only other alternative I can think of is to read the parameterset file directly as a file. However in order to do this I need to know where the parameterset directory is and obviously which environment and project I am working on. Is there a way of determining the parameterset directory in real time ?

Does anyone else have any potential solutions or workarounds for this.

Thanks

Posted: Mon Aug 18, 2014 7:43 am
by chulett
Did you look up what that -16 means?

$DSHOME/include/dsapi.h

Posted: Mon Aug 18, 2014 7:51 am
by SIHM

Code: Select all

-16 =  Cannot get values, Default values or Design Default values for any job except the current job (Job Handle == DSJ.ME)
So it appears that I can only get to the password whilst running a job and not from a routine.

I don't actually want to decrypt the password (not that its possible anyway), just get its value. It doesn't seem like an unreasonable demand.

The only way I can think of is to write a routine which calls a job which returns $UserStatus.

So are there any other ways to get hold of the value or the path to the parametersets ?

Posted: Mon Aug 18, 2014 8:00 am
by chulett
Funny, just found a post of mine from 8 years ago where I ran across the exact same error. However, don't recall whatever became of the answer. Perhaps try DSJ.PARAMVALUE instead?

Posted: Mon Aug 18, 2014 8:09 am
by SIHM
I have tried DSJ.PARAMVALUE and DSJ.PARAMDEFAULT

Parametersets weren't around 8 years ago were they ?

Posted: Mon Aug 18, 2014 8:22 am
by chulett
Nope. However this is a generic parameter error, nothing specific to a 'set'. Hopefully someone else can help.

Posted: Mon Aug 18, 2014 9:11 am
by Mike
You won't find it in the file system unless you've got a value set. Each parameter set has a directory in the ParameterSets directory in your project directory.

What's the end game? I can't think of any reason for getting the encrypted password value without the intention of decrypting it?

You could parse it out of a job log.

I think Kim Duke has some trick for displaying parameter values.

Mike

Posted: Tue Aug 19, 2014 1:07 am
by SIHM
We are writing a routine which will interrogate a series of tables in databases in order to get data volume information.

Given that it is a generic routine, we have to be able to pass the name of parameter set to the routine in order to connect to the tables.

I am aware of the routine to display parametersets but it will never display the password because of the -16 error previously mentioned.

Posted: Thu Aug 21, 2014 9:00 am
by MrBlack
If you're writing a routine to query tables to get their volume data information, why not just write a server job and use the database stages to execute the custom query and then send the rows to an audit table or whatever? You can write a generic server job that you pass in all the parameters you'd need to make it generic.