OSSP CVS Repository

ossp - Check-in [1761]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1761
Date: 2002-Jan-31 17:38:01 (local)
2002-Jan-31 16:38:01 (UTC)
User:ms
Branch:
Comment: Add 'error' section for generic rcfile error handling. Add 'default' section (modeled after the 'switch' C statement) for user-level processing in case a section label is missing. Please review.

PR: Submitted by: Reviewed by: Approved by: Obtained from:

Tickets:
Inspections:
Files:
ossp-pkg/rc/rc.example      1.4 -> 1.5     62 inserted, 0 deleted

ossp-pkg/rc/rc.example 1.4 -> 1.5

--- rc.example   2002/01/31 16:31:24     1.4
+++ rc.example   2002/01/31 16:38:01     1.5
@@ -44,6 +44,20 @@
 %status -c /usr/bin/perl
     print STDERR "Sftpd status report";
     for ...
+
+%error # We have a rc (not user-level) error
+# Very rough representation of built-in rc language
+    +syslogit DAEMON CRITICAL;
+    +if ${sftpd_error}
+        +outconsole ${sftpd_error};
+    +outconsole "Runcommand-level error in line ";
+    +lineno SCRIPT; # Not +lineno ABSOLUTE;
+    +outconsole " of rcfile ";
+    +rcfilename;
+
+%default # Gets hit if no other section label matches
+    $HOME/bin/popup "Missing section in rc.sftpd!" # Run custom app
+    @error  # Reference to error section
 # End stock syntax example rcfile
 
 
@@ -75,6 +89,20 @@
 !printstat -c /usr/bin/perl
     print STDERR "Sftpd status report";
     for ...
+
+!problem # We have a rc (not user-level) error
+# Very rough representation of built-in rc language
+    +syslogit DAEMON CRITICAL;
+    +if ${sftpd_error}
+        +outconsole ${sftpd_error};
+    +outconsole "Runcommand-level error in line ";
+    +lineno SCRIPT; # Not +lineno ABSOLUTE;
+    +outconsole " of rcfile ";
+    +rcfilename;
+
+!missing # Gets hit if no other section label matches
+    $HOME/bin/popup "Missing section in rc.sftpd!" # Run custom app
+    @error  # Reference to error section
 # End custom syntax example rcfile
 
 
@@ -113,6 +141,22 @@
     print STDERR "Sftpd status report";
     for ...
 </status>
+
+<error> # We have a rc (not user-level) error
+# Very rough representation of built-in rc language
+    +syslogit DAEMON CRITICAL;
+    +if ${sftpd_error}
+        +outconsole ${sftpd_error};
+    +outconsole "Runcommand-level error in line ";
+    +lineno SCRIPT; # Not +lineno ABSOLUTE;
+    +outconsole " of rcfile ";
+    +rcfilename;
+</error>
+
+<default> # Gets hit if no other section label matches
+    $HOME/bin/popup "Missing section in rc.sftpd!" # Run custom app
+    <refer name=error>  # Reference to error section
+</default>
 # End XML-like syntax example rcfile
 
 
@@ -171,4 +215,22 @@
         print STDERR "Sftpd status report";
         for ...
     END
+
+error ERROR # We have a rc (not user-level) error
+# Very rough representation of built-in rc language
+    BEGIN
+        +syslogit DAEMON CRITICAL;
+        +if ${sftpd_error}
+            +outconsole ${sftpd_error};
+        +outconsole "Runcommand-level error in line ";
+        +lineno SCRIPT; # Not +lineno ABSOLUTE;
+        +outconsole " of rcfile ";
+        +rcfilename;
+    END
+
+default DEFAULT # Gets hit if no other section label matches
+    BEGIN
+        $HOME/bin/popup "Missing section in rc.sftpd!" # Run custom app
+        error REFER # Reference to error section
+    END
 # End ASN.1-like syntax example rcfile

CVSTrac 2.0.1