diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-03-10 11:35:25 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-03-10 11:35:25 +0000 |
commit | 45c2ee3ff2d01fdd0a2db9fa90457cff4663c43d (patch) | |
tree | 8c90348163cbf2f618960fc9e181dbe1881f3702 /source3/libsmb | |
parent | 9579f927dc5ce82bdf51ce49419dc039560e5e18 (diff) | |
download | samba-45c2ee3ff2d01fdd0a2db9fa90457cff4663c43d.tar.gz samba-45c2ee3ff2d01fdd0a2db9fa90457cff4663c43d.tar.bz2 samba-45c2ee3ff2d01fdd0a2db9fa90457cff4663c43d.zip |
to use the same macros in the client and server rename the CLISTR_
macros to STR_
(This used to be commit 95c9e4e0ba8f37f565aaf136f41eb76489441ff7)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/cliconnect.c | 24 | ||||
-rw-r--r-- | source3/libsmb/clifile.c | 22 | ||||
-rw-r--r-- | source3/libsmb/clilist.c | 32 | ||||
-rw-r--r-- | source3/libsmb/climessage.c | 4 | ||||
-rw-r--r-- | source3/libsmb/clirap.c | 6 | ||||
-rw-r--r-- | source3/libsmb/clistr.c | 56 | ||||
-rw-r--r-- | source3/libsmb/clitrans.c | 4 |
7 files changed, 74 insertions, 74 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index f2f9b89ea4..46a63dc5f1 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -104,7 +104,7 @@ BOOL cli_session_setup(struct cli_state *cli, /* * Plaintext mode needed, assume plaintext supplied. */ - passlen = clistr_push(cli, pword, pass, -1, CLISTR_CONVERT|CLISTR_TERMINATE); + passlen = clistr_push(cli, pword, pass, -1, STR_CONVERT|STR_TERMINATE); fstrcpy(ntpword, ""); ntpasslen = 0; } @@ -136,7 +136,7 @@ BOOL cli_session_setup(struct cli_state *cli, p = smb_buf(cli->outbuf); memcpy(p,pword,passlen); p += passlen; - p += clistr_push(cli, p, user, -1, CLISTR_CONVERT|CLISTR_UPPER|CLISTR_TERMINATE); + p += clistr_push(cli, p, user, -1, STR_CONVERT|STR_UPPER|STR_TERMINATE); cli_setup_bcc(cli, p); } else @@ -167,10 +167,10 @@ BOOL cli_session_setup(struct cli_state *cli, p += SVAL(cli->outbuf,smb_vwv7); memcpy(p,ntpword,ntpasslen); p += SVAL(cli->outbuf,smb_vwv8); - p += clistr_push(cli, p, user, -1, CLISTR_CONVERT|CLISTR_TERMINATE|CLISTR_UPPER); - p += clistr_push(cli, p, workgroup, -1, CLISTR_CONVERT|CLISTR_TERMINATE|CLISTR_UPPER); - p += clistr_push(cli, p, "Unix", -1, CLISTR_CONVERT|CLISTR_TERMINATE); - p += clistr_push(cli, p, "Samba", -1, CLISTR_CONVERT|CLISTR_TERMINATE); + p += clistr_push(cli, p, user, -1, STR_CONVERT|STR_TERMINATE|STR_UPPER); + p += clistr_push(cli, p, workgroup, -1, STR_CONVERT|STR_TERMINATE|STR_UPPER); + p += clistr_push(cli, p, "Unix", -1, STR_CONVERT|STR_TERMINATE); + p += clistr_push(cli, p, "Samba", -1, STR_CONVERT|STR_TERMINATE); cli_setup_bcc(cli, p); } @@ -193,9 +193,9 @@ BOOL cli_session_setup(struct cli_state *cli, * info. */ char *q = smb_buf(cli->inbuf); - q += clistr_pull(cli, cli->server_os, q, sizeof(fstring), -1, CLISTR_TERMINATE|CLISTR_CONVERT); - q += clistr_pull(cli, cli->server_type, q, sizeof(fstring), -1, CLISTR_TERMINATE|CLISTR_CONVERT); - q += clistr_pull(cli, cli->server_domain, q, sizeof(fstring), -1, CLISTR_TERMINATE|CLISTR_CONVERT); + q += clistr_pull(cli, cli->server_os, q, sizeof(fstring), -1, STR_TERMINATE|STR_CONVERT); + q += clistr_pull(cli, cli->server_type, q, sizeof(fstring), -1, STR_TERMINATE|STR_CONVERT); + q += clistr_pull(cli, cli->server_domain, q, sizeof(fstring), -1, STR_TERMINATE|STR_CONVERT); } fstrcpy(cli->user_name, user); @@ -255,7 +255,7 @@ BOOL cli_send_tconX(struct cli_state *cli, /* * Non-encrypted passwords - convert to DOS codepage before using. */ - passlen = clistr_push(cli, pword, pass, -1, CLISTR_CONVERT|CLISTR_TERMINATE); + passlen = clistr_push(cli, pword, pass, -1, STR_CONVERT|STR_TERMINATE); } else { memcpy(pword, pass, passlen); } @@ -276,7 +276,7 @@ BOOL cli_send_tconX(struct cli_state *cli, p = smb_buf(cli->outbuf); memcpy(p,pword,passlen); p += passlen; - p += clistr_push(cli, p, fullshare, -1, CLISTR_CONVERT | CLISTR_TERMINATE); + p += clistr_push(cli, p, fullshare, -1, STR_CONVERT | STR_TERMINATE); fstrcpy(p, dev); p += strlen(dev)+1; cli_setup_bcc(cli, p); @@ -294,7 +294,7 @@ BOOL cli_send_tconX(struct cli_state *cli, fstrcpy(cli->dev, "A:"); if (cli->protocol >= PROTOCOL_NT1) { - clistr_pull(cli, cli->dev, smb_buf(cli->inbuf), sizeof(fstring), -1, CLISTR_TERMINATE | CLISTR_CONVERT); + clistr_pull(cli, cli->dev, smb_buf(cli->inbuf), sizeof(fstring), -1, STR_TERMINATE | STR_CONVERT); } if (strcasecmp(share,"IPC$")==0) { diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 3471ecdc67..8742a576cf 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -44,10 +44,10 @@ BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst) p = smb_buf(cli->outbuf); *p++ = 4; p += clistr_push(cli, p, fname_src, -1, - CLISTR_TERMINATE | CLISTR_CONVERT); + STR_TERMINATE | STR_CONVERT); *p++ = 4; p += clistr_push(cli, p, fname_dst, -1, - CLISTR_TERMINATE | CLISTR_CONVERT); + STR_TERMINATE | STR_CONVERT); cli_setup_bcc(cli, p); @@ -83,7 +83,7 @@ BOOL cli_unlink(struct cli_state *cli, char *fname) p = smb_buf(cli->outbuf); *p++ = 4; - p += clistr_push(cli, p, fname, -1, CLISTR_TERMINATE | CLISTR_CONVERT); + p += clistr_push(cli, p, fname, -1, STR_TERMINATE | STR_CONVERT); cli_setup_bcc(cli, p); cli_send_smb(cli); @@ -116,7 +116,7 @@ BOOL cli_mkdir(struct cli_state *cli, char *dname) p = smb_buf(cli->outbuf); *p++ = 4; - p += clistr_push(cli, p, dname, -1, CLISTR_CONVERT|CLISTR_TERMINATE); + p += clistr_push(cli, p, dname, -1, STR_CONVERT|STR_TERMINATE); cli_setup_bcc(cli, p); @@ -150,7 +150,7 @@ BOOL cli_rmdir(struct cli_state *cli, char *dname) p = smb_buf(cli->outbuf); *p++ = 4; - p += clistr_push(cli, p, dname, -1, CLISTR_TERMINATE|CLISTR_CONVERT); + p += clistr_push(cli, p, dname, -1, STR_TERMINATE|STR_CONVERT); cli_setup_bcc(cli, p); @@ -199,11 +199,11 @@ int cli_nt_create(struct cli_state *cli, char *fname, uint32 DesiredAccess) p = smb_buf(cli->outbuf); /* this alignment and termination is critical for netapp filers. Don't change */ p += clistr_align(cli, PTR_DIFF(p, cli->outbuf)); - len = clistr_push(cli, p, fname, -1, CLISTR_CONVERT); + len = clistr_push(cli, p, fname, -1, STR_CONVERT); p += len; SSVAL(cli->outbuf,smb_ntcreate_NameLength, len); /* sigh. this copes with broken netapp filer behaviour */ - p += clistr_push(cli, p, "", -1, CLISTR_TERMINATE); + p += clistr_push(cli, p, "", -1, STR_TERMINATE); cli_setup_bcc(cli, p); @@ -281,7 +281,7 @@ int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode) } p = smb_buf(cli->outbuf); - p += clistr_push(cli, p, fname, -1, CLISTR_TERMINATE | CLISTR_CONVERT); + p += clistr_push(cli, p, fname, -1, STR_TERMINATE | STR_CONVERT); cli_setup_bcc(cli, p); @@ -597,7 +597,7 @@ BOOL cli_getatr(struct cli_state *cli, char *fname, p = smb_buf(cli->outbuf); *p++ = 4; - p += clistr_push(cli, p, fname, -1, CLISTR_TERMINATE | CLISTR_CONVERT); + p += clistr_push(cli, p, fname, -1, STR_TERMINATE | STR_CONVERT); cli_setup_bcc(cli, p); @@ -648,7 +648,7 @@ BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t) p = smb_buf(cli->outbuf); *p++ = 4; - p += clistr_push(cli, p, fname, -1, CLISTR_TERMINATE | CLISTR_CONVERT); + p += clistr_push(cli, p, fname, -1, STR_TERMINATE | STR_CONVERT); *p++ = 4; cli_setup_bcc(cli, p); @@ -685,7 +685,7 @@ BOOL cli_chkpath(struct cli_state *cli, char *path) cli_setup_packet(cli); p = smb_buf(cli->outbuf); *p++ = 4; - p += clistr_push(cli, p, path2, -1, CLISTR_TERMINATE | CLISTR_CONVERT); + p += clistr_push(cli, p, path2, -1, STR_TERMINATE | STR_CONVERT); cli_setup_bcc(cli, p); diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 175673d4fe..f0ca0d5f54 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -51,7 +51,7 @@ static int interpret_long_filename(struct cli_state *cli, clistr_pull(cli, finfo->name, p+27, sizeof(finfo->name), -1, - CLISTR_TERMINATE | CLISTR_CONVERT); + STR_TERMINATE | STR_CONVERT); } return(28 + CVAL(p,26)); @@ -66,7 +66,7 @@ static int interpret_long_filename(struct cli_state *cli, clistr_pull(cli, finfo->name, p+31, sizeof(finfo->name), -1, - CLISTR_TERMINATE | CLISTR_CONVERT); + STR_TERMINATE | STR_CONVERT); } return(32 + CVAL(p,30)); @@ -82,7 +82,7 @@ static int interpret_long_filename(struct cli_state *cli, clistr_pull(cli, finfo->name, p+33, sizeof(finfo->name), -1, - CLISTR_TERMINATE | CLISTR_CONVERT); + STR_TERMINATE | STR_CONVERT); } return(SVAL(p,4)+4); @@ -97,7 +97,7 @@ static int interpret_long_filename(struct cli_state *cli, clistr_pull(cli, finfo->name, p+37, sizeof(finfo->name), -1, - CLISTR_TERMINATE | CLISTR_CONVERT); + STR_TERMINATE | STR_CONVERT); } return(SVAL(p,4)+4); @@ -135,8 +135,8 @@ static int interpret_long_filename(struct cli_state *cli, p += 2; { /* stupid NT bugs. grr */ - int flags = CLISTR_CONVERT; - if (p[1] == 0 && namelen > 1) flags |= CLISTR_UNICODE; + int flags = STR_CONVERT; + if (p[1] == 0 && namelen > 1) flags |= STR_UNICODE; clistr_pull(cli, finfo->short_name, p, sizeof(finfo->short_name), 24, flags); @@ -145,7 +145,7 @@ static int interpret_long_filename(struct cli_state *cli, clistr_pull(cli, finfo->name, p, sizeof(finfo->name), namelen, - CLISTR_CONVERT); + STR_CONVERT); return(ret); } return(SVAL(p,0)); @@ -195,8 +195,8 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, } param_len = 12+clistr_push_size(cli, NULL, mask, -1, - CLISTR_TERMINATE | - CLISTR_CONVERT); + STR_TERMINATE | + STR_CONVERT); if (First) { setup = TRANSACT2_FINDFIRST; @@ -206,7 +206,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, SSVAL(param,6,info_level); SIVAL(param,8,0); clistr_push(cli, param+12, mask, -1, - CLISTR_TERMINATE | CLISTR_CONVERT); + STR_TERMINATE | STR_CONVERT); } else { setup = TRANSACT2_FINDNEXT; SSVAL(param,0,ff_dir_handle); @@ -215,7 +215,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, SIVAL(param,6,0); /* ff_resume_key */ SSVAL(param,10,8+4+2); /* continue + resume required + close on end */ clistr_push(cli, param+12, mask, -1, - CLISTR_TERMINATE | CLISTR_CONVERT); + STR_TERMINATE | STR_CONVERT); } if (!cli_send_trans(cli, SMBtrans2, @@ -271,15 +271,15 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, clistr_pull(cli, mask, p+ff_lastname, sizeof(mask), data_len-ff_lastname, - CLISTR_TERMINATE | - CLISTR_CONVERT); + STR_TERMINATE | + STR_CONVERT); break; case 1: clistr_pull(cli, mask, p+ff_lastname+1, sizeof(mask), -1, - CLISTR_TERMINATE | - CLISTR_CONVERT); + STR_TERMINATE | + STR_CONVERT); break; } } else { @@ -392,7 +392,7 @@ int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute, p = smb_buf(cli->outbuf); *p++ = 4; - p += clistr_push(cli, p, first?mask:"", -1, CLISTR_TERMINATE|CLISTR_CONVERT); + p += clistr_push(cli, p, first?mask:"", -1, STR_TERMINATE|STR_CONVERT); *p++ = 5; if (first) { SSVAL(p,0,0); diff --git a/source3/libsmb/climessage.c b/source3/libsmb/climessage.c index 47139dcfd6..87f8175459 100644 --- a/source3/libsmb/climessage.c +++ b/source3/libsmb/climessage.c @@ -42,10 +42,10 @@ BOOL cli_message_start(struct cli_state *cli, char *host, char *username, p = smb_buf(cli->outbuf); *p++ = 4; p += clistr_push(cli, p, username, -1, - CLISTR_TERMINATE|CLISTR_CONVERT); + STR_TERMINATE|STR_CONVERT); *p++ = 4; p += clistr_push(cli, p, host, -1, - CLISTR_TERMINATE|CLISTR_CONVERT); + STR_TERMINATE|STR_CONVERT); cli_setup_bcc(cli, p); diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index 3c87464495..561d717e73 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -235,7 +235,7 @@ BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, p += 4; p += clistr_push(cli, p, workgroup, -1, - CLISTR_TERMINATE | CLISTR_CONVERT | CLISTR_ASCII); + STR_TERMINATE | STR_CONVERT | STR_ASCII); if (cli_api(cli, param, PTR_DIFF(p,param), 8, /* params, length, max */ @@ -394,7 +394,7 @@ BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, memset(p, 0, 6); SSVAL(p, 0, SMB_INFO_STANDARD); p += 6; - p += clistr_push(cli, p, fname, sizeof(pstring)-6, CLISTR_TERMINATE | CLISTR_CONVERT); + p += clistr_push(cli, p, fname, sizeof(pstring)-6, STR_TERMINATE | STR_CONVERT); param_len = PTR_DIFF(p, param); @@ -470,7 +470,7 @@ BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname, memset(p, 0, 6); SSVAL(p, 0, SMB_QUERY_FILE_ALL_INFO); p += 6; - p += clistr_push(cli, p, fname, sizeof(pstring)-6, CLISTR_TERMINATE | CLISTR_CONVERT); + p += clistr_push(cli, p, fname, sizeof(pstring)-6, STR_TERMINATE | STR_CONVERT); param_len = PTR_DIFF(p, param); diff --git a/source3/libsmb/clistr.c b/source3/libsmb/clistr.c index 1835e15971..c0e7231d7a 100644 --- a/source3/libsmb/clistr.c +++ b/source3/libsmb/clistr.c @@ -29,10 +29,10 @@ dos code page destination choosing unicode or ascii based on the cli->capabilities flag return the number of bytes occupied by the string in the destination flags can have: - CLISTR_TERMINATE means include the null termination - CLISTR_CONVERT means convert from unix to dos codepage - CLISTR_UPPER means uppercase in the destination - CLISTR_ASCII use ascii even with unicode servers + STR_TERMINATE means include the null termination + STR_CONVERT means convert from unix to dos codepage + STR_UPPER means uppercase in the destination + STR_ASCII use ascii even with unicode servers dest_len is the maximum length allowed in the destination. If dest_len is -1 then no maxiumum is used ****************************************************************************/ @@ -45,52 +45,52 @@ int clistr_push(struct cli_state *cli, void *dest, const char *src, int dest_len dest_len = sizeof(pstring); } - if (!(flags & CLISTR_ASCII) && clistr_align(cli, PTR_DIFF(dest, cli->outbuf))) { + if (!(flags & STR_ASCII) && clistr_align(cli, PTR_DIFF(dest, cli->outbuf))) { *(char *)dest = 0; dest++; dest_len--; len++; } - if ((flags & CLISTR_ASCII) || !(cli->capabilities & CAP_UNICODE)) { + if ((flags & STR_ASCII) || !(cli->capabilities & CAP_UNICODE)) { /* the server doesn't want unicode */ safe_strcpy(dest, src, dest_len); len = strlen(dest); - if (flags & CLISTR_TERMINATE) len++; - if (flags & CLISTR_CONVERT) unix_to_dos(dest,True); - if (flags & CLISTR_UPPER) strupper(dest); + if (flags & STR_TERMINATE) len++; + if (flags & STR_CONVERT) unix_to_dos(dest,True); + if (flags & STR_UPPER) strupper(dest); return len; } /* the server likes unicode. give it the works */ - if (flags & CLISTR_CONVERT) { - dos_PutUniCode(dest, src, dest_len, flags & CLISTR_TERMINATE); + if (flags & STR_CONVERT) { + dos_PutUniCode(dest, src, dest_len, flags & STR_TERMINATE); } else { ascii_to_unistr(dest, src, dest_len); } - if (flags & CLISTR_UPPER) { + if (flags & STR_UPPER) { strupper_w(dest); } len += strlen(src)*2; - if (flags & CLISTR_TERMINATE) len += 2; + if (flags & STR_TERMINATE) len += 2; return len; } /**************************************************************************** return the length that a string would occupy when copied with clistr_push() - CLISTR_TERMINATE means include the null termination - CLISTR_CONVERT means convert from unix to dos codepage - CLISTR_UPPER means uppercase in the destination + STR_TERMINATE means include the null termination + STR_CONVERT means convert from unix to dos codepage + STR_UPPER means uppercase in the destination note that dest is only used for alignment purposes. No data is written. ****************************************************************************/ int clistr_push_size(struct cli_state *cli, const void *dest, const char *src, int dest_len, int flags) { int len = strlen(src); - if (flags & CLISTR_TERMINATE) len++; - if (!(flags & CLISTR_ASCII) && (cli->capabilities & CAP_UNICODE)) len *= 2; + if (flags & STR_TERMINATE) len++; + if (!(flags & STR_ASCII) && (cli->capabilities & CAP_UNICODE)) len *= 2; - if (!(flags & CLISTR_ASCII) && dest && clistr_align(cli, PTR_DIFF(cli->outbuf, dest))) { + if (!(flags & STR_ASCII) && dest && clistr_align(cli, PTR_DIFF(cli->outbuf, dest))) { len++; } @@ -101,10 +101,10 @@ int clistr_push_size(struct cli_state *cli, const void *dest, const char *src, i copy a string from a unicode or ascii source (depending on cli->capabilities) to a char* destination flags can have: - CLISTR_CONVERT means convert from dos to unix codepage - CLISTR_TERMINATE means the string in src is null terminated - CLISTR_UNICODE means to force as unicode -if CLISTR_TERMINATE is set then src_len is ignored + STR_CONVERT means convert from dos to unix codepage + STR_TERMINATE means the string in src is null terminated + STR_UNICODE means to force as unicode +if STR_TERMINATE is set then src_len is ignored src_len is the length of the source area in bytes return the number of bytes occupied by the string in src ****************************************************************************/ @@ -121,9 +121,9 @@ int clistr_pull(struct cli_state *cli, char *dest, const void *src, int dest_len if (src_len > 0) src_len--; } - if (!(flags & CLISTR_UNICODE) && !(cli->capabilities & CAP_UNICODE)) { + if (!(flags & STR_UNICODE) && !(cli->capabilities & CAP_UNICODE)) { /* the server doesn't want unicode */ - if (flags & CLISTR_TERMINATE) { + if (flags & STR_TERMINATE) { safe_strcpy(dest, src, dest_len); len = strlen(src)+1; } else { @@ -132,11 +132,11 @@ int clistr_pull(struct cli_state *cli, char *dest, const void *src, int dest_len memcpy(dest, src, len); dest[len] = 0; } - if (flags & CLISTR_CONVERT) dos_to_unix(dest,True); + if (flags & STR_CONVERT) dos_to_unix(dest,True); return len; } - if (flags & CLISTR_TERMINATE) { + if (flags & STR_TERMINATE) { unistr_to_ascii(dest, src, dest_len); len = strlen(dest)*2 + 2; } else { @@ -149,7 +149,7 @@ int clistr_pull(struct cli_state *cli, char *dest, const void *src, int dest_len *dest++ = 0; len = src_len; } - if (flags & CLISTR_CONVERT) dos_to_unix(dest,True); + if (flags & STR_CONVERT) dos_to_unix(dest,True); return len; } diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c index 630e9f93c0..0bbe7c6dae 100644 --- a/source3/libsmb/clitrans.c +++ b/source3/libsmb/clitrans.c @@ -53,7 +53,7 @@ BOOL cli_send_trans(struct cli_state *cli, int trans, if (pipe_name) { pipe_name_len = clistr_push_size(cli, smb_buf(cli->outbuf), pipe_name, -1, - CLISTR_TERMINATE); + STR_TERMINATE); } outparam = smb_buf(cli->outbuf)+(trans==SMBtrans ? pipe_name_len : 3); @@ -76,7 +76,7 @@ BOOL cli_send_trans(struct cli_state *cli, int trans, SSVAL(cli->outbuf,smb_setup+i*2,setup[i]); p = smb_buf(cli->outbuf); if (trans==SMBtrans) { - clistr_push(cli, p, pipe_name, -1, CLISTR_TERMINATE); + clistr_push(cli, p, pipe_name, -1, STR_TERMINATE); } else { *p++ = 0; /* put in a null smb_name */ *p++ = 'D'; *p++ = ' '; /* observed in OS/2 */ |