"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "librpc/ndr/ndr_nbt.c" between
samba-4.12.3.tar.gz and samba-4.12.5.tar.gz

About: Samba is the standard Windows interoperability suite of programs for Linux and Unix providing secure, stable and fast file and print services for all clients using the SMB/CIFS protocol. 4.12 series.

ndr_nbt.c  (samba-4.12.3):ndr_nbt.c  (samba-4.12.5)
skipping to change at line 28 skipping to change at line 28
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* parser auto-generated by pidl, then hand-modified by abartlet */ /* parser auto-generated by pidl, then hand-modified by abartlet */
#include "includes.h" #include "includes.h"
#include "../libcli/nbt/libnbt.h" #include "../libcli/nbt/libnbt.h"
#include "../libcli/netlogon/netlogon.h" #include "../libcli/netlogon/netlogon.h"
#include "ndr_dns_utils.h"
/* don't allow an unlimited number of name components */ /* don't allow an unlimited number of name components */
#define MAX_COMPONENTS 128 #define MAX_COMPONENTS 128
/** /**
print a nbt string print a nbt string
*/ */
_PUBLIC_ void ndr_print_nbt_string(struct ndr_print *ndr, const char *name, cons t char *s) _PUBLIC_ void ndr_print_nbt_string(struct ndr_print *ndr, const char *name, cons t char *s)
{ {
ndr_print_string(ndr, name, s); ndr_print_string(ndr, name, s);
skipping to change at line 144 skipping to change at line 145
ndr->offset = max_offset; ndr->offset = max_offset;
return NDR_ERR_SUCCESS; return NDR_ERR_SUCCESS;
} }
/** /**
push a nbt string to the wire push a nbt string to the wire
*/ */
_PUBLIC_ enum ndr_err_code ndr_push_nbt_string(struct ndr_push *ndr, int ndr_fla gs, const char *s) _PUBLIC_ enum ndr_err_code ndr_push_nbt_string(struct ndr_push *ndr, int ndr_fla gs, const char *s)
{ {
if (!(ndr_flags & NDR_SCALARS)) { return ndr_push_dns_string_list(ndr,
return NDR_ERR_SUCCESS; &ndr->dns_string_list,
} ndr_flags,
s,
while (s && *s) { true);
enum ndr_err_code ndr_err;
char *compname;
size_t complen;
uint32_t offset;
/* see if we have pushed the remaining string already,
* if so we use a label pointer to this string
*/
ndr_err = ndr_token_retrieve_cmp_fn(&ndr->nbt_string_list, s, &of
fset, (comparison_fn_t)strcmp, false);
if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
uint8_t b[2];
if (offset > 0x3FFF) {
return ndr_push_error(ndr, NDR_ERR_STRING,
"offset for nbt string labe
l pointer %u[%08X] > 0x00003FFF",
offset, offset);
}
b[0] = 0xC0 | (offset>>8);
b[1] = (offset & 0xFF);
return ndr_push_bytes(ndr, b, 2);
}
complen = strcspn(s, ".");
/* we need to make sure the length fits into 6 bytes */
if (complen > 0x3F) {
return ndr_push_error(ndr, NDR_ERR_STRING,
"component length %u[%08X] > 0x0000
003F",
(unsigned)complen, (unsigned)comple
n);
}
if (s[complen] == '.' && s[complen+1] == '\0') {
complen++;
}
compname = talloc_asprintf(ndr, "%c%*.*s",
(unsigned char)complen,
(unsigned char)complen,
(unsigned char)complen, s);
NDR_ERR_HAVE_NO_MEMORY(compname);
/* remember the current componemt + the rest of the string
* so it can be reused later
*/
NDR_CHECK(ndr_token_store(ndr, &ndr->nbt_string_list, s, ndr->off
set));
/* push just this component into the blob */
NDR_CHECK(ndr_push_bytes(ndr, (const uint8_t *)compname, complen+
1));
talloc_free(compname);
s += complen;
if (*s == '.') s++;
}
/* if we reach the end of the string and have pushed the last component
* without using a label pointer, we need to terminate the string
*/
return ndr_push_bytes(ndr, (const uint8_t *)"", 1);
} }
/* Manually modified to handle the dom_sid being optional based on if it is pres ent or all zero */ /* Manually modified to handle the dom_sid being optional based on if it is pres ent or all zero */
enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_REQUEST(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_REQUEST *r) enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_REQUEST(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_REQUEST *r)
{ {
if (ndr_flags & NDR_SCALARS) { if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->request_count)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->request_count));
{ {
uint32_t _flags_save_string = ndr->flags; uint32_t _flags_save_string = ndr->flags;
 End of changes. 2 change blocks. 
71 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)