The Samba-Bugzilla – Attachment 3328 Details for
Bug 5475
SID to owner name mapping fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Test "c" code
test.c (text/plain), 1.92 KB, created by
Veeral Shah
on 2008-06-03 02:15:52 UTC
(
hide
)
Description:
Test "c" code
Filename:
MIME Type:
Creator:
Veeral Shah
Created:
2008-06-03 02:15:52 UTC
Size:
1.92 KB
patch
obsolete
>#include <stdlib.h> >#include <string.h> >#include <errno.h> >#include <popt.h> >#include "libsmbclient.h" >#include <sys/types.h> >#include <sys/stat.h> >#include <unistd.h> > >static void >get_auth_data_fn(const char * pServer, > const char * pShare, > char * pWorkgroup, > int maxLenWorkgroup, > char * pUsername, > int maxLenUsername, > char * pPassword, > int maxLenPassword) >{ > > > strcpy(pWorkgroup, "Workgroup"); > strcpy(pUsername, "test"); > strcpy(pPassword, "test"); > > return; >} > > >int main(int argc, const char *argv[]) >{ > int debug = 10; > char smbfile[1024]; > static char *the_acl = NULL; > int ret; > char value[1024]; > char name[256]= {} , *ptr; > struct stat st; > int inode_number; > SMBCCTX *context; > > if (argc != 2) { > fprintf(stderr , "%s <smbfile>",argv[0]); > exit(1); > } > > strcpy(smbfile,argv[1]); > > > if (smbc_init(get_auth_data_fn, debug) != 0) { > printf("Could not initialize smbc_ library\n"); > return 1; > } > > smbc_stat(smbfile, &st); > > the_acl = strdup("system.nt_sec_desc.owner+"); > ret = smbc_getxattr(smbfile, the_acl, value, sizeof(value)); > if (ret < 0) { > printf("Could not get attributes for [%s] %d: %s\n", > smbfile, errno, strerror(errno)); > return 1; > } > printf("OWNER NAME: %s \n\n", value); > smbc_stat(smbfile, &st); > > the_acl = strdup("system.nt_sec_desc.owner+"); > ret = smbc_getxattr(smbfile, the_acl, value, sizeof(value)); > if (ret < 0) { > printf("Could not get attributes for [%s] %d: %s\n", > smbfile, errno, strerror(errno)); > return 1; > } > printf("OWNER NAME: %s \n\n", value); > > smbc_stat(smbfile, &st); > smbc_stat(smbfile, &st); > smbc_stat(smbfile, &st); > > memset(value, 0, sizeof(value)); > the_acl = strdup("system.nt_sec_desc.owner+"); > ret = smbc_getxattr(smbfile, the_acl, value, sizeof(value)); > if (ret < 0) { > printf("Could not get attributes for [%s] %d: %s\n", > smbfile, errno, strerror(errno)); > return 1; > } > printf("OWNER NAME: %s \n\n", value); > > 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 5475
: 3328 |
3329