- Timestamp:
- 2018-03-10T11:30:39Z (6 years ago)
- Children:
- 5447c59
- Parents:
- 3f44e43 (diff), 4a9c6b0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
unix.c
r3f44e43 r7a9d968 147 147 struct passwd *pw = NULL; 148 148 pw = getpwnam(global.conf->user); 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); 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)); 155 160 } 156 161 } … … 281 286 static void sighandler_shutdown(int signal) 282 287 { 288 int unused G_GNUC_UNUSED; 283 289 /* Write a single null byte to the pipe, just to send a message to the main loop. 284 290 * This gets handled by bitlbee_shutdown (the b_input_add callback for this pipe) */ 285 write(shutdown_pipe.fd[1], "", 1);291 unused = write(shutdown_pipe.fd[1], "", 1); 286 292 } 287 293 … … 292 298 { 293 299 GSList *l; 300 int unused G_GNUC_UNUSED; 294 301 const char *message = "ERROR :BitlBee crashed! (SIGSEGV received)\r\n"; 295 302 int len = strlen(message); … … 298 305 irc_t *irc = l->data; 299 306 sock_make_blocking(irc->fd); 300 write(irc->fd, message, len);307 unused = write(irc->fd, message, len); 301 308 } 302 309
Note: See TracChangeset
for help on using the changeset viewer.