5 #include <libsmbclient.h>
6 #include "get_auth_data_fn.h"
9 int main(int argc
, char * argv
[])
15 char * pSmbPath
= NULL
;
20 pSmbPath
= "smb://RANDOM/Public/small";
29 mode
= (int) strtol(argv
[2], NULL
, 8);
34 "%s [ smb://path/to/file [ octal_mode ] ]\n",
39 smbc_init(get_auth_data_fn
, debug
);
41 if (smbc_stat(pSmbPath
, &st
) < 0)
47 printf("\nBefore chmod: mode = %04o\n", st
.st_mode
);
49 if (smbc_chmod(pSmbPath
, mode
) < 0)
55 if (smbc_stat(pSmbPath
, &st
) < 0)
61 printf("After chmod: mode = %04o\n", st
.st_mode
);