Changeset 235 for ksyslog/trunk/ksyslog.c
- Timestamp:
- 09/30/13 03:39:55 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ksyslog/trunk/ksyslog.c
r234 r235 128 128 { 129 129 struct ksyslog_entry *entry; 130 unsigned int facility, severity; 131 unsigned char priority, *start; 130 unsigned int priority, facility, severity, month, day, hour, minute, second; 131 unsigned char *start, month_s[4]; 132 struct tm tm; 132 133 int length, i; 133 134 134 if (sscanf(skb->data, "<%3hhu>", &priority) != 1) 135 if (sscanf(skb->data, "<%3u>%3s %2u %2u:%2u:%2u ", 136 &priority, month_s, &day, &hour, &minute, &second) != 6) 135 137 return ERR_PTR(-EINVAL); 136 138 … … 146 148 return ERR_PTR(-EINVAL); 147 149 if (severity >= __KSYSLOG_S_MAX) 150 return ERR_PTR(-EINVAL); 151 152 month = ksyslog_month_num(month_s); 153 if (!month) 154 return ERR_PTR(-EINVAL); 155 if (day > 31) 156 return ERR_PTR(-EINVAL); 157 if (hour > 23) 158 return ERR_PTR(-EINVAL); 159 if (minute > 59) 160 return ERR_PTR(-EINVAL); 161 if (second > 59) 148 162 return ERR_PTR(-EINVAL); 149 163 … … 164 178 do_gettimeofday(&entry->tv); 165 179 180 time_to_tm(entry->tv.tv_sec, 0, &tm); 181 entry->time = mktime(tm.tm_year + 1900, month, day, hour, minute, second); 182 183 entry->priority = priority; 166 184 entry->facility = facility; 167 185 entry->severity = severity;
Note: See TracChangeset
for help on using the changeset viewer.