Changeset 988 for vendor/current/source3/utils/smbcquotas.c
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/utils/smbcquotas.c
r740 r988 59 59 cli_ipc = connect_one("IPC$"); 60 60 ret = cli_rpc_pipe_open_noauth(cli_ipc, 61 &ndr_table_lsarpc .syntax_id,61 &ndr_table_lsarpc, 62 62 &global_pipe_hnd); 63 63 if (!NT_STATUS_IS_OK(ret)) { … … 188 188 switch (todo) { 189 189 case PARSE_LIM: 190 if (sscanf(p,"%"PRIu64"/%"PRIu64,&pqt->softlim,&pqt->hardlim)!=2) { 190 if (sscanf(p,"%"SCNu64"/%"SCNu64,&pqt->softlim, 191 &pqt->hardlim) != 2) 192 { 191 193 return -1; 192 194 } … … 235 237 const char *result; 236 238 237 if (!_numeric &&special&&(val == SMB_NTQUOTAS_NO_LIMIT)) {239 if (!_numeric && special && val == 0) { 238 240 return "NO LIMIT"; 239 241 } … … 331 333 static int do_quota(struct cli_state *cli, 332 334 enum SMB_QUOTA_TYPE qtype, 333 uint16 cmd,335 uint16_t cmd, 334 336 const char *username_str, 335 337 SMB_NTQUOTA_STRUCT *pqt) 336 338 { 337 uint32 fs_attrs = 0;339 uint32_t fs_attrs = 0; 338 340 uint16_t quota_fnum = 0; 339 341 SMB_NTQUOTA_LIST *qtl = NULL; … … 505 507 { 506 508 struct cli_state *c; 507 struct sockaddr_storage ss;508 509 NTSTATUS nt_status; 509 510 uint32_t flags = 0; 510 511 zero_sockaddr(&ss);512 511 513 512 if (get_cmdline_auth_info_use_machine_account(smbcquotas_auth_info) && … … 524 523 set_cmdline_auth_info_getpass(smbcquotas_auth_info); 525 524 526 nt_status = cli_full_connection(&c, global_myname(), server,527 &ss, 0,525 nt_status = cli_full_connection(&c, lp_netbios_name(), server, 526 NULL, 0, 528 527 share, "?????", 529 528 get_cmdline_auth_info_username(smbcquotas_auth_info), … … 555 554 main program 556 555 ****************************************************************************/ 557 int main(int argc, const char *argv[]) 558 { 556 int main(int argc, char *argv[]) 557 { 558 const char **argv_const = discard_const_p(const char *, argv); 559 559 char *share; 560 560 int opt; … … 584 584 { "numeric", 'n', POPT_ARG_NONE, NULL, 'n', "Don't resolve sids or limits to names" }, 585 585 { "verbose", 'v', POPT_ARG_NONE, NULL, 'v', "be verbose" }, 586 { "test-args", 't', POPT_ARG_NONE, NULL, ' r', "Test arguments"},586 { "test-args", 't', POPT_ARG_NONE, NULL, 't', "Test arguments"}, 587 587 POPT_COMMON_SAMBA 588 588 POPT_COMMON_CREDENTIALS … … 590 590 }; 591 591 592 load_case_tables();592 smb_init_locale(); 593 593 594 594 ZERO_STRUCT(qt); … … 600 600 setlinebuf(stdout); 601 601 602 fault_setup( NULL);603 604 lp_load (get_dyn_CONFIGFILE(),True,False,False,True);602 fault_setup(); 603 604 lp_load_global(get_dyn_CONFIGFILE()); 605 605 load_interfaces(); 606 606 … … 611 611 popt_common_set_auth_info(smbcquotas_auth_info); 612 612 613 pc = poptGetContext("smbcquotas", argc, argv , long_options, 0);613 pc = poptGetContext("smbcquotas", argc, argv_const, long_options, 0); 614 614 615 615 poptSetOtherOptionHelp(pc, "//server1/share1"); … … 692 692 } 693 693 694 poptFreeContext(pc); 695 popt_burn_cmdline_password(argc, argv); 696 694 697 string_replace(path, '/', '\\'); 695 698
Note:
See TracChangeset
for help on using the changeset viewer.