Re: [sqlite] Different User different data
Haven't been called "Simon" often in my life, I guess there's a first for everything! :) Strange. I get it all the time. Well, now I know how it feels too! There are two problems, and they come up repeatedly on this and other lists: (1) the 'default' folder for a Windows app changes depending on whether it’s your own code or a DLL opening a file for you. So if you start using a precompiled DLL suddenly your app starts behaving differently for no apparent reason. (2) Windows doing the UAC thing you explained so well in your previous post. Yes I have dealt with this a lot, I'm mostly a Windows developer of some stuff that needs to be very user friendly, zero-interference install & operation etc, so paid my schooling fees in UAC town a few times over. The truth is the UAC is such a blessing in security terms, but such an inconvenience to most windows users who have not been brought up (if you'll allow me the term) with root securities such as is second-nature to a Unix, Linux or most derivative systems and their users. "I Can't do the new thing" syndrome. That said, even to seasoned devs it can produce some very surprising effects if you are not completely up-to-speed. Hence me attempting a layman explanation earlier, but to really know it in depth will of course take some weeks worth of explanations, can't hack it in two paragraphs. I can promise you one thing though, it is in no way random and even though you say "for no apparent reason", there is no mystery about it, the reasons are clear and well documented (if a little laborious to read). It's much like a traffic system of a town. You have places you can drive, and places where you can't, and places where you can drive, but shouldnt, etc. Road signs are provided but meaningless if you don't know what they indicate. Lol, I'll stop right here and refrain from labouring a long-winded explanation on the forum readers, but if anyone is having some trouble with it still, please feel free to drop me an email. The only solution I ever found (for a far earlier version of Windows) was to require a full path to be specified by the user, either asking for it to be typed in, or using the System call which presents the folder GUI and using the path it returns. Easiest is to just put it where it is safe (read: where windows trusts it). A simple API call to the Shell with any of a dozen documented standard path reference IDs will return specific path strings to such locations (depending on the need) and will be transparent to the user, your program, the linked libraries, and more importantly, not be affected by the UAC. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Different User different data
On 3 Jul 2013, at 11:50pm, RSmithwrote: > Haven't been called "Simon" often in my life, I guess there's a first for > everything! :) Strange. I get it all the time. > You have solved it halfway, but the Services have the exact same restrictions > as software in terms of what they are allowed to manipulate (well, not > exactly the same, but close enough to make no difference with your problem). > You have fixed the DB and moved it to a non-protected location, this should > work very well. The only reason your service is seeing a different file is > that it is still looking at the "other" non-safe location, or at a totally > different location altogether. There are two problems, and they come up repeatedly on this and other lists: (1) the 'default' folder for a Windows app changes depending on whether it’s your own code or a DLL opening a file for you. So if you start using a precompiled DLL suddenly your app starts behaving differently for no apparent reason. (2) Windows doing the UAC thing you explained so well in your previous post. > It can't "Look" at something non-existing, there is no magic in the system, > it must abide by the security rules (and benefit from it). > > SO, did you make the service or did someone else? > > If you made it, the fix is easy. If someone else, did, they may have also > moved/placed the data to a separate location anticipating the UAC > restrictions. You will need to actually find the files referenced and > understand which file is accessed by which system (I mean the exact on-disk > bytes, not simply the referred name). adding specific data hashes to the > columns should provide a usable tell-tale. The only solution I ever found (for a far earlier version of Windows) was to require a full path to be specified by the user, either asking for it to be typed in, or using the System call which presents the folder GUI and using the path it returns. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Different User different data
Haven't been called "Simon" often in my life, I guess there's a first for everything! :) You have solved it halfway, but the Services have the exact same restrictions as software in terms of what they are allowed to manipulate (well, not exactly the same, but close enough to make no difference with your problem). You have fixed the DB and moved it to a non-protected location, this should work very well. The only reason your service is seeing a different file is that it is still looking at the "other" non-safe location, or at a totally different location altogether. It can't "Look" at something non-existing, there is no magic in the system, it must abide by the security rules (and benefit from it). SO, did you make the service or did someone else? If you made it, the fix is easy. If someone else, did, they may have also moved/placed the data to a separate location anticipating the UAC restrictions. You will need to actually find the files referenced and understand which file is accessed by which system (I mean the exact on-disk bytes, not simply the referred name). adding specific data hashes to the columns should provide a usable tell-tale. Once figured out, you need to find a setting or something you can manipulate, sadly I dont know your system or services so cannot comment much without further knowledge. If you made it yourself, the solution should be self-evident. Good luck! On 2013/07/04 00:19, Steffen Mangold wrote: Hi Simon, Thanks for you quick response! I found the same reson. I now move my DB from "c:\program files\..." to "e:\..." (this is a separate data partition). The effect is now that with my DB tool (with and without admin right) I see the same data. Fine so long! :) But my Windows Service (under LOCAL SERICE right) still see other data. :( I don't know how to fix this. Regards Steffen Mangold --- This has nothing to do with SQLite sadly, but still easy to fix. It's the WIndows UAC which is doing this to you, as it should for data that it tries to protect. I am guessing you have the DB in a protected location, such as somewhere within c:\Program Files\ or in c:\Windows\ or such... or in the actual same folder as the exe that you use. The UAC will then copy your file (at some initial point) to a substituted "Safe" folder and only edit that file, cleverly avoidining any system changes to the original by anyone, UNLESS of course, you start up Admin mode, in which case Windows no longer subjects your file to the protection, and allows you to edit/access it normally - BUT, this is now an entirely different file with entirely different content than the one in the "Safe" location. The "Safe" location should be somewhere inside c:\Users\YourUser\Appdata\Roaming\... etc (Just search for it from one of these base folders). Your "other" version of the file will be here. Now as to fixing it, well, that is easy too - just move the file to a non-protected place. My suggestion is of course the Appdata path itself, which windows will allow you to change most anything in without asking user permissions. My Documents is another option (but end-users usually fiddle there, so if this is a end-user type program, best not). You should never keep any config files or any files accessed by your program in the same folder as the exe or indeed any of the mentioned protected folders. (Standard Windows path-names exist for all users for all these special folders, easily accessible from the shell, just google it). ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Different User different data
On 3 Jul 2013, at 11:19pm, Steffen Mangoldwrote: > But my Windows Service (under LOCAL SERICE right) still see other data. :( > I don't know how to fix this. Sorry, nor do I. I don’t use Windows. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Different User different data
Hi Simon, Thanks for you quick response! I found the same reson. I now move my DB from "c:\program files\..." to "e:\..." (this is a separate data partition). The effect is now that with my DB tool (with and without admin right) I see the same data. Fine so long! :) But my Windows Service (under LOCAL SERICE right) still see other data. :( I don't know how to fix this. Regards Steffen Mangold --- This has nothing to do with SQLite sadly, but still easy to fix. It's the WIndows UAC which is doing this to you, as it should for data that it tries to protect. I am guessing you have the DB in a protected location, such as somewhere within c:\Program Files\ or in c:\Windows\ or such... or in the actual same folder as the exe that you use. The UAC will then copy your file (at some initial point) to a substituted "Safe" folder and only edit that file, cleverly avoidining any system changes to the original by anyone, UNLESS of course, you start up Admin mode, in which case Windows no longer subjects your file to the protection, and allows you to edit/access it normally - BUT, this is now an entirely different file with entirely different content than the one in the "Safe" location. The "Safe" location should be somewhere inside c:\Users\YourUser\Appdata\Roaming\... etc (Just search for it from one of these base folders). Your "other" version of the file will be here. Now as to fixing it, well, that is easy too - just move the file to a non-protected place. My suggestion is of course the Appdata path itself, which windows will allow you to change most anything in without asking user permissions. My Documents is another option (but end-users usually fiddle there, so if this is a end-user type program, best not). You should never keep any config files or any files accessed by your program in the same folder as the exe or indeed any of the mentioned protected folders. (Standard Windows path-names exist for all users for all these special folders, easily accessible from the shell, just google it). Good luck! On 2013/07/03 23:41, Steffen Mangold wrote: > Hi, > > I have some strainge behavior with a SQLIte DB. > If I open the database with my DB tool with administrator right I see other > data as when I open the DB with my tool in non admin mode. > > Is this normal? And if yes can I deactivate this? > > To be clear: > I start my DB tool normal (local user account) and open my DB > (c:\my.db3) I see only data entry A. > > If I open my DB tool with admin rights and open the same DB. > I only see data entry B. > > > Regards > > Steffen Mangold > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Different User different data
This has nothing to do with SQLite sadly, but still easy to fix. It's the WIndows UAC which is doing this to you, as it should for data that it tries to protect. I am guessing you have the DB in a protected location, such as somewhere within c:\Program Files\ or in c:\Windows\ or such... or in the actual same folder as the exe that you use. The UAC will then copy your file (at some initial point) to a substituted "Safe" folder and only edit that file, cleverly avoidining any system changes to the original by anyone, UNLESS of course, you start up Admin mode, in which case Windows no longer subjects your file to the protection, and allows you to edit/access it normally - BUT, this is now an entirely different file with entirely different content than the one in the "Safe" location. The "Safe" location should be somewhere inside c:\Users\YourUser\Appdata\Roaming\... etc (Just search for it from one of these base folders). Your "other" version of the file will be here. Now as to fixing it, well, that is easy too - just move the file to a non-protected place. My suggestion is of course the Appdata path itself, which windows will allow you to change most anything in without asking user permissions. My Documents is another option (but end-users usually fiddle there, so if this is a end-user type program, best not). You should never keep any config files or any files accessed by your program in the same folder as the exe or indeed any of the mentioned protected folders. (Standard Windows path-names exist for all users for all these special folders, easily accessible from the shell, just google it). Good luck! On 2013/07/03 23:41, Steffen Mangold wrote: Hi, I have some strainge behavior with a SQLIte DB. If I open the database with my DB tool with administrator right I see other data as when I open the DB with my tool in non admin mode. Is this normal? And if yes can I deactivate this? To be clear: I start my DB tool normal (local user account) and open my DB (c:\my.db3) I see only data entry A. If I open my DB tool with admin rights and open the same DB. I only see data entry B. Regards Steffen Mangold ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Different User different data
On 3 Jul 2013, at 10:41pm, Steffen Mangoldwrote: > I have some strainge behavior with a SQLIte DB. > If I open the database with my DB tool with administrator right I see other > data as when I open the DB with my tool in non admin mode. You’re probably opening two different database files in two different folders. Try specifying full paths using both tools. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Different User different data
Hi, I have some strainge behavior with a SQLIte DB. If I open the database with my DB tool with administrator right I see other data as when I open the DB with my tool in non admin mode. Is this normal? And if yes can I deactivate this? To be clear: I start my DB tool normal (local user account) and open my DB (c:\my.db3) I see only data entry A. If I open my DB tool with admin rights and open the same DB. I only see data entry B. Regards Steffen Mangold ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users