943,699 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 2080
  • C RSS
Mar 18th, 2005
0

Program security (When Launched)

Expand Post »
I hope this makes sense... I made a program which requires authorization by username and password, once logged in it will allow you to load a program. My question is, is there a tutorial for the program being called to only open if it has been called by a certain program (Only a certain program can open it).

I was looking up google for tutorials and fstream, but I cannot find anything. Could someone please push me in the right direction?

Thanks in advance,
Rave
Similar Threads
Reputation Points: 11
Solved Threads: 1
Light Poster
Raven11 is offline Offline
36 posts
since Mar 2005
Mar 18th, 2005
0

Re: Program security (When Launched)

Off the top of my head I would say it's not easily possible unless you set up the calling program to run as a unique user. Then you could check to see what user owns your program's process (such as with ps) and terminate if it isn't the right one.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Mar 18th, 2005
0

Re: Program security (When Launched)

You could also use a pseudorandom number calculated by the same means on both the client and server programs. You could pass this via an IPC mechanicsm. Not exactly 'secure', but would keep anybody from randomly executing.

dale
Reputation Points: 10
Solved Threads: 0
Newbie Poster
hostmoon is offline Offline
19 posts
since Aug 2004
Mar 19th, 2005
0

Re: Program security (When Launched)

I have a idea that will work, once program A is open it will create a .bmp file with encrypted characters. The program B will search for this file and have the correct characters in it. If not it does not open.

However, I want to make it so when Program A is closed, the file is deleted (so program B wont run). How do I delete the bmp file after its been created?
Reputation Points: 11
Solved Threads: 1
Light Poster
Raven11 is offline Offline
36 posts
since Mar 2005
Mar 20th, 2005
0

Re: Program security (When Launched)

from google

http://www.computing.net/programming...rum/12045.html

  1.  
  2. #include <stdio.h>
  3.  
  4. if(remove("myfile.txt") == -1)
  5.  
  6. fprintf(stderr,"Remove failed");

apparently the remove() function is what you are after.

www.cplusplus.com might have a reference for this function
Reputation Points: 16
Solved Threads: 6
Posting Pro in Training
1o0oBhP is offline Offline
445 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Trouble with pointers in card game.
Next Thread in C Forum Timeline: Windows programming task





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC