On Fri, May 30, 2003 at 04:12:24PM +0200, Michel Arboi wrote:

> No. But the change would be trivial.

Here are revised patches to libnasl/nasl/exec.c and libnasl/nasl/nasl.c
against nessus 2.0.6a.  These fix an error loading the libnasl
shared library when starting the nessus daemon that my earlier patches
introduced.


George
-- 
[EMAIL PROTECTED]
--- exec.c.orig Wed May 21 10:40:10 2003
+++ exec.c      Sat May 31 08:06:18 2003
@@ -45,6 +45,8 @@
 #define NASL_DEBUG 0
 #endif
 
+int parse_only = 0;
+
 int
 cell2bool(lex_ctxt* lexic, tree_cell* c)
 {
@@ -1680,6 +1682,13 @@
 #endif
  lexic = init_empty_lex_ctxt();
  lexic->script_infos = script_infos;
+ if (parse_only != 0)
+   {
+     nasl_perror(lexic, "\nParsing completed\n");
+     nasl_clean_ctx(&ctx);
+     chdir(old_dir);
+     return 0;
+   }
  
  str = arg_get_value(prefs, "checks_read_timeout");
  if( str != NULL )
--- nasl.c.orig Mon Apr  7 06:16:25 2003
+++ nasl.c      Sat May 31 08:06:18 2003
@@ -55,6 +55,7 @@
 void exit_nasl(struct arglist *, int);
 
 
+extern int parse_only;
 int safe_checks_only = 0;
 
 static struct arglist * 
@@ -109,8 +110,9 @@
 {
  printf("\nnasl -- Copyright (C) 1999 - 2003 Renaud Deraison <[EMAIL PROTECTED]>\n");
  printf("nasl -- Copyright (C) 2002 - 2003 Michel Arboi <[EMAIL PROTECTED]>\n\n");
- printf("Usage : nasl [-vh] [ -t target ] [-T trace_file] script_file ...\n");
+ printf("Usage : nasl [-vh] [-p] [ -t target ] [-T trace_file] script_file ...\n");
  printf("\t-h : shows this help screen\n");
+ printf("\t-p : just parse the script\n");
  printf("\t-t target : Execute the scripts against the target(s) host\n");
  printf("\t-T file : Trace actions into the file (or '-' for stderr)\n");
  printf("\t-s : specifies that the script should be run with 'safe checks' 
enabled\n");
@@ -136,7 +138,7 @@
        Command-line options
   ---------------------------------------------*/
   
- while((i = getopt(argc, argv, "hvt:k:T:s"))!=EOF)
+ while((i = getopt(argc, argv, "hpvt:k:T:s"))!=EOF)
   switch(i)
   {
    case 't' :
@@ -172,6 +174,9 @@
                usage();
                exit(0);
                }
+       break;
+ case 'p' :
+       parse_only ++;
        break;
  case 'v' :
        printf("nasl %s\n\n", nasl_version());

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to