Changes in unix.c [0483e1e:72d48b6]
Legend:
- Unmodified
- Added
- Removed
-
unix.c
r0483e1e r72d48b6 147 147 struct passwd *pw = NULL; 148 148 pw = getpwnam(global.conf->user); 149 if (!pw) { 150 log_message(LOGLVL_ERROR, "Failed to look up user %s.", global.conf->user); 151 152 } else if (initgroups(global.conf->user, pw->pw_gid) != 0) { 153 log_message(LOGLVL_ERROR, "initgroups: %s.", strerror(errno)); 154 155 } else if (setgid(pw->pw_gid) != 0) { 156 log_message(LOGLVL_ERROR, "setgid(%d): %s.", pw->pw_gid, strerror(errno)); 157 158 } else if (setuid(pw->pw_uid) != 0) { 159 log_message(LOGLVL_ERROR, "setuid(%d): %s.", pw->pw_uid, strerror(errno)); 149 if (pw) { 150 initgroups(global.conf->user, pw->pw_gid); 151 setgid(pw->pw_gid); 152 setuid(pw->pw_uid); 153 } else { 154 log_message(LOGLVL_WARNING, "Failed to look up user %s.", global.conf->user); 160 155 } 161 156 } … … 286 281 static void sighandler_shutdown(int signal) 287 282 { 288 int unused G_GNUC_UNUSED;289 283 /* Write a single null byte to the pipe, just to send a message to the main loop. 290 284 * This gets handled by bitlbee_shutdown (the b_input_add callback for this pipe) */ 291 unused =write(shutdown_pipe.fd[1], "", 1);285 write(shutdown_pipe.fd[1], "", 1); 292 286 } 293 287 … … 298 292 { 299 293 GSList *l; 300 int unused G_GNUC_UNUSED;301 294 const char *message = "ERROR :BitlBee crashed! (SIGSEGV received)\r\n"; 302 295 int len = strlen(message); … … 305 298 irc_t *irc = l->data; 306 299 sock_make_blocking(irc->fd); 307 unused =write(irc->fd, message, len);300 write(irc->fd, message, len); 308 301 } 309 302
Note: See TracChangeset
for help on using the changeset viewer.