Fix nwconn and nwqconn signal and 64-bit related warnings

This commit is contained in:
Mario Fetka
2026-04-20 23:39:42 +02:00
parent d3f38dc2d8
commit e8d7eb88b6
2 changed files with 9 additions and 9 deletions

View File

@@ -2607,10 +2607,10 @@ static void handle_sigusr2(void)
FILE *f;
fl_get_int &= ~8;
sprintf(fn, "/tmp/nwconn%04d.log", act_connection);
seteuid(0);
if (seteuid(0)) {}
unlink(fn); /* security: mst:18-Apr-00 */
f=fopen(fn, "w");
reseteuid();
(void)reseteuid();
if (f) {
log_file_module(f);
fclose(f);
@@ -2653,12 +2653,12 @@ int main(int argc, char **argv)
}
#endif
prog_title=argv[3];
setuid(0);
setgid(0);
if (setuid(0)) {}
if (setgid(0)) {}
act_connection = atoi(*(argv+1));
#if !CALL_NWCONN_OVER_SOCKET
nwconn_state = shmat(shm_id, NULL, SHM_W);
if ((int )(nwconn_state) == -1) {
if (nwconn_state == (char *)-1) {
errorp(0, "Can't attach shared memory segment", NULL);
exit(1);
}
@@ -2802,7 +2802,7 @@ int main(int argc, char **argv)
}
} /* while */
seteuid(0);
if (seteuid(0)) {}
# ifdef SIOCIPXNCPCONN
{
int conn = -act_connection;

View File

@@ -209,7 +209,7 @@ int close_queue_job2(uint32 q_id, int job_id,
XDPRINTF((5,0,"nw_close_file_queue fhandle=%d", jo->fhandle));
if (*unixname) {
char buff[1024];
char printcommand[300];
char printcommand[1400];
FILE *f=NULL;
if (prc_len && *(prc+prc_len-1)=='!'){
strmaxcpy((uint8*)buff, prc, prc_len-1);
@@ -221,7 +221,7 @@ int close_queue_job2(uint32 q_id, int job_id,
jo->fhandle = 0L;
if (NULL == (f = fopen(unixname, "r"))) {
/* OK now we try the open as root */
seteuid(0);
if (seteuid(0)) {}
f = fopen(unixname, "r");
reset_guid();
}
@@ -247,7 +247,7 @@ int close_queue_job2(uint32 q_id, int job_id,
}
fclose(f);
if (is_ok) {
seteuid(0);
if (seteuid(0)) {}
unlink(unixname);
reset_guid();
result=0;