The Samba-Bugzilla – Attachment 2999 Details for
Bug 5105
corrupted gencache.tdb causes an infinite loop in libsmbclient
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
libsmbclient test application
test5.c (text/plain), 1.56 KB, created by
Mikhail Kshevetskiy (dead mail account)
on 2007-11-25 03:00:17 UTC
(
hide
)
Description:
libsmbclient test application
Filename:
MIME Type:
Creator:
Mikhail Kshevetskiy (dead mail account)
Created:
2007-11-25 03:00:17 UTC
Size:
1.56 KB
patch
obsolete
>#include <errno.h> >#include <stdio.h> >#include <stdlib.h> >#include <malloc.h> >#include <string.h> >#include <libsmbclient.h> > >int debuglevel = 10; >char *workgroup = ""; >char *username = ""; >char *password = ""; > >void smbc_auth_fn( > const char *server, > const char *share, > char *wrkgrp, int wrkgrplen, > char *user, int userlen, > char *passwd, int passwdlen){ > > (void) server; > (void) share; > (void) wrkgrp; > (void) wrkgrplen; > >// strncpy(wrkgrp, workgroup, wrkgrplen - 1); wrkgrp[wrkgrplen - 1] = 0; >// strncpy(user, username, userlen - 1); user[userlen - 1] = 0; >// strncpy(passwd, password, passwdlen - 1); passwd[passwdlen - 1] = 0; >} > >int main(int argc, char *argv[]){ > SMBCCTX *ctx; > SMBCFILE *fd; > struct smbc_dirent *dirent; > > if (argc < 2){ > printf("usage: %s smb://computer[/share]\n", argv[0]); > return 0; > } > > if ((ctx = smbc_new_context()) == NULL) return 1; > ctx->debug = debuglevel; > ctx->callbacks.auth_fn = smbc_auth_fn; > if (smbc_init_context(ctx) == NULL){ > smbc_free_context(ctx, 1); > return 1; > } > > if ((fd = ctx->opendir(ctx, argv[1])) == NULL) return 1; > while ((dirent = ctx->readdir(ctx, fd)) != NULL){ > if (strcmp(dirent->name, "") == 0) continue; > if (strcmp(dirent->name, ".") == 0) continue; > if (strcmp(dirent->name, "..") == 0) continue; > if (dirent->smbc_type != SMBC_WORKGROUP) continue; > > printf(" %s\n", dirent->name); > } > ctx->close_fn(ctx, fd); > ctx->callbacks.purge_cached_fn(ctx); > smbc_free_context(ctx, 1); > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5105
:
2997
|
2998
| 2999 |
3000