5 #include <libsmbclient.h>
6 #include "get_auth_data_fn.h"
9 int main(int argc, char * argv[])
13 const char * pSmbPath = NULL;
18 pSmbPath = "smb://RANDOM/Public/small";
27 mode = (int) strtol(argv[2], NULL, 8);
32 "%s [ smb://path/to/file [ octal_mode ] ]\n",
37 smbc_init(get_auth_data_fn, debug);
39 if (smbc_stat(pSmbPath, &st) < 0)
45 printf("\nBefore chmod: mode = %04o\n", st.st_mode);
47 if (smbc_chmod(pSmbPath, mode) < 0)
53 if (smbc_stat(pSmbPath, &st) < 0)
59 printf("After chmod: mode = %04o\n", st.st_mode);