search for: smbc_dirent

Displaying 5 results from an estimated 5 matches for "smbc_dirent".

2002 Nov 28
0
problem with smbc_init in libsmbclient
...ets(temp, sizeof(temp), stdin); if (temp[strlen(temp) - 1] == 0x0a) /* A new line? */ temp[strlen(temp) - 1] = 0x00; if (temp[0]) strncpy(password, temp, pwmaxlen - 1); } int main(int argc, char *argv[]) { int err, fd, dh; //char dirbuf[512]; //char *dirp; struct stat st1, st2; struct smbc_dirent dirp[128]; char path[]="smb://cherban/"; err = smbc_init(auth_fn, 10); if (err < 0) { fprintf(stderr, "Initializing the smbclient library : %s\n", strerror(errno)); } dh=smbc_opendir(path); if (dh <0) { fprintf(stderr, "Could not open directory: %s: %s\n",...
2015 Apr 02
2
SMBC_LINK directory entity type
Hello, I'm trying to write a smb client using the libsmbclient library but I don't know how to handle the SMBC_LINK type of smbc_dirent, which is defined in libsmbclient.h. I've grepped through the samba source code and it doesn't seem to appear anywhere except the mentioned header and examples. Can I safely assume there are no files/directories of such a type? Thanks, Mariusz
2002 Nov 29
0
libsmbclient problem
...( workgroup[0] != '\0' ) { memset( workgroup, '\0', wglen ); snprintf( workgroup, wglen-1, "%s", "RATNET" ); } } /* main function */ int main( int argc, char** argv ) { char const* smburl = argc > 1 ? argv[1] : "smb://RATNET/"; struct smbc_dirent* dirp; int handle; /* open libsmbclient library... */ if( smbc_init( auth_func, 10 ) < 0 ) { perror( "smbc_init" ); return 1; } /* open directory */ handle = smbc_opendir( smburl ); if( handle < 0 ) { perror( "smbc_opendir" ); return 1; }...
2002 Nov 27
6
"attrib +R myowndir" fails to write-protect my own dir
...f them. The only other suspect diagnostic was for functions "smbc_telldir" and "smbc_lseekdir" in "libsmb/libsmbclient.c", lines 2279 and 2320: cast to pointer from integer of different size, here the lines: 2279 return (off_t)fe->dir_next; and 2320 struct smbc_dirent *dirent = (struct smbc_dirent *)offset; Setting R-flag on a regular file works, but setting H(idden) or A(rchive) flag doesn't. If "inherit permissions" is changed to "Yes" then not even a regular file can be write-protected but then H and A flags can be set and cleared....
2007 Aug 21
3
Segment violation during the list of directory with smbc_readdir
Dear samba, I have a small piece of code that crashes on Samba 3.0.5: int main() { int smbdh; struct smbc_dirent *smbdi; char *smb_url = "smb://SERVER/Archive/NOT EMPTY"; if(smbc_init(get_auth, 0) < 0) { fprintf(stderr, "error initializing libsmbclient: %s\n", strerror(errno)); return -1; } if((smbdh = smbc_opendir(smb_url))...