82 lines
2.9 KiB
Plaintext
82 lines
2.9 KiB
Plaintext
$OpenBSD: patch-command_c,v 1.4 2007/09/04 20:52:13 jasper Exp $
|
|
--- command.c.orig Fri Mar 9 13:36:28 2007
|
|
+++ command.c Sun Mar 18 12:15:14 2007
|
|
@@ -662,7 +662,7 @@ f_stat( SNET *sn, int ac, char *av[] )
|
|
|
|
/* 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
|
|
@@ -771,7 +771,7 @@ f_stor( SNET *sn, int ac, char *av[] )
|
|
snet_writef( sn, "%d Path too long\r\n", 540 );
|
|
return( 1 );
|
|
}
|
|
- 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 ) {
|
|
@@ -1244,7 +1244,7 @@ command_k( char *path_config )
|
|
}
|
|
|
|
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 ] )
|
|
@@ -1262,14 +1262,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 ) {
|
|
syslog( LOG_ERR, "config file: line %d: special dir too long\n",
|
|
linenum );
|
|
continue;
|
|
}
|
|
- strcpy( special_dir, temp );
|
|
+ (void)strlcpy( special_dir, temp, sizeof( special_dir ) );
|
|
return( 0 );
|
|
}
|
|
if ( wildcard( av[ 0 ], remote_host, 0 )) {
|
|
@@ -1278,14 +1278,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 ) {
|
|
syslog( LOG_ERR, "config file: line %d: special dir too long\n",
|
|
linenum );
|
|
continue;
|
|
}
|
|
- strcpy( special_dir, temp );
|
|
+ (void)strlcpy( special_dir, temp, sizeof( special_dir ) );
|
|
return( 0 );
|
|
}
|
|
if ( wildcard( av[ 0 ], remote_addr, 1 )) {
|
|
@@ -1294,14 +1294,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 ) {
|
|
syslog( LOG_ERR, "config file: line %d: special dir too long\n",
|
|
linenum );
|
|
continue;
|
|
}
|
|
- strcpy( special_dir, temp );
|
|
+ (void)strlcpy( special_dir, temp, sizeof( special_dir ) );
|
|
return( 0 );
|
|
}
|
|
}
|