[TriLUG] Yet another c++ question

Josh Vickery vickeryj at gmail.com
Tue Nov 15 11:29:59 EST 2005


Well, the registry isn't really secure in any way, but sticking a key
in the registry does put it out of the way of the casual user.

You could do much the same thing with a file on linux by putting it in
a special directory with carefully controlled permissions.

The simplest solution I can come up with would be to put the file in
directory at the root of the fs, and set the permissions on the file
and directory to be only readable and writable by a single user.  You
could then chown your program that that user and set the uid bit. 
That way, the only access to the ID file would be through your
program.\

Josh

On 11/15/05, Mark Freeze <mfreeze at gmail.com> wrote:
> I do store my records in a SQLServer database that I am going to be
> moving to MySql.  Thanks for the info on the Oracle system.  That may
> influence my databasing decisions when I get to that step.
>
> I think Phillip has hit a little closer to what I am looking for, but
> I still was looking for a different solution.
>
> My Windows system has a key stored in the registry with one value.
> Which lets say for examples sake is 16E360. (Or 1.5 million.)  My VB
> program would get this value and then assign my first record the
> unique key of 16E361, then the next 16E262, etc... until the program
> gets to the eof of the text file currently being processed.  At eof,
> the VB program writes the last assigned keys value back to the
> registry to wait until the program needs more unique values. This week
> I processed 149,893 records, so the registry value would now be
> 192CE5.
>
> I know Linux doesn't have a registry so I am looking for a more secure
> way of keeping track of this value other than just writing it to a
> file somewhere on the disk.  If writing this value to a file is the
> only way to keep track of it, what are some methods that I could
> employ to secure the file so that it is not deleted, lost,
> overwritten, or tampered with but still remains open enough where any
> user could run the program?
>
> Thanks,
> Mark.
>
>
> On 11/15/05, Dave Sorenson <dave at logicalgeek.com> wrote:
> > I second the database idea. Having the registry hold mission critical
> > data would scare the bejebus outta me seeing how often my windows gaming
> > box decides to scramble its registry. Databases are made for this and
> > even MySQL could handle a million or 2 statements without too much
> > trouble. Oracle has released 10g in a no cost form, some restriction
> > apply, but it might work well as well. See:
> > http://www.oracle.com/corporate/press/2005_oct/103105_databasexe_finalsite.html.
> > I'm going to be installing on my test server and play with it and see if
> > it can be useful.
> >
> > Dave S.
> >
> > Phillip Rhodes wrote:
> > > On 11/15/05, Mark Freeze <mfreeze at gmail.com> wrote:
> > >
> > >> My question is this: What would be the best way on a Linux system to
> > >> keep track of this unique key identifier? Or is there a better way to
> > >> accomplish this task? I chose to write it to the Windows registry with
> > >> VB so it wouldn't get deleted from the disk, it was not easily
> > >> tampered with by users of the program, and really, it was just one
> > >> less file that I had to keep up with. Having the key off by even one
> > >> record could potentially catastrophic. I keep these files forever and
> > >> I process and print around 1 million statements per month.
> > >>
> > >
> > >
> > > I probably just don't understand your process well enough to comment,
> > > but it seems to me like it might be easier to just pump the data into
> > > an RDBMS as step 1 and then rely on the facilities the RDBMS
> > > provides for doing a lot of this other stuff... Is there a specific reason
> > > why that isn't an option?
> > >
> > > Failing that, Linux has no registry per se, so you'd probably just have
> > > to write your key values out to a file somewhere, or store the keys in an
> > > RDBMS.
> > >
> > >
> > > TTYL,
> > >
> > > Phil
> > >
> > --
> > TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ  : http://trilug.org/faq/
> > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> >
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
>



More information about the TriLUG mailing list