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

Diff of /monit/p.y

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

revision 1.112 by martinp, Fri Aug 15 19:08:43 2003 UTC revision 1.113 by hauk, Sun Aug 17 23:03:42 2003 UTC
# Line 248  Line 248 
248    static void  check_hostname (char *);    static void  check_hostname (char *);
249    static void  check_exec(char *);    static void  check_exec(char *);
250    static void  createinfo();    static void  createinfo();
   static char *append_hostname(char *);  
251    static void  cleanup_md5_string(char *);    static void  cleanup_md5_string(char *);
252    static void  check_depend();    static void  check_depend();
253    static void  order_depend(Service_T);    static void  order_depend(Service_T);
# Line 686  alert           : alertmail '{' eventopt Line 685  alert           : alertmail '{' eventopt
685                  ;                  ;
686    
687  alertmail       : ALERT MAILADDR { $<string>$= $2; }  alertmail       : ALERT MAILADDR { $<string>$= $2; }
                 | ALERT STRING { $<string>$= append_hostname($2); }  
688                  ;                  ;
689    
690  eventoptionlist : eventoption  eventoptionlist : eventoption
# Line 2153  static void check_exec(char *exec) { Line 2151  static void check_exec(char *exec) {
2151    
2152    
2153  /*  /*
  * Create a real email address from a username  
  */  
 static char *append_hostname(char *addr) {  
   
   char buf[STRLEN];  
   char * fulladdr;  
   
   ASSERT(addr);  
   
   if (gethostname(buf, STRLEN) != 0) {  
      yyerror("Cannot find hostname for mailaddress");  
   }  
   
   fulladdr = xresize(addr, strlen(buf)+1);  
   strcat(fulladdr, "@");  
   strcat(fulladdr, buf);  
   
   return fulladdr;  
   
 }  
   
   
 /*  
2154   * Cleans up an md5 string, tolower and remove byte sperators   * Cleans up an md5 string, tolower and remove byte sperators
2155   */   */
2156  static void cleanup_md5_string(char *md5string) {  static void cleanup_md5_string(char *md5string) {

Legend:
Removed from v.1.112  
changed lines
  Added in v.1.113

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