Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Administrator permissions with run a program
Tue, Apr 1 2014 1:06 AMPermanent Link

Peter Evans

Subject : Administrator permissions with run a program

Hello All,

Some background : I have almost finished the port of a DBISAM
application to ElevateDB. The ElevateDB databases are Unicode.
My installer for DBISAM product worked on Windows 8 and the user could
run without being an Administrator.

I have tweeked the installer for ElevateDB version.  During the course
of my development I have always had to
run with administrative privileges, otherwise I get the dreaded "Access
is denied" message.

But I can not ask users of ElevateDB version to always run as administrator.

What follows is an EurekaLog 7.0.7.0 listing. The problem occurs when
logging on and the program needs to read and
write to a User Table.

Call Stack Information:
------------------------------------------------------------------------------------------------------------------------------
|Methods |Details|Stack   |Address |Module      |Offset  |Unit |Class
               |Procedure/Method   |Line      |
------------------------------------------------------------------------------------------------------------------------------
|*Exception Thread: ID=2996; Parent=0; Priority=0
                                                     |
|Class=; Name=MAIN
                                                     |
|DeadLock=0; Wait Chain=
                                                     |
|Comment=
                                                     |
|----------------------------------------------------------------------------------------------------------------------------|
|7FFFFFFE|03     |00000000|00779F77|XXXX.exe
|00379F77|edbfilemgr|TEDBFile               |RaiseOSError       |          |
|00000040|03     |0018F7AC|0077C20F|XXXX.exe
|0037C20F|edbosfilemgr|TEDBOSFile             |InternalOpen       |
     |
|00000040|03     |0018F7DC|0077C8E0|XXXX.exe
|0037C8E0|edbosfilemgr|TEDBOSFile             |Open               |
     |
|00000040|03     |0018F818|0077B153|XXXX.exe    |0037B153|edbfilemgr
|TEDBFileManager        |OpenFile           |          |
|00000040|03     |0018F854|0079E65D|XXXX.exe    |0039E65D|edblockmgr
|TEDBLockManager        |InternalOpen       |          |
|00000040|03     |0018F88C|0079E4EC|XXXX.exe    |0039E4EC|edblockmgr
|TEDBLockManager        |Open               |          |
|00000040|03     |0018F8A4|008E0DDD|XXXX.exe    |004E0DDD|edblocal
|TEDBLocalSessionManager|InternalOpen       |          |
|00000040|03     |0018F8D8|008E0FA6|XXXX.exe    |004E0FA6|edblocal
|TEDBLocalSessionManager|Open               |          |
|00000040|03     |0018F8FC|00936B07|XXXX.exe    |00536B07|edbcomps
|TEDBSession            |InternalConnect    |          |
|00000040|03     |0018F94C|00936297|XXXX.exe    |00536297|edbcomps
|TEDBSession            |SetConnected       |          |
|00000040|03     |0018F970|00938E0D|XXXX.exe    |00538E0D|edbcomps
|TEDBDatabase           |DoConnect          |          |
|00000040|04     |0018F984|00757D6D|XXXX.exe    |00357D6D|Data.DB
|TCustomConnection      |SetConnected       |3159[8]   |
|00000040|04     |0018F9AC|00D070B0|XXXX.exe
|009070B0|TableUserLow|TTableUserAccess       |DirectoryPoint
|284[5]    |
|00000040|04     |0018F9B8|00D0618D|XXXX.exe
|0090618D|TableUserLow|TTableUserAccess       |Create
|198[3]    |
|00000040|04     |0018F9D8|00D0BC55|XXXX.exe    |0090BC55|SysTabLow
|TSysTabObj             |GetTableUserAccess |187[2]    |
|00000040|04     |0018F9E8|00D525AC|XXXX.exe    |009525AC|TableUser   |
                      |SYSTUSER           |342[3]    |
|00000040|04     |0018FC20|01AB6017|XXXX.exe    |016B601 |XXXX1
|TFormMain              |FormCreate         |2183[185] |
|00000040|04     |0018FEAC|005CD455|XXXX.exe    |001CD455|Vcl.Forms
|TCustomForm            |DoCreate           |3693[3]   |
|00000040|04     |0018FED0|005CD099|XXXX.exe    |001CD099|Vcl.Forms
|TCustomForm            |AfterConstruction  |3577[1]   |
|00000040|04     |0018FF00|005CD06C|XXXX.exe    |001CD06C|Vcl.Forms
|TCustomForm            |Create             |3572[35]  |
|00000040|04     |0018FF38|005D7A96|XXXX.exe    |001D7A96|Vcl.Forms
|TApplication           |CreateForm         |10283[13] |
|00000040|04     |0018FF70|01AE94FF|XXXX.exe    |016E94FF|XXXX        |
                      |Initialization     |78[28]    |
|00000040|03     |0018FF88|75BC8541|kernel32.dll|00028541|KERNEL32    |
                      |BaseThreadInitThunk|          |
------------------------------------------------------------------------------------------------------------------------------

Basically the program starts, a object TTableUserAccess is created, the
directory when the database resides is pointed to,
then ElevateDB code takes over. The problem occurs in object TEDBFile.

The problem might arise in the following areas :-

1) the database resides at   c:\ProgramData\XXXX\SYS
Does one need to be an administrator to read and write in here?

2) on component EDBSession1 : TEDBSession
I have set at design time.
  Login Password = EDBDefault
  Login User     = Administrator
Does this mean the user using Windows 8 has to be the administrator?

3) on same component.
   LocalTempTablesPath = c:\Users\Peter\AppData\Local\Temp
Note that SessionType = stLocal
Should I make property LocalTempTablesPath blank?


Regards,
  Peter Evans
Tue, Apr 1 2014 11:05 AMPermanent Link

Raul

Team Elevate Team Elevate

On 4/1/2014 1:06 AM, Peter Evans wrote:
> 1) the database resides at   c:\ProgramData\XXXX\SYS
> Does one need to be an administrator to read and write in here?

This is likely the culprit. Users only have read access to this by
default (it's what Microsoft calls common app data folder shared by all
users). So admin users OK, regular users read-only.

MS recommendation is that your installer should create the app folder
here and set proper permissions (i.e. allow regular users to write etc)
for your app folder here.

Raul
Wed, Apr 2 2014 5:51 AMPermanent Link

Peter Evans

Raul,

Your reply mentioning setting proper permissions got me thinking.

At first I modified the installer so that permissions on each of the
ElevateDB files I installed were writeable.

When the user ran, the program got further. But there was still an
"Access is denied".

On investigation it was because a "EDBDatabase.EDBLck" file was created
on the fly. It did not have writeable permissions... So this caused a
problem.

The solution, which may be of interest to other ElevateDB users, was to
make the parent folder have the required permissions.

So thanks for pointing me in the right direction.

Regards,
  Peter Evans
Image