Changeset 1167 for 1.8.3/trunk/src/bsd.c
- Timestamp:
- 12/28/07 19:57:17 (1 year ago)
- Files:
-
- 1.8.3/trunk/src/bsd.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/trunk/src/bsd.c
r1117 r1167 113 113 #include "strtree.h" 114 114 #include "log.h" 115 #include " pcre.h"115 #include "mypcre.h" 116 116 #ifdef HAS_OPENSSL 117 117 #include "myssl.h" … … 160 160 static int under_limit = 1; 161 161 162 char cf_motd_msg[BUFFER_LEN] ;/**< The message of the day */163 char cf_wizmotd_msg[BUFFER_LEN] ;/**< The wizard motd */164 char cf_downmotd_msg[BUFFER_LEN] ;/**< The down message */165 char cf_fullmotd_msg[BUFFER_LEN] ;/**< The 'mush full' message */166 static char poll_msg[DOING_LEN] ;167 char confname[BUFFER_LEN] ;/**< Name of the config file */168 char errlog[BUFFER_LEN] ;/**< Name of the error log file */162 char cf_motd_msg[BUFFER_LEN] = { '\0' }; /**< The message of the day */ 163 char cf_wizmotd_msg[BUFFER_LEN] = { '\0' }; /**< The wizard motd */ 164 char cf_downmotd_msg[BUFFER_LEN] = { '\0' }; /**< The down message */ 165 char cf_fullmotd_msg[BUFFER_LEN] = { '\0' }; /**< The 'mush full' message */ 166 static char poll_msg[DOING_LEN] = { '\0' }; 167 char confname[BUFFER_LEN] = { '\0' }; /**< Name of the config file */ 168 char errlog[BUFFER_LEN] = { '\0' }; /**< Name of the error log file */ 169 169 170 170 /** Is this descriptor connected to a telnet-compatible terminal? */ … … 469 469 if (child < 0) { 470 470 /* Print a warning and continue */ 471 pe rror("fork");471 penn_perror("fork"); 472 472 } else if (child > 0) { 473 473 /* Parent process of a successful fork() */ … … 476 476 /* Child process */ 477 477 if (new_process_session() < 0) 478 pe rror("Couldn't create a new process session");478 penn_perror("Couldn't create a new process session"); 479 479 } 480 480 } … … 1011 1011 #endif 1012 1012 { 1013 pe rror("select");1013 penn_perror("select"); 1014 1014 return; 1015 1015 } … … 1117 1117 #endif 1118 1118 { 1119 pe rror("test_connection");1119 penn_perror("test_connection"); 1120 1120 return -1; 1121 1121 } … … 1588 1588 if (input_ready < 0) { 1589 1589 /* Well, shoot, we have no idea. Guess and proceed. */ 1590 pe rror("select in process_output");1590 penn_perror("select in process_output"); 1591 1591 input_ready = 0; 1592 1592 } … … 2101 2101 { 2102 2102 if (*userstring) { 2103 mush_free((Malloc_t) * userstring, "userstring");2103 mush_free((Malloc_t) *userstring, "userstring"); 2104 2104 *userstring = NULL; 2105 2105 } … … 2289 2289 if (!options.login_allow) { 2290 2290 fcache_dump(d, fcache.down_fcache, NULL); 2291 if ( cf_downmotd_msg &&*cf_downmotd_msg)2291 if (*cf_downmotd_msg) 2292 2292 raw_notify(player, cf_downmotd_msg); 2293 2293 } else if (MAX_LOGINS && !under_limit) { 2294 2294 fcache_dump(d, fcache.full_fcache, NULL); 2295 if ( cf_fullmotd_msg &&*cf_fullmotd_msg)2295 if (*cf_fullmotd_msg) 2296 2296 raw_notify(player, cf_fullmotd_msg); 2297 2297 } … … 2606 2606 #endif 2607 2607 if (shutdown(d->descriptor, 2) < 0) 2608 pe rror("shutdown");2608 penn_perror("shutdown"); 2609 2609 closesocket(d->descriptor); 2610 2610 } … … 3172 3172 orator = player; 3173 3173 3174 if ( cf_motd_msg &&*cf_motd_msg) {3174 if (*cf_motd_msg) { 3175 3175 raw_notify(player, cf_motd_msg); 3176 3176 } 3177 3177 raw_notify(player, " "); 3178 if (Hasprivs(player) && cf_wizmotd_msg &&*cf_wizmotd_msg) {3179 if ( cf_motd_msg &&*cf_motd_msg)3178 if (Hasprivs(player) && *cf_wizmotd_msg) { 3179 if (*cf_motd_msg) 3180 3180 raw_notify(player, asterisk_line); 3181 3181 raw_notify(player, cf_wizmotd_msg); … … 3395 3395 do_motd(dbref player, enum motd_type key, const char *message) 3396 3396 { 3397 3398 if (!Wizard(player) && key != MOTD_LIST) { 3397 const char *what; 3398 3399 if (key != MOTD_LIST && !Can_Announce(player)) { 3399 3400 notify(player, 3400 3401 T … … 3402 3403 return; 3403 3404 } 3405 3406 if (!message || !*message) 3407 what = T("cleared"); 3408 else 3409 what = T("set"); 3410 3404 3411 switch (key) { 3405 3412 case MOTD_MOTD: 3406 strcpy(cf_motd_msg, message);3407 notify (player, T("Motd set."));3413 mush_strncpy(cf_motd_msg, message, BUFFER_LEN); 3414 notify_format(player, T("Motd %s."), what); 3408 3415 break; 3409 3416 case MOTD_WIZ: 3410 strcpy(cf_wizmotd_msg, message);3411 notify (player, T("Wizard motd set."));3417 mush_strncpy(cf_wizmotd_msg, message, BUFFER_LEN); 3418 notify_format(player, T("Wizard motd %s."), what); 3412 3419 break; 3413 3420 case MOTD_DOWN: 3414 strcpy(cf_downmotd_msg, message);3415 notify (player, T("Down motd set."));3421 mush_strncpy(cf_downmotd_msg, message, BUFFER_LEN); 3422 notify_format(player, T("Down motd %s."), what); 3416 3423 break; 3417 3424 case MOTD_FULL: 3418 strcpy(cf_fullmotd_msg, message);3419 notify (player, T("Full motd set."));3425 mush_strncpy(cf_fullmotd_msg, message, BUFFER_LEN); 3426 notify_format(player, T("Full motd %s."), what); 3420 3427 break; 3421 3428 case MOTD_LIST: 3422 notify_format(player, "MOTD: %s", cf_motd_msg);3429 notify_format(player, T("MOTD: %s"), cf_motd_msg); 3423 3430 if (Hasprivs(player)) { 3424 3431 notify_format(player, T("Wiz MOTD: %s"), cf_wizmotd_msg); … … 4044 4051 if (!*args[0]) 4045 4052 safe_str(T("#-1 FUNCTION REQUIRES ONE ARGUMENT"), buff, bp); 4046 else if ((match = lookup_desc(executor, args[0])) )4053 else if ((match = lookup_desc(executor, args[0])) && match->width > 0) 4047 4054 safe_integer(match->width, buff, bp); 4048 4055 else if (args[1]) … … 4057 4064 if (!*args[0]) 4058 4065 safe_str(T("#-1 FUNCTION REQUIRES ONE ARGUMENT"), buff, bp); 4059 else if ((match = lookup_desc(executor, args[0])) )4066 else if ((match = lookup_desc(executor, args[0])) && match->height > 0) 4060 4067 safe_integer(match->height, buff, bp); 4061 4068 else if (args[1]) … … 4122 4129 DESC *d; 4123 4130 int first = 1; 4131 dbref victim; 4132 int powered = 1; 4124 4133 4125 4134 if (!Priv_Who(executor)) { … … 4128 4137 } 4129 4138 4139 if (nargs && args[0] && *args[0]) { 4140 /* An argument was given. Find the victim and adjust perms */ 4141 if ((victim = noisy_match_result(executor, args[0], NOTYPE, 4142 MAT_EVERYTHING)) == NOTHING) { 4143 safe_str(T(e_notvis), buff, bp); 4144 return; 4145 } 4146 if (!Priv_Who(victim)) 4147 powered = 0; 4148 } 4149 4130 4150 DESC_ITER_CONN(d) { 4131 if (first) 4132 first = 0; 4133 else 4134 safe_chr(' ', buff, bp); 4135 safe_integer(d->descriptor, buff, bp); 4151 if (powered || !Hidden(d)) { 4152 if (first) 4153 first = 0; 4154 else 4155 safe_chr(' ', buff, bp); 4156 safe_integer(d->descriptor, buff, bp); 4157 } 4136 4158 } 4137 4159 }
