From: Patrick M. <ume...@us...> - 2006-03-20 18:16:53
|
Update of /cvsroot/radmind/radmind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30861 Modified Files: connect.h ktcheck.c lapply.c lfdiff.c retr.c Log Message: From 1.6.0-branch: retr() and retr_applefile() take an additional value mode_t tempmode to specify how temp files are created. This allows lapply to work around broken OS X symlinks by not setting a process wide umask by default. ( Bug #1441965 ) Index: lapply.c =================================================================== RCS file: /cvsroot/radmind/radmind/lapply.c,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** lapply.c 20 Mar 2006 17:57:51 -0000 1.130 --- lapply.c 20 Mar 2006 18:16:46 -0000 1.131 *************** *** 159,163 **** } if ( *targv[ 0 ] == 'a' ) { ! switch ( retr_applefile( sn, pathdesc, path, temppath, strtoofft( targv[ 6 ], NULL, 10 ), cksum_b64 )) { case -1: --- 159,163 ---- } if ( *targv[ 0 ] == 'a' ) { ! switch ( retr_applefile( sn, pathdesc, path, temppath, 0600, strtoofft( targv[ 6 ], NULL, 10 ), cksum_b64 )) { case -1: *************** *** 171,175 **** } } else { ! switch ( retr( sn, pathdesc, path, (char *)&temppath, strtoofft( targv[ 6 ], NULL, 10 ), cksum_b64 ) != 0 ) { case -1: --- 171,175 ---- } } else { ! switch ( retr( sn, pathdesc, path, (char *)&temppath, 0600, strtoofft( targv[ 6 ], NULL, 10 ), cksum_b64 ) != 0 ) { case -1: *************** *** 256,267 **** char **capa = NULL; /* capabilities */ - /* - * retr() uses a default mode of 0644 for downloaded files. Since - * some of them might be sensitive, we change the umask here - * so only the user can see the temp files before they are set - * with the correct permissions. -u can change this umask. - */ - umask( S_IRWXG | S_IRWXO ); - while (( c = getopt ( argc, argv, "%c:Fh:iInp:qru:Vvw:x:y:z:Z:" )) != EOF ) { switch( c ) { --- 256,259 ---- Index: lfdiff.c =================================================================== RCS file: /cvsroot/radmind/radmind/lfdiff.c,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** lfdiff.c 20 Mar 2006 17:57:51 -0000 1.56 --- lfdiff.c 20 Mar 2006 18:16:46 -0000 1.57 *************** *** 154,165 **** struct transcript *tran; - /* - * retr() uses a default mode of 0644 for downloaded files. Since - * some of them might be sensitive, we change the umask here - * so only the user can see the temp files before they are set - * with the correct permissions. -u can change this umask. - */ - umask( S_IRWXG | S_IRWXO ); - /* create argv to pass to diff */ if (( diffargv = (char **)malloc( 1 * sizeof( char * ))) == NULL ) { --- 154,157 ---- *************** *** 407,411 **** } ! if ( retr( sn, pathdesc, path, (char *)&temppath, -1, "-" ) != 0 ) { exit( 2 ); } --- 399,403 ---- } ! if ( retr( sn, pathdesc, path, (char *)&temppath, 0600, -1, "-" ) != 0 ) { exit( 2 ); } Index: connect.h =================================================================== RCS file: /cvsroot/radmind/radmind/connect.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** connect.h 24 Jan 2006 20:47:01 -0000 1.11 --- connect.h 20 Mar 2006 18:16:45 -0000 1.12 *************** *** 14,20 **** int retr( SNET *sn, char *pathdesc, char *path, char *temppath, ! off_t transize, char *trancksum ); int retr_applefile( SNET *sn, char *pathdesc, char *path, char *temppath, ! off_t transize, char *trancksum ); int n_stor_file( SNET *sn, char *pathdesc, char *path ); --- 14,20 ---- int retr( SNET *sn, char *pathdesc, char *path, char *temppath, ! mode_t tempmode, off_t transize, char *trancksum ); int retr_applefile( SNET *sn, char *pathdesc, char *path, char *temppath, ! mode_t tempmode, off_t transize, char *trancksum ); int n_stor_file( SNET *sn, char *pathdesc, char *path ); Index: retr.c =================================================================== RCS file: /cvsroot/radmind/radmind/retr.c,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** retr.c 1 Mar 2006 04:58:40 -0000 1.55 --- retr.c 20 Mar 2006 18:16:46 -0000 1.56 *************** *** 61,66 **** int ! retr( SNET *sn, char *pathdesc, char *path, char *temppath, off_t transize, ! char *trancksum ) { struct timeval tv; --- 61,66 ---- int ! retr( SNET *sn, char *pathdesc, char *path, char *temppath, mode_t tempmode, ! off_t transize, char *trancksum ) { struct timeval tv; *************** *** 130,134 **** } /* Open file */ ! if (( fd = open( temppath, O_WRONLY | O_CREAT, 0644 )) < 0 ) { perror( temppath ); return( -1 ); --- 130,134 ---- } /* Open file */ ! if (( fd = open( temppath, O_WRONLY | O_CREAT, tempmode )) < 0 ) { perror( temppath ); return( -1 ); *************** *** 214,218 **** int retr_applefile( SNET *sn, char *pathdesc, char *path, char *temppath, ! off_t transize, char *trancksum ) { int dfd, rfd; --- 214,218 ---- int retr_applefile( SNET *sn, char *pathdesc, char *path, char *temppath, ! mode_t tempmode, off_t transize, char *trancksum ) { int dfd, rfd; *************** *** 368,372 **** /* data fork must exist to write to rsrc fork */ ! if (( dfd = open( temppath, O_CREAT | O_EXCL | O_WRONLY, 0644 )) < 0 ) { perror( temppath ); return( -1 ); --- 368,372 ---- /* data fork must exist to write to rsrc fork */ ! if (( dfd = open( temppath, O_CREAT | O_EXCL | O_WRONLY, tempmode )) < 0 ) { perror( temppath ); return( -1 ); Index: ktcheck.c =================================================================== RCS file: /cvsroot/radmind/radmind/ktcheck.c,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** ktcheck.c 20 Mar 2006 17:57:51 -0000 1.110 --- ktcheck.c 20 Mar 2006 18:16:46 -0000 1.111 *************** *** 459,463 **** if ( update ) { if ( !quiet ) { printf( "%s:", path ); fflush( stdout ); } ! if ( retr( sn, pathdesc, path, (char *)&tempfile, strtoofft( targv[ 6 ], NULL, 10 ), targv[ 7 ] ) != 0 ) { return( 2 ); --- 459,463 ---- if ( update ) { if ( !quiet ) { printf( "%s:", path ); fflush( stdout ); } ! if ( retr( sn, pathdesc, path, (char *)&tempfile, 0666, strtoofft( targv[ 6 ], NULL, 10 ), targv[ 7 ] ) != 0 ) { return( 2 ); *************** *** 507,511 **** return( 2 ); } ! if ( retr( sn, pathdesc, path, (char *)&tempfile, strtoofft( targv[ 6 ], NULL, 10 ), targv[ 7 ] ) != 0 ) { return( 2 ); --- 507,511 ---- return( 2 ); } ! if ( retr( sn, pathdesc, path, (char *)&tempfile, 0666, strtoofft( targv[ 6 ], NULL, 10 ), targv[ 7 ] ) != 0 ) { return( 2 ); |