[Ocfs2-tools-devel] [PATCH 11/25] o2cb: Add ops add-node and remove-node

Joel Becker Joel.Becker at oracle.com
Mon Jun 28 11:12:56 PDT 2010


On Sun, Jun 27, 2010 at 10:33:10AM -0700, Sunil Mushran wrote:
> On 06/23/2010 07:33 PM, Joel Becker wrote:
> >>+	clustername = cmd->o_argv[1];
> >>+	nodename = cmd->o_argv[2];
> >>+
> >>+	cluster = o2cb_config_get_cluster_by_name(cmd->o_config, clustername);
> >	Do you need to check for zero-length arguments, or do the
> >underlying calls find that out?
> 
> The parse function should ensure the arg is not zero length. Or, am
> I missing something.

	I don't see anywhere in your parse function that checks the
length of clustername or nodename.  Do you mean the normal shell
argument processing before your main() is invoked?  Try running 'cat
""'.  You'll see that a zero-length argument is indeed passed.
 
Joel

-- 

"I'm drifting and drifting
 Just like a ship out on the sea.
 Cause I ain't got nobody, baby,
 In this world to care for me."

Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list