On Wed, Dec 10, 2008 at 06:45:04PM +0530, Rishikesh K. Rajak wrote: > > In libcgroup testcase "setuid" testcase segfault when we run without uid > parameter. > This patch fixes the issue. > > Signed-off By: Rishikesh k Rajak <[email protected]> > --- > Index: tests/setuid.c > =================================================================== > --- tests.orig/setuid.c > +++ tests/setuid.c > @@ -43,6 +43,11 @@ int main(int argc, char *argv[]) > /* Return codes */ > int ret; > > + if (argc < 2) { > + printf("Usage: setuid uid_value \n"); > + goto finished; > + } > +
Coding style. Please use tabs instead of spaces. I have fixed these issues, but in future patches please take care. Also I have changed the error meessage a bit. I have merged the following, libcgroup: Segfault when we run setuid testcase without argument From: "Rishikesh K. Rajak" <[email protected]> In libcgroup testcase "setuid" testcase segfault when we run without uid parameter. This patch fixes the issue. [[email protected]: Minor fixes] Signed-off-by: Rishikesh k Rajak <[email protected]> Signed-off-by: Dhaval Giani <[email protected]> --- --- tests/setuid.c | 5 +++++ 1 file changed, 5 insertions(+) Index: trunk/tests/setuid.c =================================================================== --- trunk.orig/tests/setuid.c 2008-10-30 21:52:23.000000000 +0530 +++ trunk/tests/setuid.c 2008-12-14 10:00:37.000000000 +0530 @@ -43,6 +43,11 @@ int main(int argc, char *argv[]) /* Return codes */ int ret; + if (argc < 2) { + printf("Usage: %s <uid_value> \n", argv[0]); + goto finished; + } + pwd = getpwnam(argv[1]); uid = pwd->pw_uid; fprintf(stdout, "Setting UID to %s (%d).\n", pwd->pw_name, uid); thanks, -- regards, Dhaval ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Libcg-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libcg-devel
