Changeset 221 for branches/samba-3.3.x/source/utils
- Timestamp:
- May 24, 2009, 7:17:10 AM (16 years ago)
- Location:
- branches/samba-3.3.x/source/utils
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/utils/net_conf.c
r206 r221 577 577 } 578 578 579 if (getpwnam(sharename)) {580 d_fprintf(stderr, "ERROR: share name %s is already a valid "581 "system user name.\n", sharename);582 goto done;583 }584 585 579 if (strequal(sharename, GLOBAL_NAME)) { 586 580 d_fprintf(stderr, -
branches/samba-3.3.x/source/utils/net_rpc.c
r206 r221 4379 4379 int ret; 4380 4380 bool r; 4381 ENUM_HND hnd;4382 4381 uint32 i; 4383 4382 FILE *f; … … 4411 4410 for (i=0; i<num_tokens; i++) 4412 4411 collect_alias_memberships(&tokens[i].token); 4413 4414 init_enum_hnd(&hnd, 0);4415 4412 4416 4413 share_list.num_shares = 0; -
branches/samba-3.3.x/source/utils/net_rpc_join.c
r206 r221 244 244 CHECK_RPC_ERR(rpccli_samr_Connect2(pipe_hnd, mem_ctx, 245 245 pipe_hnd->desthost, 246 SEC_RIGHTS_MAXIMUM_ALLOWED, 246 SAMR_ACCESS_ENUM_DOMAINS 247 | SAMR_ACCESS_OPEN_DOMAIN, 247 248 &sam_pol), 248 249 "could not connect to SAM database"); … … 251 252 CHECK_RPC_ERR(rpccli_samr_OpenDomain(pipe_hnd, mem_ctx, 252 253 &sam_pol, 253 SEC_RIGHTS_MAXIMUM_ALLOWED, 254 SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1 255 | SAMR_DOMAIN_ACCESS_CREATE_USER 256 | SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, 254 257 domain_sid, 255 258 &domain_pol), … … 483 486 int net_rpc_testjoin(struct net_context *c, int argc, const char **argv) 484 487 { 485 char *domain = smb_xstrdup(c->opt_target_workgroup);486 488 NTSTATUS nt_status; 487 489 … … 494 496 495 497 /* Display success or failure */ 496 nt_status = net_rpc_join_ok(c, domain, NULL, NULL);498 nt_status = net_rpc_join_ok(c, c->opt_target_workgroup, NULL, NULL); 497 499 if (!NT_STATUS_IS_OK(nt_status)) { 498 500 fprintf(stderr,"Join to domain '%s' is not valid: %s\n", 499 domain, nt_errstr(nt_status)); 500 free(domain); 501 c->opt_target_workgroup, nt_errstr(nt_status)); 501 502 return -1; 502 503 } 503 504 504 printf("Join to '%s' is OK\n",domain); 505 free(domain); 505 printf("Join to '%s' is OK\n", c->opt_target_workgroup); 506 506 return 0; 507 507 } -
branches/samba-3.3.x/source/utils/ntlm_auth.c
r206 r221 524 524 static const char zeros[16] = { 0, }; 525 525 NTSTATUS nt_status; 526 char *error_string ;526 char *error_string = NULL; 527 527 uint8 lm_key[8]; 528 528 uint8 user_sess_key[16]; 529 char *unix_name ;529 char *unix_name = NULL; 530 530 531 531 nt_status = contact_winbind_auth_crap(ntlmssp_state->user, ntlmssp_state->domain, … … 549 549 } 550 550 ntlmssp_state->auth_context = talloc_strdup(ntlmssp_state->mem_ctx, unix_name); 551 SAFE_FREE(unix_name);552 551 } else { 553 552 DEBUG(NT_STATUS_EQUAL(nt_status, NT_STATUS_ACCESS_DENIED) ? 0 : 3, … … 558 557 ntlmssp_state->auth_context = NULL; 559 558 } 559 560 SAFE_FREE(error_string); 561 SAFE_FREE(unix_name); 560 562 return nt_status; 561 563 } … … 1815 1817 x_fprintf(x_stdout, "Authenticated: No\n"); 1816 1818 x_fprintf(x_stdout, "Authentication-Error: %s\n.\n", error_string); 1817 SAFE_FREE(error_string);1818 1819 } else { 1819 1820 static char zeros[16]; … … 1843 1844 } 1844 1845 } 1846 SAFE_FREE(error_string); 1845 1847 } 1846 1848 /* clear out the state */ -
branches/samba-3.3.x/source/utils/profiles.c
r206 r221 58 58 static bool swap_sid_in_acl( SEC_DESC *sd, DOM_SID *s1, DOM_SID *s2 ) 59 59 { 60 SEC_ACL * acl;60 SEC_ACL *theacl; 61 61 int i; 62 62 bool update = False; … … 79 79 } 80 80 81 acl = sd->dacl;82 verbose_output(" DACL: %d entries:\n", acl->num_aces);83 for ( i=0; i< acl->num_aces; i++ ) {81 theacl = sd->dacl; 82 verbose_output(" DACL: %d entries:\n", theacl->num_aces); 83 for ( i=0; i<theacl->num_aces; i++ ) { 84 84 verbose_output(" Trustee SID: %s\n", 85 sid_string_tos(& acl->aces[i].trustee));86 if ( sid_equal( & acl->aces[i].trustee, s1 ) ) {87 sid_copy( & acl->aces[i].trustee, s2 );85 sid_string_tos(&theacl->aces[i].trustee)); 86 if ( sid_equal( &theacl->aces[i].trustee, s1 ) ) { 87 sid_copy( &theacl->aces[i].trustee, s2 ); 88 88 update = True; 89 89 verbose_output(" New Trustee SID: %s\n", 90 sid_string_tos(& acl->aces[i].trustee));90 sid_string_tos(&theacl->aces[i].trustee)); 91 91 } 92 92 } 93 93 94 94 #if 0 95 acl = sd->sacl;96 verbose_output(" SACL: %d entries: \n", acl->num_aces);97 for ( i=0; i< acl->num_aces; i++ ) {95 theacl = sd->sacl; 96 verbose_output(" SACL: %d entries: \n", theacl->num_aces); 97 for ( i=0; i<theacl->num_aces; i++ ) { 98 98 verbose_output(" Trustee SID: %s\n", 99 sid_string_tos(& acl->aces[i].trustee));100 if ( sid_equal( & acl->aces[i].trustee, s1 ) ) {101 sid_copy( & acl->aces[i].trustee, s2 );99 sid_string_tos(&theacl->aces[i].trustee)); 100 if ( sid_equal( &theacl->aces[i].trustee, s1 ) ) { 101 sid_copy( &theacl->aces[i].trustee, s2 ); 102 102 update = True; 103 103 verbose_output(" New Trustee SID: %s\n", 104 sid_string_tos(& acl->aces[i].trustee));104 sid_string_tos(&theacl->aces[i].trustee)); 105 105 } 106 106 } -
branches/samba-3.3.x/source/utils/sharesec.c
r206 r221 294 294 SEC_DESC *sd = NULL; 295 295 SEC_ACE *ace; 296 SEC_ACL * acl;296 SEC_ACL *theacl; 297 297 int num_ace; 298 298 const char *pacl; … … 322 322 } 323 323 324 if ( !( acl = make_sec_acl( mem_ctx, NT4_ACL_REVISION, num_ace, ace )) )324 if ( !(theacl = make_sec_acl( mem_ctx, NT4_ACL_REVISION, num_ace, ace )) ) 325 325 return NULL; 326 326 327 327 sd = make_sec_desc( mem_ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, 328 NULL, NULL, NULL, acl, sd_size);328 NULL, NULL, NULL, theacl, sd_size); 329 329 330 330 return sd; -
branches/samba-3.3.x/source/utils/smbget.c
r206 r221 195 195 196 196 if(chmod(relname, remotestat.st_mode) < 0) { 197 fprintf(stderr, "Unable to change mode of local dir %s to %o\n", relname, remotestat.st_mode); 197 fprintf(stderr, "Unable to change mode of local dir %s to %o\n", relname, 198 (unsigned int)remotestat.st_mode); 198 199 smbc_closedir(dirhandle); 199 200 return 0; … … 472 473 if(keep_permissions && !send_stdout) { 473 474 if(fchmod(localhandle, remotestat.st_mode) < 0) { 474 fprintf(stderr, "Unable to change mode of local file %s to %o\n", path, remotestat.st_mode); 475 fprintf(stderr, "Unable to change mode of local file %s to %o\n", path, 476 (unsigned int)remotestat.st_mode); 475 477 smbc_close(remotehandle); 476 478 close(localhandle); … … 488 490 char bs[100]; 489 491 human_readable(total_bytes, bs, sizeof(bs)); 490 if(!quiet)fprintf(stderr, "Downloaded %s in %lu seconds\n", bs, time(NULL) - total_start_time); 492 if(!quiet)fprintf(stderr, "Downloaded %s in %lu seconds\n", bs, 493 (unsigned long)(time(NULL) - total_start_time)); 491 494 exit(0); 492 495 }
Note:
See TracChangeset
for help on using the changeset viewer.