Focal Point
Modify with no write permission to directory containing .FOC to be modified

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7871006102

December 15, 2006, 10:20 AM
Adri
Modify with no write permission to directory containing .FOC to be modified
Using Webfocus 5.3.2 self service;
when a user runs a FEX to modify a focus database, and the focus database is in a directory that the user has only read access to; focus creates a new .FOC in the temp directory (edatemp) where the user has write access, and the modify updates this new database.

This seems to me like a big bug, has anyone encountered this problem? do you have a work around, like some type of & message that can be queried? Any suggestions?


WF 7.6.9 Windows
December 15, 2006, 10:23 AM
Carol Dobson
Do you have a USE statement?

If so, does it have NEW ?

USE
location\filename.foc NEW
END

A little more info would be helpful.

Thanks



WebFOCUS 7.6.6/TomCat/Win2k3
December 15, 2006, 10:59 AM
Adri
I'm not using USE, the .FOC is in a directory in the path. For users with write access to the directory the modify update the .foc in the path; for users with no write access, a new .foc is creating in the temp directory.


WF 7.6.9 Windows
December 15, 2006, 11:13 AM
susannah
sounds to me like its working absolutely perfectly. If by 'temp dir' you mean the agent,
then at the end of the update process, query the existence of the .foc in that user's agent dir, (we don't know your platform ), if you're in win then CMD STATE agent\filename.FOC
and query the &RETCODE, and branch accordingly.
Get the agent name using the TEMPPATH function.
If by 'temp dir' you don't mean the agent, then you know where your TEMPDIR is set..so checking the existence of the .foc will be easier.
If everyone shares the same explicit TEMPDIR then you do have a problem, but its not a bug. You can reset the TEMPDIR to the users own agent, much safer, i do it all the time for my REMOTE calls, where an explicit TEMPDIR is required.
If you're relying on the path to locate the file, then its working exactly as you would want it to. WYCIWYG. Otherwise you need to do what Carol has already suggested, and explictly declare a USE to point to the proper file. and if the user can't update it, then see what kind of error message you get.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
December 15, 2006, 11:15 AM
Carol Dobson
Try adding the USE statement. All MODIFY's should have a USE statement.

Of course, if the user doesn't have access, the request should fail.

Let us know!



WebFOCUS 7.6.6/TomCat/Win2k3
December 15, 2006, 12:01 PM
Adri
You are correct the USE statement will fix the problem.
What confused me is that when I issue a MODIFY if I have access to write to the file, it used the file in the path, but if I don't have access it creates a new one.
I guess we should always use the USE command when modifing.
thanks for your help
A.


WF 7.6.9 Windows
December 15, 2006, 12:20 PM
Tony A
Adri,

Get into the habit of using it always, even when reporting as then you'll know where the data is definitely coming from / going to!

Control the machine don't let it control you.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
December 15, 2006, 01:54 PM
Adri
great advise !
A.


WF 7.6.9 Windows
December 15, 2006, 02:52 PM
Carol Dobson
Another handy commend is WHENCE


WHENCE focusfile FOCUS

where:

focusfile

Is a FOCUS data source.


This will show you the location of the file that's being used quickly!



WebFOCUS 7.6.6/TomCat/Win2k3
December 15, 2006, 03:37 PM
Adri
I guess you're suggesting that we should not rely on path to find a data file, but should always explicitly reference it with use.

Can the output of the whence command be captured?


WF 7.6.9 Windows
December 15, 2006, 04:36 PM
Carol Dobson
Like Tony A said, you should always use the USE command.

And, you can only capture it with a cut/paste - from looking at the echo.
Look up the WHENCE command, it's helpful.


-DEFAULT &ECHO=ALL;



WebFOCUS 7.6.6/TomCat/Win2k3