aboutsummaryrefslogtreecommitdiff
path: root/fsdev/virtfs-proxy-helper.c
diff options
context:
space:
mode:
authorM. Mohan Kumar <mohan@in.ibm.com>2012-01-19 16:15:56 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2012-01-30 10:54:16 +0530
commit5fc6dbae7416d7be38565391d4c213fa9085c9fb (patch)
tree570907d6e7411c5432144e1753f2b63657f94f73 /fsdev/virtfs-proxy-helper.c
parent71f86cd6f396fe3ede575d7dde5dbabb4a6d006e (diff)
fsdev: Fix parameter parsing for proxy helper
This fixes a crash when using sockfd with proxy FsDriver Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'fsdev/virtfs-proxy-helper.c')
-rw-r--r--fsdev/virtfs-proxy-helper.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
index 4a507d860e..f9a8270ee9 100644
--- a/fsdev/virtfs-proxy-helper.c
+++ b/fsdev/virtfs-proxy-helper.c
@@ -1036,7 +1036,13 @@ int main(int argc, char **argv)
return -1;
}
- if (*sock_name && (own_u == -1 || own_g == -1)) {
+ if (sock_name && sock != -1) {
+ fprintf(stderr, "both named socket and socket descriptor specified\n");
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ if (sock_name && (own_u == -1 || own_g == -1)) {
fprintf(stderr, "owner uid:gid not specified, ");
fprintf(stderr,
"owner uid:gid specifies who can access the socket file\n");
@@ -1064,7 +1070,7 @@ int main(int argc, char **argv)
}
do_log(LOG_INFO, "Started\n");
- if (*sock_name) {
+ if (sock_name) {
sock = proxy_socket(sock_name, own_u, own_g);
if (sock < 0) {
goto error;