1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-09 00:23:50 +03:00

The latest changes to libsmbclient ...

It can now do a directory listing for workgroups, servers, and shares, and,
with a bit more effort, it will be able to list directories and files.

I also does not request a username and password for the IPC$ share, but it
should if the first attempt to connect fails.
This commit is contained in:
Richard Sharpe
-
parent d45e667a74
commit 38ff91c505
3 changed files with 596 additions and 24 deletions

View File

@@ -29,7 +29,28 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#define SMBC_MAX_NAME 1023
struct smbc_dirent {
uint smbc_type; /* Type of entity, see below */
uint namelen;
uint commentlen;
char *comment; /* Points to the comment futher down */
char name[1];
};
#define SMBC_WORKGROUP 1
#define SMBC_SERVER 2
#define SMBC_FILE_SHARE 3
#define SMBC_PRINTER_SHARE 4
#define SMBC_COMMS_SHARE 5
#define SMBC_IPC_SHARE 6
#define SMBC_DIR 7
#define SMBC_FILE 8
#define SMBC_LINK 9
#define SMBC_FILE_MODE (S_IFREG | 0444)
#define SMBC_DIR_MODE (S_IFDIR | 0555)
@@ -133,7 +154,7 @@ int smbc_closedir(int fd);
* Get a directory entry
*/
int smbc_getdents(unsigned int fd, struct dirent *dirp, int count);
int smbc_getdents(unsigned int fd, struct smbc_dirent *dirp, int count);
/*
* Create a directory on a server, share, dir in fname URL