Hi All,
I believe there is a bug in function netretr_proxy in
filters/common/connect.c, where unlink call is made to remove a
temporary file in case of error. There are calls to perror that should
output error message of the outer file operation. However, the call to
unlink may reset errno. See patch below:
diff --git a/filters/common/connect.c b/filters/common/connect.c
index 0e92cae..0139e0e 100755
--- a/filters/common/connect.c
+++ b/filters/common/connect.c
@@ -286,10 +286,10 @@ netretr_proxy( char *scookie, struct sinfo *si,
SNET *sn, char *proxydb,
}
if (( tmpfile = fdopen( fd, "w" )) == NULL ) {
+ perror( tmppath );
if ( unlink( tmppath ) != 0 ) {
perror( tmppath );
}
- perror( tmppath );
return( COSIGN_ERROR );
}
@@ -346,18 +346,18 @@ netretr_proxy( char *scookie, struct sinfo *si,
SNET *sn, char *proxydb,
} while ( line[ 3 ] == '-' );
if ( fclose ( tmpfile ) != 0 ) {
+ perror( tmppath );
if ( unlink( tmppath ) != 0 ) {
perror( tmppath );
}
- perror( tmppath );
return( COSIGN_ERROR );
}
if ( link( tmppath, path ) != 0 ) {
+ perror( tmppath );
if ( unlink( tmppath ) != 0 ) {
perror( tmppath );
}
- perror( tmppath );
return( COSIGN_ERROR );
}
Regards,
Martin Sucha
------------------------------------------------------------------------------
Automate Storage Tiering Simply
Optimize IT performance and efficiency through flexible, powerful,
automated storage tiering capabilities. View this brief to learn how
you can reduce costs and improve performance.
http://p.sf.net/sfu/dell-sfdev2dev
_______________________________________________
Cosign-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cosign-discuss