/[monit]/monit/p.y
ViewVC logotype

Diff of /monit/p.y

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.28 by martinp, Thu Oct 31 11:41:31 2002 UTC revision 1.29 by chopp, Sat Nov 2 10:47:22 2002 UTC
# Line 326  pemfile         : PEMFILE PATH { Run.htt Line 326  pemfile         : PEMFILE PATH { Run.htt
326                  ;                  ;
327    
328  clientpemfile   : /* EMPTY */ { Run.httpsslclientpem= NULL; }  clientpemfile   : /* EMPTY */ { Run.httpsslclientpem= NULL; }
329                  | CLIENTPEMFILE PATH { Run.httpsslclientpem= $2; }                  | CLIENTPEMFILE PATH { Run.httpsslclientpem= $2;
330                                           Run.clientssl= TRUE; }
331                  ;                  ;
332    
333  allowselfcert   : /* EMPTY */ { Run.allowselfcert= FALSE; }  allowselfcert   : /* EMPTY */ { Run.allowselfcert= FALSE; }
# Line 381  unixsocket      : UNIXSOCKET PATH { Line 382  unixsocket      : UNIXSOCKET PATH {
382                  ;                  ;
383    
384  type            : /* EMPTY */ { portset.type= SOCK_STREAM; }  type            : /* EMPTY */ { portset.type= SOCK_STREAM; }
385                  | TYPE TCP    { portset.type= SOCK_STREAM;  }                  | TYPE TCP    { portset.type= SOCK_STREAM;  
386                                    Run.servicessl= TRUE; }
387                  | TYPE TCPSSL certmd5 { portset.type= SOCK_STREAM;                  | TYPE TCPSSL certmd5 { portset.type= SOCK_STREAM;
388                                          portset.ssl= TRUE; }                                          portset.ssl= TRUE; }
389                  | TYPE UDP    { portset.type= SOCK_DGRAM; }                  | TYPE UDP    { portset.type= SOCK_DGRAM; }
# Line 544  resourceaction  : ALERT { resourceset.ac Line 546  resourceaction  : ALERT { resourceset.ac
546   */   */
547  void yyerror(const char *msg) {  void yyerror(const char *msg) {
548    
549      ASSERT(msg);
550    
551    error("%s: %s '%s' at line %d\n", prog, msg, yytext, lineno );    error("%s: %s '%s' at line %d\n", prog, msg, yytext, lineno );
552    cfg_errflag++;    cfg_errflag++;
553    
# Line 556  void yyerror(const char *msg) { Line 560  void yyerror(const char *msg) {
560   */   */
561  int parse(char *controlfile) {  int parse(char *controlfile) {
562    
563      ASSERT(controlfile);
564    
565    processlist= tail= current= NULL;    processlist= tail= current= NULL;
566        
567    if(! check_rcfile(controlfile)) {    if(! check_rcfile(controlfile)) {
# Line 607  static void initialize() { Line 613  static void initialize() {
613    Run.dolog= FALSE;    Run.dolog= FALSE;
614    Run.dohttpd= FALSE;    Run.dohttpd= FALSE;
615    Run.Auth.defined= FALSE;    Run.Auth.defined= FALSE;
616      Run.servicessl= FALSE;
617      Run.clientssl= FALSE;
618    reset_runmail();    reset_runmail();
619    if(Run.bind_addr) {    if(Run.bind_addr) {
620      free(Run.bind_addr);      free(Run.bind_addr);
# Line 623  static void initialize() { Line 631  static void initialize() {
631   */   */
632  static void createprocess(char *name, char *pidfile) {  static void createprocess(char *name, char *pidfile) {
633    
634      ASSERT(name);
635      ASSERT(pidfile);
636    
637    if ( current ) {    if ( current ) {
638    
639      createprocinfo();      createprocinfo();
# Line 681  static void adddependant(char *dependant Line 692  static void adddependant(char *dependant
692    
693    Dependant_T d= NEW(d);    Dependant_T d= NEW(d);
694    
695      ASSERT(dependant);
696    
697    if (current->dependantlist != NULL) {    if (current->dependantlist != NULL) {
698      d->next= current->dependantlist;      d->next= current->dependantlist;
699    }    }
# Line 698  static void addchecksum(char *filename, Line 711  static void addchecksum(char *filename,
711    
712    Checksum_T c= NEW(c);    Checksum_T c= NEW(c);
713    
714      ASSERT(filename);
715    
716    c->file= filename;    c->file= filename;
717        
718    if ( sum ) {    if ( sum ) {
# Line 735  static void addmail(char *mailto, struct Line 750  static void addmail(char *mailto, struct
750    
751    Mail_T m= NEW(m);    Mail_T m= NEW(m);
752    
753      ASSERT(mailto);
754    
755    if ( f->timeout || f->restart || f->checksum ) {    if ( f->timeout || f->restart || f->checksum ) {
756            
757      m->alert_on_timeout= f->timeout;      m->alert_on_timeout= f->timeout;
# Line 775  static void addport(struct PortSet *pp) Line 792  static void addport(struct PortSet *pp)
792    char address[STRLEN];    char address[STRLEN];
793    Port_T p= NEW(p);    Port_T p= NEW(p);
794    
795      ASSERT(pp);
796    
797    p->socket= pp->socket;    p->socket= pp->socket;
798    p->hostname= pp->hostname;    p->hostname= pp->hostname;
799    p->port= pp->port;    p->port= pp->port;
# Line 835  static void addresource(struct ResourceS Line 854  static void addresource(struct ResourceS
854    
855    Resource_T r= NEW(r);    Resource_T r= NEW(r);
856    
857      ASSERT(rr);
858    
859    if ( ! Run.doprocess ) {    if ( ! Run.doprocess ) {
860    
861      error("%s: Cannot activate process check at line %d\n"      error("%s: Cannot activate process check at line %d\n"
# Line 923  static void addcommand(int what) { Line 944  static void addcommand(int what) {
944   */   */
945  static void addargument(char *argument) {  static void addargument(char *argument) {
946    
947      ASSERT(argument);
948    
949    if(! command) {    if(! command) {
950            
951      command= NEW(command);      command= NEW(command);
# Line 971  static void setlogfile(char *logfile) { Line 994  static void setlogfile(char *logfile) {
994   */   */
995  static void setmailserver(char *mailserver) {  static void setmailserver(char *mailserver) {
996    
997      ASSERT(mailserver);
998    
999    if ( Run.mailserver ) {    if ( Run.mailserver ) {
1000            
1001      if ( is(Run.mailserver, mailserver) ) {      if ( is(Run.mailserver, mailserver) ) {
# Line 994  static void setmailserver(char *mailserv Line 1019  static void setmailserver(char *mailserv
1019   */   */
1020  static void setuname(char *uname) {  static void setuname(char *uname) {
1021    
1022      ASSERT(uname);
1023    
1024    if ( Run.Auth.uname ) {    if ( Run.Auth.uname ) {
1025            
1026      if ( is(Run.Auth.uname, uname) ) {      if ( is(Run.Auth.uname, uname) ) {
# Line 1017  static void setuname(char *uname) { Line 1044  static void setuname(char *uname) {
1044   */   */
1045  static void setpasswd(char *passwd) {  static void setpasswd(char *passwd) {
1046    
1047      ASSERT(passwd);
1048    
1049    if ( Run.Auth.passwd ) {    if ( Run.Auth.passwd ) {
1050            
1051      if ( is(Run.Auth.passwd, passwd) ) {      if ( is(Run.Auth.passwd, passwd) ) {
# Line 1108  static void reset_runmail() { Line 1137  static void reset_runmail() {
1137   */   */
1138  static void check_name(char *name) {  static void check_name(char *name) {
1139    
1140      ASSERT(name);
1141    
1142    if ( exist_process(name) ) {    if ( exist_process(name) ) {
1143            
1144      error("%s: Name conflict at line %d - check name '%s' already defined\n",      error("%s: Name conflict at line %d - check name '%s' already defined\n",
# Line 1159  static void check_every(int every) { Line 1190  static void check_every(int every) {
1190   */   */
1191  static void check_hostname(char *hostname) {  static void check_hostname(char *hostname) {
1192    
1193      ASSERT(hostname);
1194    
1195    if ( !check_host(hostname) ) {    if ( !check_host(hostname) ) {
1196            
1197      yyerror("Hostname did not resolve");      yyerror("Hostname did not resolve");
# Line 1179  static char *append_hostname(char *addr) Line 1212  static char *append_hostname(char *addr)
1212    char buf[STRLEN];    char buf[STRLEN];
1213    char * fulladdr;    char * fulladdr;
1214    
1215      ASSERT(addr);
1216    
1217    if (gethostname(buf, STRLEN) != 0) {    if (gethostname(buf, STRLEN) != 0) {
1218       yyerror("Cannot find hostname for mailaddress");       yyerror("Cannot find hostname for mailaddress");
1219    }    }
# Line 1199  static void cleanup_md5_string(char *md5 Line 1234  static void cleanup_md5_string(char *md5
1234    
1235    int i= 0, j= 0;    int i= 0, j= 0;
1236    
1237    if (md5string == NULL) {    ASSERT(md5string);
   
     return;  
   
   }  
   
1238    
1239    while (md5string[i] != '\0') {    while (md5string[i] != '\0') {
1240    

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26