openbsd-ports/sysutils/radmind/patches/patch-hardlink_c
sturm a3134d3b4e Initial import of radmind 1.3.0
A suite of Unix command-line tools and a server designed to remotely 
administer the file systems of multiple Unix machines.

At its core, radmind operates as a tripwire. It is able to detect 
changes to any managed filesystem object, e.g. files, directories, 
links, etc. However, radmind goes further than just integrity 
checking: once a change is detected, radmind can optionally reverse 
the change.

WWW: http://rsug.itd.umich.edu/software/radmind/

from William Yodlowsky <bsd at openbsd.rutgers.edu>
2004-06-26 19:00:48 +00:00

29 lines
978 B
Plaintext

$OpenBSD: patch-hardlink_c,v 1.1.1.1 2004/06/26 19:00:48 sturm Exp $
--- hardlink.c.orig 2003-05-20 18:23:11.000000000 -0400
+++ hardlink.c 2004-06-12 23:03:23.000000000 -0400
@@ -79,6 +79,7 @@ d_insert( struct devlist **dev_head, str
i_insert( struct devlist *dev_head, struct pathinfo *pinfo )
{
struct inolist *new, **cur;
+ size_t buflen;
for ( cur = &dev_head->d_ilist; *cur != NULL; cur = &(*cur)->i_next ) {
if ( pinfo->pi_stat.st_ino <= (*cur)->i_ino ) {
@@ -96,13 +97,14 @@ i_insert( struct devlist *dev_head, stru
exit( 2 );
}
- if (( new->i_name = ( char * ) malloc( strlen( pinfo->pi_name ) + 1 ))
+ buflen = strlen( pinfo->pi_name ) + 1;
+ if (( new->i_name = ( char * ) malloc( buflen ))
== NULL ) {
perror( "i_insert malloc" );
exit( 2 );
}
- strcpy( new->i_name, pinfo->pi_name );
+ (void)strlcpy( new->i_name, pinfo->pi_name, buflen );
new->i_ino = pinfo->pi_stat.st_ino;
new->i_flag = 0;