openbsd-ports/sysutils/radmind/patches/patch-command_c
pvalchev 82806daf7d Update to radmind-1.4.0
from maintainer William Yodlowsky <bsd@openbsd.rutgers.edu>
2005-01-26 00:33:30 +00:00

82 lines
2.9 KiB
Plaintext

$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[] )
/* 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
@@ -727,7 +727,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 ) {
@@ -1123,7 +1123,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 ] )
@@ -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 ) {
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 )) {
@@ -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 ) {
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 )) {
@@ -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 ) {
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 );
}
}