Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anybody using RUNAS utility
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Divers
Thread ID:
00948554
Message ID:
01125106
Vues:
35
Ali,

What I thought, probably for an ill executed test, was that if, WHILE impersonating, you launched a process like explorer, then the new process (Explorer) would receive the credentials of the impersonated user, but I tested again and it seems not to be true (Try creating a protected folder and create a table in it, and run the following code to test) (X is mapped as in the original message, you can replace the drive letter for \\server\share) (Oh, I just thought it might be SP2 implemented this that is why my old test gave me the wrong impression? who knows)
close databases all

lcPath			= 'X:\PS\'
lcTable			= 'Protected'
lcAdminUser		= 'RAN02'

try
	use (lcPath + lcTable)
	Messagebox('Table opened without using impersonation')
	use
catch
	Messagebox('Unable to open table without using impersonation')
endtry

if Impersonate(lcAdminUser, Inputbox('Enter your password', 'Password'))
	try
		use (lcPath + lcTable)
		Messagebox('Table opened using impersonation')
		use
	catch
		Messagebox('Unable to open Table even using impersonation')
	endtry
	
	loShell		= Createobject('Shell.Application')
	loShell.Explore(lcPath)

* Or

	loSHell		= Createobject('WSCript.Shell')
	loShell.Exec('Explorer ' + lcPath)
endif

EndImpersonate()
Anyways, even if I was not wrong, it was more like a word of caution not to open this kind of interactive windows. As for where to store the password... there are ways, you can save it in an encrypted text file, in an encrypted registry entry etc. but I do not know where is the best place, as I said in my original message, we never got to use this, it was a test.

Anatoly also found some other gotchas, so you might want to check http://fox.wikis.com/wc.dll?Wiki~RunAsAnotherUser~VFP, and that reminds me I should correct what I wrote there
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform