Replace SYSLOG_DEBUG constant with LOG_DEBUG
This commit is contained in:
		
							parent
							
								
									6b03dd0ebd
								
							
						
					
					
						commit
						d8f6dd3b5e
					
				
					 1 changed files with 19 additions and 20 deletions
				
			
		
							
								
								
									
										39
									
								
								timeoutd.c
									
										
									
									
									
								
							
							
						
						
									
										39
									
								
								timeoutd.c
									
										
									
									
									
								
							|  | @ -55,7 +55,6 @@ | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #define OPENLOG_FLAGS	LOG_CONS|LOG_PID | #define OPENLOG_FLAGS	LOG_CONS|LOG_PID | ||||||
| #define SYSLOG_DEBUG	LOG_DEBUG |  | ||||||
| 
 | 
 | ||||||
| #ifndef CONFIG | #ifndef CONFIG | ||||||
| #define CONFIG "/etc/timeouts" | #define CONFIG "/etc/timeouts" | ||||||
|  | @ -206,7 +205,7 @@ char *argv[]; | ||||||
|     /* This is a bit of a shameless hack, but, well, it works. */ |     /* This is a bit of a shameless hack, but, well, it works. */ | ||||||
|     if (argc == 3) { |     if (argc == 3) { | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|         syslog(SYSLOG_DEBUG, "Running in user check mode.  Checking user %s on %s.", argv[1], |         syslog(LOG_DEBUG, "Running in user check mode.  Checking user %s on %s.", argv[1], | ||||||
|                argv[2]); |                argv[2]); | ||||||
| #endif | #endif | ||||||
|         strncpy(dev, argv[2], sizeof(dev) - 1); |         strncpy(dev, argv[2], sizeof(dev) - 1); | ||||||
|  | @ -231,7 +230,7 @@ char *argv[]; | ||||||
|             exit(20); |             exit(20); | ||||||
|         case ACTIVE: |         case ACTIVE: | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|             syslog(SYSLOG_DEBUG, "User %s on %s passed login check.", argv[1], argv[2]); |             syslog(LOG_DEBUG, "User %s on %s passed login check.", argv[1], argv[2]); | ||||||
| #endif | #endif | ||||||
|             free_wtmp(); |             free_wtmp(); | ||||||
|             exit(0); |             exit(0); | ||||||
|  | @ -288,7 +287,7 @@ char *argv[]; | ||||||
|         read_wtmp();            /* Read in today's wtmp entries */ |         read_wtmp();            /* Read in today's wtmp entries */ | ||||||
|         setutent(); |         setutent(); | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|         syslog(SYSLOG_DEBUG, "Time to check utmp for exceeded limits."); |         syslog(LOG_DEBUG, "Time to check utmp for exceeded limits."); | ||||||
| #endif | #endif | ||||||
|         while ((utmpp = getutent()) != (struct utmp *) NULL) |         while ((utmpp = getutent()) != (struct utmp *) NULL) | ||||||
|             check_idle(); |             check_idle(); | ||||||
|  | @ -297,7 +296,7 @@ char *argv[]; | ||||||
|         if (pending_reread) |         if (pending_reread) | ||||||
|             reread_config(SIGHUP); |             reread_config(SIGHUP); | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|         syslog(SYSLOG_DEBUG, "Finished checking utmp... sleeping for 1 minute."); |         syslog(LOG_DEBUG, "Finished checking utmp... sleeping for 1 minute."); | ||||||
| #endif | #endif | ||||||
|         sleep(60); |         sleep(60); | ||||||
|     } |     } | ||||||
|  | @ -313,14 +312,14 @@ void read_wtmp() | ||||||
|     struct tm *tm; |     struct tm *tm; | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|     syslog(SYSLOG_DEBUG, "Reading today's wtmp entries."); |     syslog(LOG_DEBUG, "Reading today's wtmp entries."); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|     if ((fp = fopen(WTMP_FILE, "r")) == NULL) |     if ((fp = fopen(WTMP_FILE, "r")) == NULL) | ||||||
|         bailout("Could not open wtmp file!", 1); |         bailout("Could not open wtmp file!", 1); | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|     syslog(SYSLOG_DEBUG, "Seek to end of wtmp"); |     syslog(LOG_DEBUG, "Seek to end of wtmp"); | ||||||
| #endif | #endif | ||||||
|     /* Go to end of file minus one structure */ |     /* Go to end of file minus one structure */ | ||||||
|     fseek(fp, -1L * sizeof(struct utmp), SEEK_END); |     fseek(fp, -1L * sizeof(struct utmp), SEEK_END); | ||||||
|  | @ -351,7 +350,7 @@ void read_wtmp() | ||||||
|     } |     } | ||||||
|     fclose(fp); |     fclose(fp); | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|     syslog(SYSLOG_DEBUG, "Finished reading today's wtmp entries."); |     syslog(LOG_DEBUG, "Finished reading today's wtmp entries."); | ||||||
| #endif | #endif | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -361,7 +360,7 @@ void free_wtmp() | ||||||
| { | { | ||||||
|     struct ut_list *ut_list_p; |     struct ut_list *ut_list_p; | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|     syslog(SYSLOG_DEBUG, "Freeing list of today's wtmp entries."); |     syslog(LOG_DEBUG, "Freeing list of today's wtmp entries."); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|     while (wtmplist) { |     while (wtmplist) { | ||||||
|  | @ -378,7 +377,7 @@ void free_wtmp() | ||||||
|         free(ut_list_p); |         free(ut_list_p); | ||||||
|     } |     } | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|     syslog(SYSLOG_DEBUG, "Finished freeing list of today's wtmp entries."); |     syslog(LOG_DEBUG, "Finished freeing list of today's wtmp entries."); | ||||||
| #endif | #endif | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -714,12 +713,12 @@ char *host; | ||||||
|     char cmdbuf[1024]; |     char cmdbuf[1024]; | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|     syslog(SYSLOG_DEBUG, "Warning %s@%s on %s of pending logoff in %d minutes.", user, host, tty, |     syslog(LOG_DEBUG, "Warning %s@%s on %s of pending logoff in %d minutes.", user, host, tty, | ||||||
|            time_remaining); |            time_remaining); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|     if (chk_xsession(tty, host)) { |     if (chk_xsession(tty, host)) { | ||||||
|         syslog(SYSLOG_DEBUG, |         syslog(LOG_DEBUG, | ||||||
|                "Warning %s running X on %s for pending logout! (%d min%s left)", |                "Warning %s running X on %s for pending logout! (%d min%s left)", | ||||||
|                user, tty, time_remaining, time_remaining == 1 ? "" : "s"); |                user, tty, time_remaining, time_remaining == 1 ? "" : "s"); | ||||||
| 
 | 
 | ||||||
|  | @ -730,9 +729,9 @@ char *host; | ||||||
|                 user, host, time_remaining, time_remaining == 1 ? "" : "s", |                 user, host, time_remaining, time_remaining == 1 ? "" : "s", | ||||||
|                 limit_names[limit_type]); |                 limit_names[limit_type]); | ||||||
|         system(cmdbuf); |         system(cmdbuf); | ||||||
|         /*#ifdef DEBUG */ | #ifdef DEBUG | ||||||
|         syslog(LOG_DEBUG, "cmdbuf=%s", cmdbuf); |         syslog(LOG_DEBUG, "cmdbuf=%s", cmdbuf); | ||||||
|         /*#endif */ | #endif | ||||||
|         sleep(KWAIT);           /* and give the user some time to read the message ;) */ |         sleep(KWAIT);           /* and give the user some time to read the message ;) */ | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|  | @ -778,7 +777,7 @@ int session; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|     syslog(SYSLOG_DEBUG, "Checking user %s group %s tty %s.", user, gr->gr_name, tty); |     syslog(LOG_DEBUG, "Checking user %s group %s tty %s.", user, gr->gr_name, tty); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| /* Check to see if current user matches any entry based on tty/user/group */ | /* Check to see if current user matches any entry based on tty/user/group */ | ||||||
|  | @ -801,8 +800,8 @@ int session; | ||||||
|         if (timematch && ttymatch && usermatch && groupmatch) { |         if (timematch && ttymatch && usermatch && groupmatch) { | ||||||
|             get_day_time(user); |             get_day_time(user); | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|             syslog(SYSLOG_DEBUG, "Matched entry %d", configline); |             syslog(LOG_DEBUG, "Matched entry %d", configline); | ||||||
|             syslog(SYSLOG_DEBUG, |             syslog(LOG_DEBUG, | ||||||
|                    "Idle=%d (max=%d) Sess=%d (max=%d) Daily=%d (max=%d) warntime=%d", |                    "Idle=%d (max=%d) Sess=%d (max=%d) Daily=%d (max=%d) warntime=%d", | ||||||
|                    idle, config[configline]->idlemax, session, |                    idle, config[configline]->idlemax, session, | ||||||
|                    config[configline]->sessmax, daytime, config[configline]->daymax, |                    config[configline]->sessmax, daytime, config[configline]->daymax, | ||||||
|  | @ -878,7 +877,7 @@ void check_idle() | ||||||
| 
 | 
 | ||||||
|     if (aktconfigline > 0) {    /* > 0 if user is not in config */ |     if (aktconfigline > 0) {    /* > 0 if user is not in config */ | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|         syslog(SYSLOG_DEBUG, "User %s or * not in config -> No restrictions. Not checking %s on %s", |         syslog(LOG_DEBUG, "User %s or * not in config -> No restrictions. Not checking %s on %s", | ||||||
|                user, user, dev); |                user, user, dev); | ||||||
| #endif | #endif | ||||||
|         return;                 /* now, we return because the user beeing checked is not in config, so he has no restrictions */ |         return;                 /* now, we return because the user beeing checked is not in config, so he has no restrictions */ | ||||||
|  | @ -903,7 +902,7 @@ void check_idle() | ||||||
| #ifdef TIMEOUTDX11 | #ifdef TIMEOUTDX11 | ||||||
|     if (chk_xsession(dev, host) && !chk_xterm(dev, host)) {     /* check idle for Xsession, but not for xterm */ |     if (chk_xsession(dev, host) && !chk_xterm(dev, host)) {     /* check idle for Xsession, but not for xterm */ | ||||||
|         idle = get_xidle(user, host) / 1000 / 60;       /* get_xidle returns millisecs, we need mins */ |         idle = get_xidle(user, host) / 1000 / 60;       /* get_xidle returns millisecs, we need mins */ | ||||||
|         syslog(SYSLOG_DEBUG, "get_xidle(%s,%s) returned %d mins idle for %s.", dev, host, |         syslog(LOG_DEBUG, "get_xidle(%s,%s) returned %d mins idle for %s.", dev, host, | ||||||
|                (int) idle, user); |                (int) idle, user); | ||||||
|     } else if (chk_xterm(dev, host)) |     } else if (chk_xterm(dev, host)) | ||||||
|         return; |         return; | ||||||
|  | @ -915,7 +914,7 @@ void check_idle() | ||||||
|     switch (chk_timeout(user, dev, host, idle, sesstime)) { |     switch (chk_timeout(user, dev, host, idle, sesstime)) { | ||||||
|     case ACTIVE: |     case ACTIVE: | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
|         syslog(SYSLOG_DEBUG, "User %s is active.", user); |         syslog(LOG_DEBUG, "User %s is active.", user); | ||||||
| #endif | #endif | ||||||
|         break; |         break; | ||||||
|     case IDLEMAX: |     case IDLEMAX: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Petar Kapris
						Petar Kapris