2114697ef0
from William Yodlowsky (MAINTAINER)
47 lines
1.5 KiB
Plaintext
47 lines
1.5 KiB
Plaintext
$OpenBSD: patch-lcksum_c,v 1.3 2007/09/04 20:52:13 jasper Exp $
|
|
--- lcksum.c.orig Tue Aug 1 16:13:38 2006
|
|
+++ lcksum.c Sun Mar 18 12:15:14 2007
|
|
@@ -176,13 +176,13 @@ do_lcksum( char *tpath )
|
|
fprintf( stderr, "%s: path too long\n", tpath );
|
|
exit( 2 );
|
|
}
|
|
- strcpy( cwd, tpath );
|
|
+ (void)strlcpy( cwd, tpath, sizeof( cwd ) );
|
|
} else {
|
|
if ( snprintf( temp, MAXPATHLEN, "%s/%s", cwd, tpath ) >= MAXPATHLEN ) {
|
|
fprintf( stderr, "%s/%s: path too long\n", cwd, tpath );
|
|
exit( 2 );
|
|
}
|
|
- strcpy( cwd, temp );
|
|
+ (void)strlcpy( cwd, temp, sizeof( cwd ) );
|
|
}
|
|
if ( get_root( radmind_path, cwd, file_root, tran_root, tran_name ) != 0 ) {
|
|
exit( 2 );
|
|
@@ -293,7 +293,7 @@ do_lcksum( char *tpath )
|
|
exitval = 1;
|
|
goto done;
|
|
}
|
|
- strcpy( path, d_path );
|
|
+ (void)strlcpy( path, d_path, sizeof( path ) );
|
|
|
|
/* check to see if file against prefix */
|
|
if ( prefix != NULL ) {
|
|
@@ -330,7 +330,7 @@ do_lcksum( char *tpath )
|
|
exitval = 1;
|
|
goto done;
|
|
}
|
|
- strcpy( prepath, path );
|
|
+ (void)strlcpy( prepath, path, sizeof( prepath ) );
|
|
|
|
if ((( *targv[ 0 ] != 'f' ) && ( *targv[ 0 ] != 'a' )) || ( remove )) {
|
|
if ( updatetran ) {
|
|
@@ -443,7 +443,7 @@ do_lcksum( char *tpath )
|
|
fprintf( ufs, "%s %-37s %4s %5s %5s %9ld "
|
|
"%7" PRIofft "d %s\n",
|
|
targv[ 0 ], targv[ 1 ], targv[ 2 ], targv[ 3 ],
|
|
- targv[ 4 ], st.st_mtime, st.st_size, lcksum );
|
|
+ targv[ 4 ], (long)st.st_mtime, st.st_size, lcksum );
|
|
} else {
|
|
/* use mtime from transcript */
|
|
fprintf( ufs, "%s %-37s %4s %5s %5s %9s "
|