lockdev/lockdev-1.0.1-checkname.patch
cvsdist e29365d576 auto-import changelog data from lockdev-1.0.1-1.3.src.rpm
Tue Sep 09 2003 Nalin Dahyabhai <nalin@redhat.com> 1.0.1-1.3
- rebuild
Mon Sep 08 2003 Nalin Dahyabhai <nalin@redhat.com> 1.0.1-1.2
- rebuild
Wed Aug 20 2003 Adrian Havill <havill@redhat.com> 1.0.1-1.1
- bump n-v-r for 3.0E
Fri Aug 15 2003 Adrian Havill <havill@redhat.com> 1.0.1-1
- bumped version
- make the dev rewrite work with ttys in the /dev/input subdir, not just
    the base level dir (#98160)
Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt
2004-09-09 08:00:28 +00:00

29 lines
1006 B
Diff

--- lockdev-1.0.1/src/lockdev.c.orig 2003-08-18 17:13:31.000000000 -0400
+++ lockdev-1.0.1/src/lockdev.c 2003-08-18 17:13:43.000000000 -0400
@@ -487,17 +487,18 @@
* maybe we should check it and do something if not?
*/
p = devname; /* only a filename */
- while ( (m=strrchr( p, '/')) != 0 ) {
- p = m+1; /* was pointing to the slash */
+ p += strspn(p, " \t\r\n\v\f\a"); /* skip leading whitespace */
+ if (strncmp(p, DEV_PATH, strlen(DEV_PATH)) == 0) {
+ p += strlen(DEV_PATH); /* 1st char after slash */
_debug( 3, "_dl_check_devname(%s) name = %s\n", devname, p);
if ( strcmp( p, "tty") == 0 )
p = ttyname( 0); /* this terminal, if it exists */
}
- if ( ((l=strlen( p)) == 0 ) || ( l > (MAXPATHLEN - strlen(LOCK_PATH)) ))
- return 0;
- if ( ! (m = malloc( 1 + l)) )
- return 0;
- return strcpy( m, p);
+ if (((l = strlen(p)) == 0) || (l > (MAXPATHLEN - strlen(LOCK_PATH))))
+ return NULL;
+ if ((m = malloc(++l)) == NULL)
+ return NULL;
+ return strcpy(m, p);
}