search for: msglen

Displaying 20 results from an estimated 20 matches for "msglen".

Did you mean: moglen
2019 Jun 14
1
[libnbd PATCH] states: Validate error message size
...T_DATA"; diff --git a/generator/states-reply-structured.c b/generator/states-reply-structured.c index 5791360..6d58742 100644 --- a/generator/states-reply-structured.c +++ b/generator/states-reply-structured.c @@ -149,21 +149,69 @@ } REPLY.STRUCTURED_REPLY.RECV_ERROR: + uint32_t length, msglen; + switch (recv_into_rbuf (h)) { case -1: SET_NEXT_STATE (%.DEAD); return -1; case 0: + length = be32toh (h->sbuf.sr.structured_reply.length); + msglen = be16toh (h->sbuf.sr.payload.error.len); + if (msglen > length - sizeof h->sbuf.sr.payload.error) { + SET_NEXT_...
2023 Jun 20
1
[libnbd PATCH v4 4/4] internal: Refactor layout of replies in sbuf
...ngth); > + assert (length >= sizeof h->sbuf.reply.payload.error.error.error); > assert (cmd); > > - if (length < sizeof h->sbuf.sr.payload.error.error) > + if (length < sizeof h->sbuf.reply.payload.error.error) > goto resync; > > - msglen = be16toh (h->sbuf.sr.payload.error.error.len); > - if (msglen > length - sizeof h->sbuf.sr.payload.error.error || > - msglen > sizeof h->sbuf.sr.payload.error.msg) > + msglen = be16toh (h->sbuf.reply.payload.error.error.len); > + if (msglen > length...
2023 Jun 09
4
[libnbd PATCH v4 0/4] Saner reply header layout
This was v3 patch 2/22, reworked to address the confusion about how a structured reply header is read in two pieces before getting to the payload portion. I'm still working on rebasing the rest of my v3 series (patches 1, 3-22) from other comments given, but this seemed independent enough that it's worth posting now rather than holding it up for the rest of the series. Eric Blake (4):
2010 Aug 26
1
[PATCH] New APIs: hopen-device hopen-file hread hwrite hseek hclose hclose-all
...ith_perror_errno(errno, "close handle %i failed", handle); + return -1; + } + + return 0; +} + +int /* RErr */ +do_hclose_all (void) +{ + const void *eltp; + gl_list_node_t node; + gl_list_iterator_t i = gl_list_iterator(handles); + + char *msg = NULL; + size_t msglen = 0; + + bool failed = false; + while (gl_list_iterator_next(&i, &eltp, &node)) { + gl_list_remove_node(handles, node); + + int fd = (long)eltp; + if (close(fd) < 0) { + failed = true; + + char *error = NULL; + int len = asp...
2008 Mar 10
12
[RFC][PATCH] Use ioemu block drivers through blktap
When I submitted the qcow2 patch for blktap, suggestions came up that the qemu block drivers should be used also for blktap to eliminate the current code duplication in ioemu and blktap. The attached patch adds support for a tap:ioemu pseudo driver. Devices using this driver won''t use tapdisk (containing the code duplication) any more, but will connect to the qemu-dm of the domain. In
2019 Jun 14
10
[libnbd PATCH 0/7] state machine refactoring
I'm still playing with ideas on how to split rstate from wstate (so that we can send a request without waiting for POLLIN to complete a pending reply), but this is some preliminary refactoring I found useful. I also fixed a couple of bugs while in the area (already pushed). There's a question of whether we want nbd_handle to be nearly 5k, or if we should instead keep it small and add one
2011 Oct 03
0
patch: Fix [-Wunused-but-set-variable]
...matronic.c =================================================================== --- a/drivers/gamatronic.c 2011-05-31 13:36:49.000000000 +0300 +++ b/drivers/gamatronic.c 2011-08-17 00:23:22.000000000 +0300 @@ -248,7 +248,7 @@ void sec_poll ( int pollflag ) { void upsdrv_initinfo(void) { - int msglen, e, v; + int msglen, v; char *a,*p,avail_list[300]; /* find out which variables/commands this UPS supports */ @@ -264,7 +264,6 @@ void upsdrv_initinfo(void) if (strlen(avail_list) == 0){ fatalx(EXIT_FAILURE, "No available variables found!");} a = avail_list...
2019 Jun 25
0
Re: [libnbd PATCH] states: Never block state machine inside REPLY
...0 @@ > > switch (recv_into_rbuf (h)) { > case -1: SET_NEXT_STATE (%.DEAD); return -1; > + case 1: > + save_reply_state (h); > + SET_NEXT_STATE (%.READY); > + return 0; > case 0: > length = be32toh (h->sbuf.sr.structured_reply.length); > msglen = be16toh (h->sbuf.sr.payload.error.error.len); > @@ -176,6 +184,10 @@ > > switch (recv_into_rbuf (h)) { > case -1: SET_NEXT_STATE (%.DEAD); return -1; > + case 1: > + save_reply_state (h); > + SET_NEXT_STATE (%.READY); > + return 0; > case 0: >...
2019 Jun 19
4
[libnbd PATCH] states: Never block state machine inside REPLY
...STATE (%CHECK); } return 0; @@ -154,6 +158,10 @@ switch (recv_into_rbuf (h)) { case -1: SET_NEXT_STATE (%.DEAD); return -1; + case 1: + save_reply_state (h); + SET_NEXT_STATE (%.READY); + return 0; case 0: length = be32toh (h->sbuf.sr.structured_reply.length); msglen = be16toh (h->sbuf.sr.payload.error.error.len); @@ -176,6 +184,10 @@ switch (recv_into_rbuf (h)) { case -1: SET_NEXT_STATE (%.DEAD); return -1; + case 1: + save_reply_state (h); + SET_NEXT_STATE (%.READY); + return 0; case 0: length = be32toh (h->sbuf.sr.structured_re...
2015 Jan 25
0
SmartOS: nss_wrapper: conflicting types
...2014-10-01 09:17:32.000000000 +0000 +++ source3/lib/unix_msg/unix_msg.c 2015-01-25 02:59:29.958547508 +0000 @@ -505,7 +505,9 @@ * Note: No need to check for overflow here, * since cmsg will store <= INT8_MAX fds. */ +#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL msglen += cmsg_space; +#endif data_len = iov_buflen(iov, iovlen); if (data_len == -1) { @@ -593,7 +595,9 @@ return 0; fail: +#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL close_fd_array(fds_copy, num_fds); +#endif return ret; }
2011 Jul 15
0
S3 and CTDB errors in logs
...--------------- **Unmatched Entries** auth/token_util.c:525(debug_nt_user_token) NT user token: (NULL) : 1 Time(s) auth/token_util.c:551(debug_unix_user_token) UNIX token of user 0 Primary group is 0 and contains 0 supplementary groups : 1 Time(s) lib/ctdbd_conn.c:170(ctdb_req_complete) msglen = 48 : 1 Time(s) lib/ctdbd_conn.c:339(ctdb_read_req) Received ctdb packet len=48, magic=43544442, vers=1, gen=1283100187, op=1, reqid=6 : 1 Time(s) lib/ctdbd_conn.c:940(ctdbd_migrate) ctdbd_migrate: Sending ctdb packet len=324, magic=43544442, vers=1, gen=0, op=0, reqid=6 : 1 Time(s) lib/dbw...
2000 Nov 01
0
FreeBSD Security Advisory: FreeBSD-SA-00:62.top
...20:20:33 1.4 +++ display.c 2000/10/04 23:34:16 1.5 @@ -829,7 +831,7 @@ register int i; /* first, format the message */ - (void) sprintf(next_msg, msgfmt, a1, a2, a3); + (void) snprintf(next_msg, sizeof(next_msg), msgfmt, a1, a2, a3); if (msglen > 0) { Index: top.c =================================================================== RCS file: /mnt/ncvs/src/contrib/top/top.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- top.c 1999/01/09 20:20:34 1.4 +++ top.c 2000/10/04...
2012 Apr 02
23
[PATCH 00 of 18] [v2] tools: fix bugs and build errors triggered by -O2 -Wall -Werror
Changes: tools/blktap: remove unneeded pointer dereferencing in convert_dev_name_to_num tools/blktap: constify string arrays in convert_dev_name_to_num tools/blktap: fix params and physical-device parsing tools/blktap: remove unneeded pointer dereferencing from img2qcow.c tools/blktap: remove unneeded pointer dereferencing from qcow2raw.c tools/blktap2: fix build errors caused by Werror in
2019 Jun 29
0
[libnbd PATCH 2/6] generator: Allow DEAD state actions to run
...rbuf = h->bs_entries; h->rlen = length; @@ -178,14 +178,14 @@ else { SET_NEXT_STATE (%.DEAD); set_error (0, "unknown structured reply type (%" PRIu16 ")", type); - return -1; + return 0; } REPLY.STRUCTURED_REPLY.RECV_ERROR: uint32_t length, msglen; switch (recv_into_rbuf (h)) { - case -1: SET_NEXT_STATE (%.DEAD); return -1; + case -1: SET_NEXT_STATE (%.DEAD); return 0; case 1: save_reply_state (h); SET_NEXT_STATE (%.READY); @@ -197,7 +197,7 @@ msglen > sizeof h->sbuf.sr.payload.error.msg) { SET_NEXT_S...
2004 Jan 01
1
[PATCH] Add winbind-backed NTLMSSP support to Cyrus-SASL
...buf->maxlen = buf->len; - UINT32_TO_INTEL(*offset, buf->offset); - *offset += len; -} - -/* unload a string from an NTLM buffer */ -static int unload_buffer(const sasl_utils_t *utils, ntlm_buffer_t *buf, - u_char **str, unsigned *outlen, - int unicode, u_char *base, unsigned msglen) -{ - uint16 len = 0; - - UINT16_FROM_INTEL(buf->len, len); - if (len) { - uint32 offset = 0; + context->child_pid = fork(); - *str = utils->malloc(len + 1); /* add 1 for NUL */ - if (*str == NULL) { - MEMERROR(utils); - return SASL_NOMEM; + if (context->child_pid =...
2013 Aug 02
3
[PATCH trivial] include: uapi: standard all files' macro prefix and suffix, excluding "linux/" sub-directory
...Suite 330, Boston, MA 02111-1307 USA * */ -#ifndef SCSI_NETLINK_H -#define SCSI_NETLINK_H +#ifndef _UAPI_SCSI_SCSI_NETLINK_H +#define _UAPI_SCSI_SCSI_NETLINK_H #include <linux/netlink.h> #include <linux/types.h> @@ -119,5 +119,4 @@ struct scsi_nl_host_vendor_msg { (hdr)->msglen = mlen; \ } -#endif /* SCSI_NETLINK_H */ - +#endif /* _UAPI_SCSI_SCSI_NETLINK_H */ diff --git a/include/uapi/scsi/scsi_netlink_fc.h b/include/uapi/scsi/scsi_netlink_fc.h index cbf76e4..6ba885a 100644 --- a/include/uapi/scsi/scsi_netlink_fc.h +++ b/include/uapi/scsi/scsi_netlink_fc.h @@ -18,...
2013 Aug 02
3
[PATCH trivial] include: uapi: standard all files' macro prefix and suffix, excluding "linux/" sub-directory
...Suite 330, Boston, MA 02111-1307 USA * */ -#ifndef SCSI_NETLINK_H -#define SCSI_NETLINK_H +#ifndef _UAPI_SCSI_SCSI_NETLINK_H +#define _UAPI_SCSI_SCSI_NETLINK_H #include <linux/netlink.h> #include <linux/types.h> @@ -119,5 +119,4 @@ struct scsi_nl_host_vendor_msg { (hdr)->msglen = mlen; \ } -#endif /* SCSI_NETLINK_H */ - +#endif /* _UAPI_SCSI_SCSI_NETLINK_H */ diff --git a/include/uapi/scsi/scsi_netlink_fc.h b/include/uapi/scsi/scsi_netlink_fc.h index cbf76e4..6ba885a 100644 --- a/include/uapi/scsi/scsi_netlink_fc.h +++ b/include/uapi/scsi/scsi_netlink_fc.h @@ -18,...
2013 Aug 02
3
[PATCH trivial] include: uapi: standard all files' macro prefix and suffix, excluding "linux/" sub-directory
...Suite 330, Boston, MA 02111-1307 USA * */ -#ifndef SCSI_NETLINK_H -#define SCSI_NETLINK_H +#ifndef _UAPI_SCSI_SCSI_NETLINK_H +#define _UAPI_SCSI_SCSI_NETLINK_H #include <linux/netlink.h> #include <linux/types.h> @@ -119,5 +119,4 @@ struct scsi_nl_host_vendor_msg { (hdr)->msglen = mlen; \ } -#endif /* SCSI_NETLINK_H */ - +#endif /* _UAPI_SCSI_SCSI_NETLINK_H */ diff --git a/include/uapi/scsi/scsi_netlink_fc.h b/include/uapi/scsi/scsi_netlink_fc.h index cbf76e4..6ba885a 100644 --- a/include/uapi/scsi/scsi_netlink_fc.h +++ b/include/uapi/scsi/scsi_netlink_fc.h @@ -18,...
2005 Dec 19
0
new(er) SEC driver.
...sion 1.4 17 July 2002 Eric Lawson. elawson@inficad.com * added shutdown feature * * Revison 1.3 15 July 2002 Eric Lawson. elawson@inficad.com * * Use actual sec protocol command instead of bogus command when * probing for a ups on the serial port in the setup_serial function. * * Zero msglen before calling sec_cmd the 2nd time in upsdrv_initinfo * function. This fixes driver's use of sec protocol parameters * numbered 47 and up. * * Revision 1.2 2001/05/08 03:05:21 marleyj * Added synthetic variables SEC_STATUS, INFO_ACFREQ, INFO_UTILITY, * SEC_CURRENT, INFO_LOADPCT, INFO...
2019 Jun 29
19
[libnbd PATCH 0/6] new APIs: aio_in_flight, aio_FOO_notify
I still need to wire in the use of *_notify functions into nbdkit to prove whether it makes the code any faster or easier to maintain, but at least the added example shows one good use case for the new API. Eric Blake (6): api: Add nbd_aio_in_flight generator: Allow DEAD state actions to run generator: Allow Int64 in callbacks states: Prepare for aio notify callback api: Add new