File: execute.cc

package info (click to toggle)
stealth 4.04.00-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,540 kB
  • sloc: cpp: 2,759; sh: 151; makefile: 111; ansic: 52
file content (28 lines) | stat: -rw-r--r-- 957 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "integrityscanner.ih"

                                        // receives the next command to execute
void IntegrityScanner::execute(string const &cmd)
{
    if (!(s_firstWord << cmd))          // determine first word and the rest
        fmsg << "Corrupt line in policy file: " << cmd << noidl; 
    else
        m1 << cmd << endl;
    
    if (s_firstWord[1] == "LABEL")      // set a label 
    {
        d_label = s_firstWord[3];       // the text beyond the LABEL keyword
        replace(d_label,          // change \\n into newlines
                        "\\n", "\n");   
    }
    else if (s_firstWord[1] == "LOCAL") // run a local command
        local(s_firstWord[3]);
    else if (s_firstWord[1] == "GET")   // get a file from the client
        get(cmd);
    else if (s_firstWord[1] == "PUT")   // put a file to the client
        put(cmd);
    else                                // or run a remote command
        remote(cmd);
}