From: Robert W. <ro...@us...> - 2004-10-28 18:54:28
|
Thanks for the patch Mike. I applied it to our CVS tree. -Robbie (Embedded image moved to file: pic12956.jpg) ltp...@li... wrote on 10/25/2004 03:05:51 PM: > I was running ltp-20031106 and encountered directory length issues in > symlink01, execve03, and creat06. If LTP is run in a directory with a > long path name, these tests will produce unexpected results. I've > attached patches to correct this, by increasing buffer size to 1000 in > creat06 (from 40) and symlink01 (from 100) and by altering calls to > getcwd in symlink01.c. I tested them with ltp-20041007 to make sure > they'd apply. > > -- > Michael Vieths > MVieths@Cassatt.com > --- testcases/kernel/syscalls/creat/creat06.c.orig Tue Sep 14 15:42:30 2004 > +++ testcases/kernel/syscalls/creat/creat06.c Tue Sep 14 14:23:58 2004 > @@ -84,7 +84,7 @@ > > #define MODE1 0444 > #define MODE2 0666 > -#define NSIZE 40 > +#define NSIZE 1000 > > char long_name[] = > "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyz"; > > --- testcases/kernel/syscalls/execve/execve03.c.orig Tue Sep 14 > 15:43:09 2004 > +++ testcases/kernel/syscalls/execve/execve03.c Tue Sep 14 14:26:27 2004 > @@ -93,9 +93,9 @@ > > char long_file[] = > "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyz"; > char no_dir[] = "testdir"; > -char test_name3[100]; > -char test_name5[100]; > -char test_name6[100]; > +char test_name3[1000]; > +char test_name5[1000]; > +char test_name6[1000]; > > struct test_case_t { > char *tname; /* the command name to pass to execve() */ > --- testcases/kernel/syscalls/symlink/symlink01.c.orig 2004-09-14 > 15:52:39.000000000 -0500 > +++ testcases/kernel/syscalls/symlink/symlink01.c 2004-09-14 15: > 53:55.000000000 -0500 > @@ -819,7 +819,7 @@ > int ctr, to_go, size, whole_chunks; > char *cwd, *getcwd(); > > - if ((cwd = getcwd((char *)NULL, 64)) == NULL) > + if ((cwd = getcwd((char *)NULL, 0)) == NULL) > { > TEST_RESULT=TBROK; > sprintf(test_msg, > @@ -827,7 +827,7 @@ > path1, path2, path3); > return(0); > } > - cwd = getcwd((char *)NULL, 64); > + cwd = getcwd((char *)NULL, 0); > size = strlen(cwd); > > to_go = PATH_MAX - size; > @@ -1591,7 +1591,7 @@ > strcat(expected_location, "/"); > strcat(expected_location, tc_ptr->fn_arg[2]); > > - if ((cwd = getcwd((char *)NULL, 64)) == NULL) > + if ((cwd = getcwd((char *)NULL, 0)) == NULL) > tst_resm(TFAIL, "getcwd(3) FAILURE"); > else if (strcmp(cwd, expected_location) == 0) > if ( TEST_RESULT != TPASS || STD_FUNCTIONAL_TEST ) |