OBS-URL: https://build.opensuse.org/package/show/Printing/lprng?expand=0&rev=1
83 lines
2.3 KiB
Diff
83 lines
2.3 KiB
Diff
--- src/common/checkpc.c
|
|
+++ src/common/checkpc.c
|
|
@@ -861,7 +861,8 @@
|
|
|
|
To_euid_root();
|
|
WARNMSG( " changing ownership '%s' to %d/%d", path, DaemonUID, DaemonGID );
|
|
- chown( path, DaemonUID, DaemonGID );
|
|
+ if(chown( path, DaemonUID, DaemonGID ))
|
|
+ perror("chown:");
|
|
if( geteuid() == ROOTUID ){
|
|
WARNMSG( " changing ownership '%s' to %d/%d", path, DaemonUID, DaemonGID );
|
|
status = chown( path, DaemonUID, DaemonGID );
|
|
@@ -963,9 +964,11 @@
|
|
|
|
To_euid_root();
|
|
SNPRINTF( cmd, sizeof(cmd)) "%s -R %d %s", CHOWN, DaemonUID, path );
|
|
- system( cmd );
|
|
+ if (system( cmd ) == -1)
|
|
+ perror("system:");
|
|
SNPRINTF( cmd, sizeof(cmd)) "%s -R %d %s", CHGRP, DaemonGID, path );
|
|
- system( cmd );
|
|
+ if (system( cmd ) == -1)
|
|
+ perror("system:");
|
|
To_euid(euid);
|
|
}
|
|
if( stat( path, &statb ) ){
|
|
--- src/common/lpd.c
|
|
+++ src/common/lpd.c
|
|
@@ -811,7 +811,8 @@
|
|
LOGERR_DIE(LOG_ERR) _("lpd: Cannot open lock file '%s'"), path );
|
|
}
|
|
#if !defined(__CYGWIN__)
|
|
- fchown( lockfd, DaemonUID, DaemonGID );
|
|
+ if (fchown( lockfd, DaemonUID, DaemonGID ))
|
|
+ perror("fchown:");
|
|
fchmod( lockfd, (statb.st_mode & ~0777) | 0644 );
|
|
#endif
|
|
To_euid(euid);
|
|
@@ -1072,7 +1073,8 @@
|
|
plp_signal_t sigchld_handler (int signo)
|
|
{
|
|
signal( SIGCHLD, SIG_DFL );
|
|
- write(Lpd_request,"\n", 1);
|
|
+ if (write(Lpd_request,"\n", 1) == -1)
|
|
+ perror("write:");
|
|
}
|
|
|
|
void Setup_waitpid (void)
|
|
--- src/common/lpd_jobs.c
|
|
+++ src/common/lpd_jobs.c
|
|
@@ -1220,7 +1220,8 @@
|
|
Free_listof_line_list(&servers);
|
|
|
|
/* truncate and close the lock file then wait a short time for signal */
|
|
- ftruncate( lock_fd, 0 );
|
|
+ if (ftruncate( lock_fd, 0 ))
|
|
+ perror("ftruncate:");
|
|
close( lock_fd );
|
|
lock_fd = -1;
|
|
/* force status update */
|
|
--- src/common/user_auth.c
|
|
+++ src/common/user_auth.c
|
|
@@ -997,7 +997,8 @@
|
|
DEBUGF(DRECV1)( "md5_receive: return status encoded size %0.0f", size);
|
|
if( size || status_error ){
|
|
buffer[0] = ACK_FAIL;
|
|
- write( *sock,buffer,1 );
|
|
+ if (write( *sock,buffer,1 ) == -1)
|
|
+ perror("write:");
|
|
while( (n = Read_fd_len_timeout(transfer_timeout, tempfd, buffer,sizeof(buffer)-1)) > 0 ){
|
|
buffer[n] = 0;
|
|
DEBUGF(DRECV4)("md5_receive: sending '%d' '%s'", n, buffer );
|
|
@@ -1015,7 +1016,8 @@
|
|
goto error;
|
|
}
|
|
} else {
|
|
- write( *sock,"",1 );
|
|
+ if( write( *sock,"",1 ) == -1)
|
|
+ perror("write:");
|
|
}
|
|
return( 0 );
|
|
|