http://qs321.pair.com?node_id=329295

sunadmn has asked for the wisdom of the Perl Monks concerning the following question:

Good morning evening afternoon fellow monks. I have been put to the task of writing a web based application that has a simple form that you enter a users username and then the action is to go from a Linux box to a NFS mounted Solaris T3 and query that users quota. Now I have a few issues here from what I have read and understand about Solaris quota system. First the issue is with a web based app is that our end users will have access to this page and I may just be a bit crazy, but you have to run the quota check as root with Solaris in order to get it to work. This seems like a big security hole to me but hey I am no security guy. Second issue is that Linux and Solaris dont play very well together when I try to get them to talk so I was thinkning of some sort of listening server mod etc. to listen for the call from the linux server and then run the quota check on the user and return the data, this is where I guess I need the most advice. If anyone has an idea no matter how large or small and would like to put an offering to a humble fellow monk please do.

SUNADMN
USE PERL
  • Comment on quota checking with Linux and Solaris??

Replies are listed 'Best First'.
Re: quota checking with Linux and Solaris??
by Abigail-II (Bishop) on Feb 16, 2004 at 15:34 UTC
    You can't just mount a filesystem and run a command to determine what the quota is, as set by the box the filesystem is from. That's not how things work.

    If you want to know the quota stats of user A on box B of filesystem C, you need to be on box B. Mounting filesystem C on system D isn't going to give you the answer.

    However, I don't see what this has to do with Perl.

    Abigail

      Abigail the perl portion of this is weather to use a small perl server i.e. Net::TCP::Server or some other varriant of a mod to bind to a port on the NFS server and listen for incoming requests for a quota check on a specfic user. This is where I get confused cause I am not exactly sure how to make this wrk correctly and feed back the info I get to the web server which is running on a Linux box. I hope this helps clear up any confusion as to what I am indeed asking for advice on.
        You could indeed set up a TCP client/server model. The server could be stand alone, or be run from inetd. You could use a model where you make a connection for reach request, or you could have a permanent connection. You could use UDP for communication as well. Or you could create a file or database with all the quota information, which you update from the NFS server once every hour/day/week/whatever, and consult from the webserver side. Yet another possibility is to forget the entire web thing, and have people just type 'quota' on the box itself - after all, if they don't have access to the box, it doesn't matter what their quota is.

        That's a decision you have to make, and what is the right decision depends on many things. But one thing that hardly plays a role in which solution you are going to take is the language in which the solution will be written.

        Abigail (wondering why someone wants to make an HTTP request to box A, just to get the quota information on box B.)

Re: quota checking with Linux and Solaris??
by coreolyn (Parson) on Feb 16, 2004 at 14:59 UTC

    You should look into utilizing sudo to somewhat mitigate the risks associated with use of root.

      I have tried the sudo method also and the biggest issue is that Linux and Solaris wont talk so this is why I need some sort of MOD or other small server that will listen on a certain port and then run the quota check.
        what do you mean by Solaris and Linux will not talk? Take a look under abigail's post to see what I would do instead of a homebrew service running on the nfs server. pushing the data out to a db from cron opens less of a hole on the nfs server than a homebrew tcp server.


        -Waswas
Re: quota checking with Linux and Solaris??
by coreolyn (Parson) on Feb 16, 2004 at 15:37 UTC

    Not sure if this might help in your endeavor but quota might be of assistance.

Re: quota checking with Linux and Solaris??
by JSchmitz (Canon) on Oct 18, 2004 at 20:40 UTC
    hmm a T3 is a storage device not a server....