On Thu, Nov 25, 2010 at 8:40 AM, Cyril Hrubis <[email protected]> wrote:
> Hi!
> Folowing patch fixes/cleanups lchown tests.
>
> lchown01 changes:
>
> * make a better use of ltp test interface
> * make error messages consistent
> * various coding style issues
>
> lchown02 changes:
>
> * all test setups are now done in setup functions
> * eliminated need for external script for preparing tempfile
> * make a better use of ltp test interface
> * make error messages consistent
> * various coding style issues
> * fix lchown02 invocation in runtest files
Comments inline with gcooper>
Thanks,
-Garrett
...
+CFLAGS+=-W -Wall
+
gcooper> Please remove.
...
+ if (user_id == (uid_t)-1)
+ user_id = test_cases[i - 1].user_id;
+ if (group_id == (gid_t)-1)
+ group_id = test_cases[i - 1].group_id;
gcooper> These assume that i is >= 1. Could you please add that
conditional to the overall block so someone doesn't delete the
subtestcase, break the test and come back to us later and gripe about
how it's accessing memory out of bounds?
+ if ((stat_buf.st_uid != user_id) ||
+ (stat_buf.st_gid != group_id)) {
tst_resm(TFAIL,
"%s: Incorrect ownership set, "
"Expected %d %d", SFILE,
gcooper> Technically it's %u.
+ return 0;
+}
gcooper> If it gets down here, it should be return 1;
...
+ if (close(fd) == -1)
+ tst_brkm(TBROK | TERRNO, cleanup, "close(2) %s", TESTFILE);
gcooper> Wouldn't worry about the close.
...
- /* fix permissions on the tmpdir */
- if (chmod(".", 0711) != 0) {
- tst_brkm(TBROK | TERRNO, cleanup, "chmod() failed");
gcooper> The directory mode for tst_tmpdir is different:
#define DIR_MODE 0777 /* mode of tmp dir that will be created */
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list