User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 397,898 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,653 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
Views: 1579 | Replies: 4
Reply
Join Date: Mar 2005
Posts: 36
Reputation: Raven11 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
Raven11 Raven11 is offline Offline
Light Poster

Program security (When Launched)

  #1  
Mar 18th, 2005
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2004
Posts: 6,050
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 26
Solved Threads: 416
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: Program security (When Launched)

  #2  
Mar 18th, 2005
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.
Member of: Beautiful Code Club.
Reply With Quote  
Join Date: Aug 2004
Location: Virginia Beach, VA
Posts: 19
Reputation: hostmoon is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
hostmoon hostmoon is offline Offline
Newbie Poster

Re: Program security (When Launched)

  #3  
Mar 18th, 2005
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
Reply With Quote  
Join Date: Mar 2005
Posts: 36
Reputation: Raven11 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
Raven11 Raven11 is offline Offline
Light Poster

Re: Program security (When Launched)

  #4  
Mar 19th, 2005
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?
Reply With Quote  
Join Date: Dec 2004
Location: Devon - UK
Posts: 420
Reputation: 1o0oBhP is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
1o0oBhP's Avatar
1o0oBhP 1o0oBhP is offline Offline
Posting Pro in Training

Re: Program security (When Launched)

  #5  
Mar 20th, 2005
from google

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

#include <stdio.h>

if(remove("myfile.txt") == -1)

    fprintf(stderr,"Remove failed");

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

www.cplusplus.com might have a reference for this function
http://sales.carina-e.com

no www
no nonsense

coming soon to a pc near you! :cool:
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C Forum

All times are GMT -4. The time now is 10:07 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC