5 #include "libsmbclient.h"
6 #include "get_auth_data_fn.h"
20 int main(int argc
, const char *argv
[])
24 static char *the_acl
= NULL
;
29 if (smbc_init(get_auth_data_fn
, debug
) != 0)
31 printf("Could not initialize smbc_ library\n");
35 SMBCCTX
*context
= smbc_set_context(NULL
);
36 smbc_setOptionFullTimeNames(context
, 1);
38 the_acl
= strdup("system.nt_sec_desc.*");
39 ret
= smbc_getxattr(argv
[1], the_acl
, value
, sizeof(value
));
42 printf("Could not get attributes for [%s] %d: %s\n",
43 argv
[1], errno
, strerror(errno
));
47 printf("Attributes for [%s] are:\n%s\n", argv
[1], value
);
50 debugstr
= "set attributes (1st time)";
52 ret
= smbc_setxattr(argv
[1], the_acl
, value
, strlen(value
), flags
);
55 printf("Could not %s for [%s] %d: %s\n",
56 debugstr
, argv
[1], errno
, strerror(errno
));
61 debugstr
= "set attributes (2nd time)";
63 ret
= smbc_setxattr(argv
[1], the_acl
, value
, strlen(value
), flags
);
66 printf("Could not %s for [%s] %d: %s\n",
67 debugstr
, argv
[1], errno
, strerror(errno
));