2005-01-25 19:33:30 -05:00
|
|
|
$OpenBSD: patch-command_c,v 1.2 2005/01/26 00:33:30 pvalchev Exp $
|
|
|
|
--- command.c.orig Tue Dec 14 10:59:27 2004
|
|
|
|
+++ command.c Thu Jan 20 12:59:08 2005
|
|
|
|
@@ -635,7 +635,7 @@ f_stat( SNET *sn, int ac, char *av[] )
|
2004-06-26 15:00:48 -04:00
|
|
|
|
|
|
|
/* if allowable, check for transcript in the special file directory */
|
|
|
|
|
|
|
|
- strcat( path, ".T" );
|
|
|
|
+ (void)strlcat( path, ".T", sizeof( path ) );
|
|
|
|
|
|
|
|
/* store value of av[ 2 ], because argcargv will be called
|
|
|
|
* from special_t(), and that will blow away the current values
|
2005-01-25 19:33:30 -05:00
|
|
|
@@ -727,7 +727,7 @@ f_stor( SNET *sn, int ac, char *av[] )
|
|
|
|
snet_writef( sn, "%d Path too long\r\n", 540 );
|
|
|
|
return( 1 );
|
|
|
|
}
|
2004-06-26 15:00:48 -04:00
|
|
|
- strcpy( upload_xscript, av[ 2 ] );
|
|
|
|
+ (void)strlcpy( upload_xscript, av[ 2 ], sizeof( upload_xscript ) );
|
|
|
|
|
|
|
|
/* make the directory for the files of this xscript to live in. */
|
|
|
|
if ( mkdir( xscriptdir, 0777 ) < 0 ) {
|
2005-01-25 19:33:30 -05:00
|
|
|
@@ -1123,7 +1123,7 @@ command_k( char *path_config )
|
2004-06-26 15:00:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (( p = strrchr( av[ 1 ], '/' )) == NULL ) {
|
|
|
|
- sprintf( special_dir, "special" );
|
|
|
|
+ (void)snprintf( special_dir, sizeof( special_dir ), "special" );
|
|
|
|
} else {
|
|
|
|
*p = '\0';
|
|
|
|
if ( snprintf( special_dir, MAXPATHLEN, "special/%s", av[ 1 ] )
|
2005-01-25 19:33:30 -05:00
|
|
|
@@ -1141,14 +1141,14 @@ command_k( char *path_config )
|
|
|
|
"config file: line %d: command file too long\n", linenum );
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
- strcpy( command_file, av[ 1 ] );
|
|
|
|
+ (void)strlcpy( command_file, av[ 1 ], sizeof( command_file ) );
|
|
|
|
if ( snprintf( temp, MAXPATHLEN, "%s/%s", special_dir,
|
|
|
|
remote_cn ) >= MAXPATHLEN ) {
|
2004-06-26 15:00:48 -04:00
|
|
|
syslog( LOG_ERR, "config file: line %d: special dir too long\n",
|
2005-01-25 19:33:30 -05:00
|
|
|
linenum );
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
- strcpy( special_dir, temp );
|
|
|
|
+ (void)strlcpy( special_dir, temp, sizeof( special_dir ) );
|
2004-06-26 15:00:48 -04:00
|
|
|
return( 0 );
|
|
|
|
}
|
2005-01-25 19:33:30 -05:00
|
|
|
if ( wildcard( av[ 0 ], remote_host, 0 )) {
|
|
|
|
@@ -1157,14 +1157,14 @@ command_k( char *path_config )
|
|
|
|
"config file: line %d: command file too long\n", linenum );
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
- strcpy( command_file, av[ 1 ] );
|
|
|
|
+ (void)strlcpy( command_file, av[ 1 ], sizeof( command_file ) );
|
|
|
|
if ( snprintf( temp, MAXPATHLEN, "%s/%s", special_dir,
|
|
|
|
remote_host ) >= MAXPATHLEN ) {
|
2004-06-26 15:00:48 -04:00
|
|
|
syslog( LOG_ERR, "config file: line %d: special dir too long\n",
|
2005-01-25 19:33:30 -05:00
|
|
|
linenum );
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
- strcpy( special_dir, temp );
|
|
|
|
+ (void)strlcpy( special_dir, temp, sizeof( special_dir ) );
|
2004-06-26 15:00:48 -04:00
|
|
|
return( 0 );
|
|
|
|
}
|
2005-01-25 19:33:30 -05:00
|
|
|
if ( wildcard( av[ 0 ], remote_addr, 1 )) {
|
|
|
|
@@ -1173,14 +1173,14 @@ command_k( char *path_config )
|
|
|
|
"config file: line %d: command file too long\n", linenum );
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
- strcpy( command_file, av[ 1 ] );
|
|
|
|
+ (void)strlcpy( command_file, av[ 1 ], sizeof( command_file ) );
|
|
|
|
if ( snprintf( temp, MAXPATHLEN, "%s/%s", special_dir,
|
|
|
|
remote_addr ) >= MAXPATHLEN ) {
|
2004-06-26 15:00:48 -04:00
|
|
|
syslog( LOG_ERR, "config file: line %d: special dir too long\n",
|
2005-01-25 19:33:30 -05:00
|
|
|
linenum );
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
- strcpy( special_dir, temp );
|
|
|
|
+ (void)strlcpy( special_dir, temp, sizeof( special_dir ) );
|
|
|
|
return( 0 );
|
|
|
|
}
|
|
|
|
}
|