Welcome to Server Circle. It's a friendly site and all levels of experience are welcome. Be aware that we use cookies for your login.
Server Circle - Ask questions about Servers and get answers from experts.
Beta (0.03 sec)
Creating a mini CLI

I have been given a project by my teachers to make a mini cli. In which I have to create files folders and other stuff using that programme !

But the files or folders I create should not be visible or accesable without that programme ! They should not be visible from outside on the computer ! So what should i do ?

How would i start ? Please help and share ideas ! The programme is to be written in C++ :)
Asked by:
Aatif kiani
25 points
 Report Abuse
 Share Page - Category: Programming - Tags: Creating a mini CLI
 Enter your response
Please use Pastie.org to paste lengthy code or to fix formatting issues with code
  • Responses in reverse (7)

You can download source code of "ash" and modify by yourself

Response by:
jalal
3623 points
You can download document from http://www.linuxfromscratch.org/lfs/download.html

and read about shell

Response by:
mohamad_kian
1548 points
Gedge your answer also sounds quite professional!! :)

em in the start of this profession and in second semmester of my degree!!

actually em not clear about chrooted environment!!! and i hav to do that program in windows not using terminal!!!

em confused abt the environment of the program,,, how would i store the data in a file!!1 i cant store it in a real file!!! so should i store it in arrays like things??? :(

Response by:
Aatif kiani
25 points
I don't think chroot is the answer.

chroot stops those inside it from looking out (of the chroot'd tree), so any files/directories created in the chroot will be visible from outside the chroot (by the superuser, at least) - and I think the point is that the program is needed to see those files/dirs.

I suspect Aatif may want to create, say, a file which represents a virtual filesystem.

An example would be a 'dump' file - a file-based virtual filesystem that can be accessed using 'restore -i' (interactive, shell-like). Aatif probably has to design the format of the file and write the program to emulate an interactive 'restore' shell to access it.

Response by:
gedge
690 points
Yes, that's right.

Response by:
KiloKiki
654 points
That's a great help !

Using this jail can I create a text file and folders etc and it won't be not accessible from outside ?

Response by:
Aatif kiani
25 points
This might help. You could start by building the commands inside a chrooted environment.

A chroot just locks everything else out and you have to explicitly allow commands to be run (with your C program).

https://help.ubuntu.com/community/BasicChroot

http://www.kegel.com/cros ...


Response by:
KiloKiki
654 points


  • Related Questions
About Us : Contact Us : Etiquette : Terms : CDN Failover : ShorterURL : CDN Fallback : © 2013 Server Circle