[ovs-dev] [PATCH 2/3] service controller: Allow change to punix socket file group ownership.

Ben Pfaff blp at nicira.com
Wed Aug 26 21:13:20 UTC 2015


On Fri, Aug 21, 2015 at 11:10:32PM -0700, Alex Wang wrote:
> This commit adds a new key-value pair, 'punix_file_group=<user group>',
> to the 'other_config' column in the 'Controller' table.  This new config
> allows user to change the punix socket file's group ownership, so that
> non-root process can also connect to ovs bridge.
> 
> Signed-off-by: Alex Wang <alexw at nicira.com>

POSIX says sysconf(_SC_GETGR_R_SIZE_MAX) can return -1.  It's probably
best to pick some reasonable default in that case.

I don't think POSIX requires getgrnam_r() to set errno; it's pretty
unclear on that account.  It definitely requires the return value to be
a nonzero errno value to indicate an error, so I'd recommend using the
return value instead of errno.

I am not sure that all systems have a group named "root".  I imagine
that using a GID of 0 instead of a group "root" is more portable.

The text in the log messages use " : " as separators but the common
style in OVS log messages is ": ", that is, no space before the colon.

The chmod is to 0770 but the log message says 0700.

I would consider adding support for setting the owner and the mode also.



More information about the dev mailing list