diff options
author | Gerald Carter <jerry@samba.org> | 2005-03-23 15:55:23 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2005-03-23 15:55:23 +0000 |
commit | ef0f95ccaa13c154bab4219c96a5baeb4411be63 (patch) | |
tree | e4a50655d97642111dc0bd4de94188d3a8720db2 | |
parent | 59e45bb679682c32d1aad1cc229fa2856a5adf38 (diff) | |
download | samba-ef0f95ccaa13c154bab4219c96a5baeb4411be63.tar.gz |
r5995: merging more changes from 3.0 tree.
Now just have to work on the acl bug (#2521) and we're
ready to ship.
svn merge -r5945:5946 $SVNURL/branches/SAMBA_3_0
svn merge -r5945:5946 $SVNURL/branches/SAMBA_3_0
svn merge -r5954:5955 $SVNURL/branches/SAMBA_3_0
svn merge -r5965:5967 $SVNURL/branches/SAMBA_3_0
svn merge -r5968:5970 $SVNURL/branches/SAMBA_3_0
svn merge -r5970:5971 $SVNURL/branches/SAMBA_3_0
svn merge -r5971:5973 $SVNURL/branches/SAMBA_3_0
svn merge -r5973:5975 $SVNURL/branches/SAMBA_3_0
svn merge -r5975:5979 $SVNURL/branches/SAMBA_3_0
svn merge -r5979:5981 $SVNURL/branches/SAMBA_3_0
svn merge -r5981:5991 $SVNURL/branches/SAMBA_3_0
svn merge -r5993:5994 $SVNURL/branches/SAMBA_3_0
-rw-r--r-- | source/client/client.c | 1 | ||||
-rw-r--r-- | source/libsmb/cliconnect.c | 8 | ||||
-rw-r--r-- | source/libsmb/clidfs.c | 2 | ||||
-rw-r--r-- | source/libsmb/clilist.c | 45 | ||||
-rw-r--r-- | source/rpc_client/cli_spoolss.c | 2 | ||||
-rw-r--r-- | source/rpc_parse/parse_spoolss.c | 2 | ||||
-rw-r--r-- | source/utils/net_ads.c | 7 | ||||
-rw-r--r-- | source/utils/net_rpc_printer.c | 2 |
8 files changed, 39 insertions, 30 deletions
diff --git a/source/client/client.c b/source/client/client.c index 9a09d50cc08..78a1fc6b8ad 100644 --- a/source/client/client.c +++ b/source/client/client.c @@ -219,6 +219,7 @@ static int do_dskattr(void) if ( !cli_resolve_path( "", cli, cur_dir, &targetcli, targetpath ) ) { d_printf("Error in dskattr: %s\n", cli_errstr(cli)); + return 1; } if (!cli_dskattr(targetcli, &bsize, &total, &avail)) { diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c index aa37a29391c..dce51a2c8bb 100644 --- a/source/libsmb/cliconnect.c +++ b/source/libsmb/cliconnect.c @@ -978,8 +978,12 @@ BOOL cli_send_tconX(struct cli_state *cli, cli->win95 = True; } - if ( cli->protocol >= PROTOCOL_LANMAN2 ) - cli->dfsroot = (SVAL( cli->inbuf, smb_vwv2 ) & SMB_SHARE_IN_DFS); + /* Make sure that we have the optional support 16-bit field. WCT > 2 */ + /* Avoids issues when connecting to Win9x boxes sharing files */ + + cli->dfsroot = False; + if ( (CVAL(cli->inbuf, smb_wct))>2 && cli->protocol >= PROTOCOL_LANMAN2 ) + cli->dfsroot = (SVAL( cli->inbuf, smb_vwv2 ) & SMB_SHARE_IN_DFS) ? True : False; cli->cnum = SVAL(cli->inbuf,smb_tid); return True; diff --git a/source/libsmb/clidfs.c b/source/libsmb/clidfs.c index dcffdf42fe4..21046cd380b 100644 --- a/source/libsmb/clidfs.c +++ b/source/libsmb/clidfs.c @@ -595,7 +595,7 @@ BOOL cli_resolve_path( const char *mountpt, struct cli_state *rootcli, const cha /* we got an error, check for DFS referral */ - if ( !cli_dfs_check_error(rootcli) ) + if ( !cli_dfs_check_error(rootcli) ) return False; /* check for the referral */ diff --git a/source/libsmb/clilist.c b/source/libsmb/clilist.c index dcac17d24a2..0f1b9efed0e 100644 --- a/source/libsmb/clilist.c +++ b/source/libsmb/clilist.c @@ -29,7 +29,7 @@ by NT and 2 is used by OS/2 ****************************************************************************/ -static int interpret_long_filename(struct cli_state *cli, +static size_t interpret_long_filename(struct cli_state *cli, int level,char *p,file_info *finfo) { extern file_info def_finfo; @@ -130,12 +130,12 @@ static int interpret_long_filename(struct cli_state *cli, clistr_pull(cli, finfo->name, p, sizeof(finfo->name), namelen, 0); - return SVAL(base, 0); + return (size_t)IVAL(base, 0); } } DEBUG(1,("Unknown long filename format %d\n",level)); - return(SVAL(p,0)); + return (size_t)IVAL(base,0); } /**************************************************************************** @@ -168,6 +168,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, unsigned int param_len, data_len; uint16 setup; pstring param; + const char *mnt; /* NT uses 260, OS/2 uses 2. Both accept 1. */ info_level = (cli->capabilities&CAP_NT_SMBS)?260:1; @@ -205,7 +206,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, SIVAL(param,6,0); /* ff_resume_key */ /* NB. *DON'T* use continue here. If you do it seems that W2K and bretheren can miss filenames. Use last filename continue instead. JRA */ - SSVAL(param,4,(FLAG_TRANS2_FIND_REQUIRE_RESUME|FLAG_TRANS2_FIND_CLOSE_IF_END)); /* resume required + close on end */ + SSVAL(param,10,(FLAG_TRANS2_FIND_REQUIRE_RESUME|FLAG_TRANS2_FIND_CLOSE_IF_END)); /* resume required + close on end */ p = param+12; p += clistr_push(cli, param+12, mask, sizeof(param)-12, STR_TERMINATE); @@ -270,25 +271,14 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, p = rdata; /* we might need the lastname for continuations */ - - /* and add them to the dirlist pool */ - tdl = SMB_REALLOC(dirlist,dirlist_len + data_len); - - if (!tdl) { - DEBUG(0,("cli_list_new: Failed to expand dirlist\n")); - break; - } else { - dirlist = tdl; - } - - /* put in a length for the last entry, to ensure we can chain entries - into the next packet */ - for (p2=p,i=0;i<(ff_searchcount-1);i++) { + for (p2=p,i=0;i<ff_searchcount;i++) { + if ((info_level == 260) && (i == ff_searchcount-1)) { + /* Last entry - fixup the last offset length. */ + SIVAL(p2,0,PTR_DIFF((rdata + data_len),p2)); + } p2 += interpret_long_filename(cli,info_level,p2,&finfo); } - SSVAL(p2,0,data_len - PTR_DIFF(p2,p)); - /* we might need the lastname for continuations */ if (ff_lastname > 0) { pstrcpy(mask, finfo.name); } else { @@ -296,6 +286,16 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, } /* grab the data for later use */ + /* and add them to the dirlist pool */ + tdl = SMB_REALLOC(dirlist,dirlist_len + data_len); + + if (!tdl) { + DEBUG(0,("cli_list_new: Failed to expand dirlist\n")); + break; + } else { + dirlist = tdl; + } + memcpy(dirlist+dirlist_len,p,data_len); dirlist_len += data_len; @@ -313,11 +313,10 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, First = False; } + mnt = cli_cm_get_mntpoint( cli ); + for (p=dirlist,i=0;i<total_received;i++) { - const char *mnt = cli_cm_get_mntpoint( cli ); - p += interpret_long_filename(cli,info_level,p,&finfo); - fn( mnt,&finfo, Mask, state ); } diff --git a/source/rpc_client/cli_spoolss.c b/source/rpc_client/cli_spoolss.c index 8094b2bf087..6ce74fed665 100644 --- a/source/rpc_client/cli_spoolss.c +++ b/source/rpc_client/cli_spoolss.c @@ -1089,7 +1089,7 @@ WERROR cli_spoolss_addprinterex (struct cli_state *cli, TALLOC_CTX *mem_ctx, */ WERROR cli_spoolss_deleteprinterdriverex(struct cli_state *cli, TALLOC_CTX *mem_ctx, const char *arch, - const char *driver, uint32 version) + const char *driver, int version) { prs_struct qbuf, rbuf; SPOOL_Q_DELETEPRINTERDRIVEREX q; diff --git a/source/rpc_parse/parse_spoolss.c b/source/rpc_parse/parse_spoolss.c index 2e5244d6532..dc419a73b5f 100644 --- a/source/rpc_parse/parse_spoolss.c +++ b/source/rpc_parse/parse_spoolss.c @@ -1226,7 +1226,7 @@ BOOL make_spoolss_q_deleteprinterdriverex( TALLOC_CTX *mem_ctx, const char *server, const char* arch, const char* driver, - uint32 version) + int version) { DEBUG(5,("make_spoolss_q_deleteprinterdriverex\n")); diff --git a/source/utils/net_ads.c b/source/utils/net_ads.c index 72e8f70a7d8..9c00f05bfbb 100644 --- a/source/utils/net_ads.c +++ b/source/utils/net_ads.c @@ -94,7 +94,12 @@ static int net_ads_info(int argc, const char **argv) { ADS_STRUCT *ads; - ads = ads_init(NULL, opt_target_workgroup, opt_host); + /* if netbios is disabled we have to default to the realm from smb.conf */ + + if ( lp_disable_netbios() && *lp_realm() ) + ads = ads_init(lp_realm(), opt_target_workgroup, opt_host); + else + ads = ads_init(NULL, opt_target_workgroup, opt_host); if (ads) { ads->auth.flags |= ADS_AUTH_NO_BIND; diff --git a/source/utils/net_rpc_printer.c b/source/utils/net_rpc_printer.c index 4b53dec36e9..9f5730994e6 100644 --- a/source/utils/net_rpc_printer.c +++ b/source/utils/net_rpc_printer.c @@ -466,7 +466,7 @@ NTSTATUS net_copy_file(TALLOC_CTX *mem_ctx, if (!src_name || !dst_name) goto out; - if (cli_share_dst == NULL || cli_share_dst == NULL) + if (cli_share_src == NULL || cli_share_dst == NULL) goto out; |