OS Shell...

Hi!

I'm working on project that is going to be somekind of an Operating System Shell (like MS-DOS, BASH, etc...). Now I have a working version of the program, but there is a problem. Each user of the System belongs to a group. My program is supposed to separate the rights (like *nix OSs). This means that a user from "ROOT" group can start whatever command he wants. But a user from "GUEST" group can't do that. To make this work I used files (I called them group files) which contain all the commands that a user from that group can start. For example if we have the following group file: GUEST.GRP, and the file contains:

LS
DIR
MKDIR

this means that users from group GUEST can execute only these 3 commands. So far so good, but I think that this is not the way it should be done. So my question is:

Do you know how can I make different users execute different commands (separate the rights)?

Thanks in advance.
"Knowledge is power."

Comments

  • One way might be to have a file that contains all the commands and the groups that have permission to run them. For example:

    ls:root,guest
    dir:root




    : Hi!
    :
    : I'm working on project that is going to be somekind of an Operating System Shell (like MS-DOS, BASH, etc...). Now I have a working version of the program, but there is a problem. Each user of the System belongs to a group. My program is supposed to separate the rights (like *nix OSs). This means that a user from "ROOT" group can start whatever command he wants. But a user from "GUEST" group can't do that. To make this work I used files (I called them group files) which contain all the commands that a user from that group can start. For example if we have the following group file: GUEST.GRP, and the file contains:
    :
    : LS
    : DIR
    : MKDIR
    :
    : this means that users from group GUEST can execute only these 3 commands. So far so good, but I think that this is not the way it should be done. So my question is:
    :
    : Do you know how can I make different users execute different commands (separate the rights)?
    :
    : Thanks in advance.
    : "Knowledge is power."
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion