This repository was archived by the owner on May 18, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -878,7 +878,7 @@ algorithm
878878 end if ;
879879
880880 // Don't allow running omc as root due to security risks.
881- if System.userIsRoot() and (Flags.isSet(Flags.INTERACTIVE) or Flags.isSet(Flags.INTERACTIVE_CORBA)) then
881+ if System.userIsRoot() and (Flags.isSet(Flags.INTERACTIVE) or Flags.isSet(Flags.INTERACTIVE_CORBA) or Flags.isSet(Flags.INTERACTIVE_ZMQ) ) then
882882 Error.addMessage(Error.ROOT_USER_INTERACTIVE, {});
883883 print(ErrorExt.printMessagesStr(false ));
884884 fail();
Original file line number Diff line number Diff line change @@ -80,7 +80,15 @@ void ZeroMQ_sendReply(void *mmcZmqSocket, const char* reply)
8080 intptr_t zmqSocket = (intptr_t )MMC_FETCH (MMC_OFFSET (MMC_UNTAGPTR (mmcZmqSocket ),1 ));
8181 // send the reply
8282 //fprintf(stdout, "Sending message %s\n", reply);fflush(NULL);
83- zmq_send ((void * )zmqSocket , reply , strlen (reply ) + 1 , 0 );
83+ // Create an empty ZeroMQ message to hold the message part
84+ zmq_msg_t replyMsg ;
85+ zmq_msg_init_size (& replyMsg , strlen (reply ));
86+ // copy the char* to zmq_msg_t
87+ memcpy (zmq_msg_data (& replyMsg ), reply , strlen (reply ));
88+ // send the message
89+ zmq_msg_send (& replyMsg , (void * )zmqSocket , 0 );
90+ // release the zmq_msg_t
91+ zmq_msg_close (& replyMsg );
8492}
8593
8694void ZeroMQ_close (void * mmcZmqSocket )
You can’t perform that action at this time.
0 commit comments