summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-09-10 01:58:51 +0000
committerJeremy Allison <jra@samba.org>2002-09-10 01:58:51 +0000
commitdf920a60b5f207149cbc9dcb63d406abb0d0490c (patch)
treec2ef644a20a1675e8203949e3b6f023cf5f04c20 /source3/libsmb
parent8de41d59482e7d66824c4a69563875d768f1f100 (diff)
downloadsamba-df920a60b5f207149cbc9dcb63d406abb0d0490c.tar.gz
samba-df920a60b5f207149cbc9dcb63d406abb0d0490c.tar.bz2
samba-df920a60b5f207149cbc9dcb63d406abb0d0490c.zip
Added final Steve French patch for "required" attributes with old
dir listings. Added regression test in smbtorture (in HEAD) also. Jeremy. (This used to be commit 3c9d24d7c3bad2beb641880a97f0eda5cd3e4ec7)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clilist.c48
1 files changed, 23 insertions, 25 deletions
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 17a759f9e3..3eacc25380 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -22,13 +22,13 @@
#include "includes.h"
-
/****************************************************************************
-interpret a long filename structure - this is mostly guesses at the moment
-The length of the structure is returned
-The structure of a long filename depends on the info level. 260 is used
-by NT and 2 is used by OS/2
+ Interpret a long filename structure - this is mostly guesses at the moment.
+ The length of the structure is returned
+ The structure of a long filename depends on the info level. 260 is used
+ by NT and 2 is used by OS/2
****************************************************************************/
+
static int interpret_long_filename(struct cli_state *cli,
int level,char *p,file_info *finfo)
{
@@ -41,8 +41,7 @@ static int interpret_long_filename(struct cli_state *cli,
memcpy(finfo,&def_finfo,sizeof(*finfo));
- switch (level)
- {
+ switch (level) {
case 1: /* OS/2 understands this */
/* these dates are converted to GMT by
make_unix_date */
@@ -126,16 +125,16 @@ static int interpret_long_filename(struct cli_state *cli,
namelen, 0);
return SVAL(base, 0);
}
- }
+ }
DEBUG(1,("Unknown long filename format %d\n",level));
return(SVAL(p,0));
}
-
/****************************************************************************
- do a directory listing, calling fn on each file found
- ****************************************************************************/
+ Do a directory listing, calling fn on each file found.
+****************************************************************************/
+
int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
void (*fn)(file_info *, const char *, void *), void *state)
{
@@ -307,12 +306,11 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
return(total_received);
}
-
-
/****************************************************************************
-interpret a short filename structure
-The length of the structure is returned
+ Interpret a short filename structure.
+ The length of the structure is returned.
****************************************************************************/
+
static int interpret_short_filename(struct cli_state *cli, char *p,file_info *finfo)
{
extern file_info def_finfo;
@@ -334,10 +332,11 @@ static int interpret_short_filename(struct cli_state *cli, char *p,file_info *fi
/****************************************************************************
- do a directory listing, calling fn on each file found
- this uses the old SMBsearch interface. It is needed for testing Samba,
- but should otherwise not be used
- ****************************************************************************/
+ Do a directory listing, calling fn on each file found.
+ this uses the old SMBsearch interface. It is needed for testing Samba,
+ but should otherwise not be used.
+****************************************************************************/
+
int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
void (*fn)(file_info *, const char *, void *), void *state)
{
@@ -453,16 +452,15 @@ int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
return(num_received);
}
-
/****************************************************************************
- do a directory listing, calling fn on each file found
- this auto-switches between old and new style
- ****************************************************************************/
+ Do a directory listing, calling fn on each file found.
+ This auto-switches between old and new style.
+****************************************************************************/
+
int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
void (*fn)(file_info *, const char *, void *), void *state)
{
- if (cli->protocol <= PROTOCOL_LANMAN1) {
+ if (cli->protocol <= PROTOCOL_LANMAN1)
return cli_list_old(cli, Mask, attribute, fn, state);
- }
return cli_list_new(cli, Mask, attribute, fn, state);
}