utils/smbcquotas.c

ソースコードを見る。

列挙型

enum  todo_values {
  NOOP_QUOTA = 0, FS_QUOTA, USER_QUOTA,
  LIST_QUOTA, SET_QUOTA
}
enum  exit_values { EXIT_OK, EXIT_FAILED, EXIT_PARSE_ERROR }
enum  { PARSE_FLAGS, PARSE_LIM }

関数

static struct cli_stateconnect_one (const char *share)
static BOOL cli_open_policy_hnd (void)
static void SidToString (fstring str, DOM_SID *sid, BOOL _numeric)
static BOOL StringToSid (DOM_SID *sid, const char *str)
static int parse_quota_set (pstring set_str, pstring username_str, enum SMB_QUOTA_TYPE *qtype, int *cmd, SMB_NTQUOTA_STRUCT *pqt)

変数

static pstring server
static BOOL numeric
static BOOL verbose
static struct cli_statecli_ipc
static struct rpc_pipe_clientglobal_pipe_hnd
static POLICY_HND pol
static BOOL got_policy_hnd


列挙型

enum todo_values

列挙型の値:
NOOP_QUOTA 
FS_QUOTA 
USER_QUOTA 
LIST_QUOTA 
SET_QUOTA 

smbcquotas.c34 行で定義されています。

enum exit_values

列挙型の値:
EXIT_OK 
EXIT_FAILED 
EXIT_PARSE_ERROR 

smbcquotas.c35 行で定義されています。

anonymous enum

列挙型の値:
PARSE_FLAGS 
PARSE_LIM 

smbcquotas.c136 行で定義されています。


関数

static struct cli_state* connect_one ( const char *  share  )  [static]

static BOOL cli_open_policy_hnd ( void   )  [static]

smbcquotas.c46 行で定義されています。

参照先 cli_ipccli_rpc_pipe_open_noauth()connect_one()global_pipe_hndgot_policy_hndcli_state::mem_ctxpolrpccli_lsa_open_policy().

参照元 SidToString()StringToSid().

00047 {
00048         /* Initialise cli LSA connection */
00049 
00050         if (!cli_ipc) {
00051                 NTSTATUS ret;
00052                 cli_ipc = connect_one("IPC$");
00053                 global_pipe_hnd = cli_rpc_pipe_open_noauth(cli_ipc, PI_LSARPC, &ret);
00054                 if (!global_pipe_hnd) {
00055                                 return False;
00056                 }
00057         }
00058         
00059         /* Open policy handle */
00060 
00061         if (!got_policy_hnd) {
00062 
00063                 /* Some systems don't support SEC_RIGHTS_MAXIMUM_ALLOWED,
00064                    but NT sends 0x2000000 so we might as well do it too. */
00065 
00066                 if (!NT_STATUS_IS_OK(rpccli_lsa_open_policy(global_pipe_hnd, cli_ipc->mem_ctx, True, 
00067                                                          GENERIC_EXECUTE_ACCESS, &pol))) {
00068                         return False;
00069                 }
00070 
00071                 got_policy_hnd = True;
00072         }
00073         
00074         return True;
00075 }

static void SidToString ( fstring  str,
DOM_SID sid,
BOOL  _numeric 
) [static]

smbcquotas.c78 行で定義されています。

参照先 cli_ipccli_open_policy_hnd()global_pipe_hndcli_state::mem_ctxpolrpccli_lsa_lookup_sids()sid_to_string().

00079 {
00080         char **domains = NULL;
00081         char **names = NULL;
00082         enum lsa_SidType *types = NULL;
00083 
00084         sid_to_string(str, sid);
00085 
00086         if (_numeric) return;
00087 
00088         /* Ask LSA to convert the sid to a name */
00089 
00090         if (!cli_open_policy_hnd() ||
00091             !NT_STATUS_IS_OK(rpccli_lsa_lookup_sids(global_pipe_hnd, cli_ipc->mem_ctx,  
00092                                                  &pol, 1, sid, &domains, 
00093                                                  &names, &types)) ||
00094             !domains || !domains[0] || !names || !names[0]) {
00095                 return;
00096         }
00097 
00098         /* Converted OK */
00099 
00100         slprintf(str, sizeof(fstring) - 1, "%s%s%s",
00101                  domains[0], lp_winbind_separator(),
00102                  names[0]);
00103         
00104 }

static BOOL StringToSid ( DOM_SID sid,
const char *  str 
) [static]

smbcquotas.c107 行で定義されています。

参照先 cli_ipccli_open_policy_hnd()global_pipe_hndcli_state::mem_ctxpolresultrpccli_lsa_lookup_names()sid_copy()string_to_sid().

00108 {
00109         enum lsa_SidType *types = NULL;
00110         DOM_SID *sids = NULL;
00111         BOOL result = True;
00112 
00113         if (strncmp(str, "S-", 2) == 0) {
00114                 return string_to_sid(sid, str);
00115         }
00116 
00117         if (!cli_open_policy_hnd() ||
00118             !NT_STATUS_IS_OK(rpccli_lsa_lookup_names(global_pipe_hnd, cli_ipc->mem_ctx, 
00119                                                   &pol, 1, &str, NULL, &sids, 
00120                                                   &types))) {
00121                 result = False;
00122                 goto done;
00123         }
00124 
00125         sid_copy(sid, &sids[0]);
00126  done:
00127 
00128         return result;
00129 }

static int parse_quota_set ( pstring  set_str,
pstring  username_str,
enum SMB_QUOTA_TYPE qtype,
int *  cmd,
SMB_NTQUOTA_STRUCT pqt 
) [static]

smbcquotas.c138 行で定義されています。

参照先 all_string_sub()cclicli_close()cli_errstr()cli_full_connection()cli_get_fs_attr_info()cli_get_fs_quota_info()cli_get_quota_handle()cli_get_user_quota()cli_list_user_quota()cli_set_fs_quota_info()cli_set_user_quota()cmdline_auth_infoconnect_one()d_printf()dbfDEBUGLEVEL_CLASSdump_ntquota()dump_ntquota_list()dyn_CONFIGFILEEXIT_FAILEDEXIT_OKEXIT_PARSE_ERRORfault_setup()free_ntquota_list()FS_QUOTAglobal_mynameuser_auth_info::got_pass_SMB_NTQUOTA_STRUCT::hardlimLIST_QUOTAload_case_tables()load_interfaces()lp_workgroup()main()nt_errstr()numericPARSE_FLAGSPARSE_LIMuser_auth_info::passwordpoptGetArg()poptGetContext()poptGetNextOpt()poptGetOptArg()poptPeekArg()poptPrintUsage()poptSetOtherOptionHelp()printf()_SMB_NTQUOTA_STRUCT::qflagsresultserverSET_QUOTAsetup_logging()share_SMB_NTQUOTA_STRUCT::sidSidToString()user_auth_info::signing_stateSMB_INVALID_QUOTA_TYPESMB_USER_FS_QUOTA_TYPESMB_USER_QUOTA_TYPE_SMB_NTQUOTA_STRUCT::softlimstrchr_m()StringToSid()strnequal()test_argsUSER_QUOTAuser_auth_info::usernameverbosex_setbuf()x_stderrzero_ip().


変数

pstring server [static]

smbcquotas.c27 行で定義されています。

BOOL numeric [static]

smbcquotas.c31 行で定義されています。

BOOL verbose [static]

smbcquotas.c32 行で定義されています。

struct cli_state* cli_ipc [static]

smbcquotas.c37 行で定義されています。

参照元 cli_open_policy_hnd()cli_resolve_path()SidToString()StringToSid().

struct rpc_pipe_client* global_pipe_hnd [static]

smbcquotas.c38 行で定義されています。

POLICY_HND pol [static]

smbcquotas.c39 行で定義されています。

BOOL got_policy_hnd [static]

smbcquotas.c40 行で定義されています。


Sambaに対してSat Aug 29 21:24:37 2009に生成されました。  doxygen 1.4.7