struct perm_value *v;
ZERO_STRUCTP(ace);
- p = strchr(str,':');
+ p = strchr_m(str,':');
if (!p) return False;
*p = '\0';
p++;
/* Only numeric form accepted for flags at present */
- if (!(next_token(NULL, tok, "/", sizeof(fstring)) &&
+ if (!(next_token(&p, tok, "/", sizeof(fstring)) &&
sscanf(tok, "%i", &aflags))) {
return False;
}
- if (!next_token(NULL, tok, "/", sizeof(fstring))) {
+ if (!next_token(&p, tok, "/", sizeof(fstring))) {
return False;
}
char *p = str;
fstring tok;
SEC_DESC *ret;
- unsigned sd_size;
+ size_t sd_size;
DOM_SID *grp_sid=NULL, *owner_sid=NULL;
SEC_ACL *dacl=NULL;
int revision=1;
{
struct cli_state *c;
struct nmb_name called, calling;
- char *server_n;
struct in_addr ip;
extern struct in_addr ipzero;
extern pstring global_myname;
fstrcpy(server,share+2);
- share = strchr(server,'\\');
+ share = strchr_m(server,'\\');
if (!share) return NULL;
*share = 0;
share++;
- server_n = server;
-
ip = ipzero;
make_nmb_name(&calling, global_myname, 0x0);
ip = ipzero;
/* have to open a new connection */
- if (!(c=cli_initialise(NULL)) || (cli_set_port(c, 139) == 0) ||
- !cli_connect(c, server_n, &ip)) {
- DEBUG(0,("Connection to %s failed\n", server_n));
+ if (!(c=cli_initialise(NULL)) || !cli_connect(c, server, &ip)) {
+ DEBUG(0,("Connection to %s failed\n", server));
cli_shutdown(c);
safe_free(c);
return NULL;
\t-G username change group ownership of a file\n\
\t-n don't resolve sids or masks to names\n\
\t-h print help\n\
+\t-d debuglevel set debug output level\n\
+\t-U username user to autheticate as\n\
\n\
The username can be of the form username%%password or\n\
workgroup\\username%%password.\n\n\
char *p;
static pstring servicesf = CONFIGFILE;
struct cli_state *cli=NULL;
- enum acl_mode mode = 0;
+ enum acl_mode mode = SMB_ACL_SET;
char *the_acl = NULL;
enum chown_mode change_mode = REQUEST_NONE;
int result;
argv += 2;
TimeInit();
- charset_initialise();
lp_load(servicesf,True,False,False);
- codepage_initialise(lp_client_code_page());
load_interfaces();
if (getenv("USER")) {
pstrcpy(username,getenv("USER"));
- if ((p=strchr(username,'%'))) {
+ if ((p=strchr_m(username,'%'))) {
*p = 0;
pstrcpy(password,p+1);
got_pass = True;
- memset(strchr(getenv("USER"), '%') + 1, 'X',
+ memset(strchr_m(getenv("USER"), '%') + 1, 'X',
strlen(password));
}
}
- while ((opt = getopt(argc, argv, "U:nhS:D:A:M:C:G:t")) != EOF) {
+ while ((opt = getopt(argc, argv, "U:nhS:D:A:M:C:G:td:")) != EOF) {
switch (opt) {
case 'U':
pstrcpy(username,optarg);
- p = strchr(username,'%');
+ p = strchr_m(username,'%');
if (p) {
*p = 0;
pstrcpy(password, p+1);
talloc_destroy(ctx);
exit(EXIT_PARSE_ERROR);
+ case 'd':
+ DEBUGLEVEL = atoi(optarg);
+ break;
+
default:
printf("Unknown option %c (%d)\n", (char)opt, opt);
talloc_destroy(ctx);