本文整理汇总了C++中DEBUGADD函数的典型用法代码示例。如果您正苦于以下问题:C++ DEBUGADD函数的具体用法?C++ DEBUGADD怎么用?C++ DEBUGADD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DEBUGADD函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: smb_tag_to_solaris_tag
static SOLARIS_ACL_TAG_T smb_tag_to_solaris_tag(SMB_ACL_TAG_T smb_tag)
{
SOLARIS_ACL_TAG_T solaris_tag = 0;
DEBUG(10, ("smb_tag_to_solaris_tag\n"));
DEBUGADD(10, (" --> got smb tag 0x%04x\n", smb_tag));
switch (smb_tag) {
case SMB_ACL_USER:
solaris_tag = USER;
break;
case SMB_ACL_USER_OBJ:
solaris_tag = USER_OBJ;
break;
case SMB_ACL_GROUP:
solaris_tag = GROUP;
break;
case SMB_ACL_GROUP_OBJ:
solaris_tag = GROUP_OBJ;
break;
case SMB_ACL_OTHER:
solaris_tag = OTHER_OBJ;
break;
case SMB_ACL_MASK:
solaris_tag = CLASS_OBJ;
break;
default:
DEBUGADD(10, (" !!! unknown smb tag type 0x%04x\n", smb_tag));
break;
}
DEBUGADD(10, (" --> determined solaris tag 0x%04x\n", solaris_tag));
return solaris_tag;
}
示例2: ndr_print_debug_helper
_PUBLIC_ void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...)
{
va_list ap;
char *s = NULL;
uint32_t i;
int ret;
va_start(ap, format);
ret = vasprintf(&s, format, ap);
va_end(ap);
if (ret == -1) {
return;
}
if (ndr->no_newline) {
DEBUGADD(1,("%s", s));
free(s);
return;
}
for (i=0;i<ndr->depth;i++) {
DEBUGADD(1,(" "));
}
DEBUGADD(1,("%s\n", s));
free(s);
}
示例3: smb_tag_to_hpux_tag
static HPUX_ACL_TAG_T smb_tag_to_hpux_tag(SMB_ACL_TAG_T smb_tag)
{
HPUX_ACL_TAG_T hpux_tag = 0;
DEBUG(10, ("smb_tag_to_hpux_tag\n"));
DEBUGADD(10, (" --> got smb tag 0x%04x\n", smb_tag));
switch (smb_tag) {
case SMB_ACL_USER:
hpux_tag = USER;
break;
case SMB_ACL_USER_OBJ:
hpux_tag = USER_OBJ;
break;
case SMB_ACL_GROUP:
hpux_tag = GROUP;
break;
case SMB_ACL_GROUP_OBJ:
hpux_tag = GROUP_OBJ;
break;
case SMB_ACL_OTHER:
hpux_tag = OTHER_OBJ;
break;
case SMB_ACL_MASK:
hpux_tag = CLASS_OBJ;
break;
default:
DEBUGADD(10, (" !!! unknown smb tag type 0x%04x\n", smb_tag));
break;
}
DEBUGADD(10, (" --> determined hpux tag 0x%04x\n", hpux_tag));
return hpux_tag;
}
示例4: dump_gp_ext
void dump_gp_ext(struct GP_EXT *gp_ext, int debuglevel)
{
int lvl = debuglevel;
int i;
if (gp_ext == NULL) {
return;
}
DEBUG(lvl,("\t---------------------\n\n"));
DEBUGADD(lvl,("\tname:\t\t\t%s\n", gp_ext->gp_extension));
for (i=0; i< gp_ext->num_exts; i++) {
DEBUGADD(lvl,("\textension:\t\t\t%s\n",
gp_ext->extensions_guid[i]));
DEBUGADD(lvl,("\textension (name):\t\t\t%s\n",
gp_ext->extensions[i]));
DEBUGADD(lvl,("\tsnapin:\t\t\t%s\n",
gp_ext->snapins_guid[i]));
DEBUGADD(lvl,("\tsnapin (name):\t\t\t%s\n",
gp_ext->snapins[i]));
}
}
示例5: security_token_debug
/****************************************************************************
prints a struct security_token to debug output.
****************************************************************************/
void security_token_debug(int dbg_lev, const struct security_token *token)
{
TALLOC_CTX *mem_ctx;
int i;
if (!token) {
DEBUG(dbg_lev, ("Security token: (NULL)\n"));
return;
}
mem_ctx = talloc_init("security_token_debug()");
if (!mem_ctx) {
return;
}
DEBUG(dbg_lev, ("Security token of user %s\n",
dom_sid_string(mem_ctx, token->user_sid) ));
DEBUGADD(dbg_lev, (" SIDs (%lu):\n",
(unsigned long)token->num_sids));
for (i = 0; i < token->num_sids; i++) {
DEBUGADD(dbg_lev, (" SID[%3lu]: %s\n", (unsigned long)i,
dom_sid_string(mem_ctx, token->sids[i])));
}
security_token_debug_privileges(dbg_lev, token);
talloc_free(mem_ctx);
}
示例6: prs_uint8s
bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint8_t *data8s, int len)
{
int i;
char *q = prs_mem_get(ps, len);
if (q == NULL)
return False;
if (UNMARSHALLING(ps)) {
for (i = 0; i < len; i++)
data8s[i] = CVAL(q,i);
} else {
for (i = 0; i < len; i++)
SCVAL(q, i, data8s[i]);
}
DEBUGADD(5,("%s%04x %s: ", tab_depth(5,depth), ps->data_offset ,name));
if (charmode)
print_asc(5, (unsigned char*)data8s, len);
else {
for (i = 0; i < len; i++)
DEBUGADD(5,("%02x ", data8s[i]));
}
DEBUGADD(5,("\n"));
ps->data_offset += len;
return True;
}
示例7: debug_lock_order
static void debug_lock_order(int level, struct db_context *dbs[])
{
int i;
DEBUG(level, ("lock order: "));
for (i=0; i<DBWRAP_LOCK_ORDER_MAX; i++) {
DEBUGADD(level, (" %d:%s", i + 1, dbs[i] ? dbs[i]->name : "<none>"));
}
DEBUGADD(level, ("\n"));
}
示例8: _wkssvc_NetWkstaGetInfo
WERROR _wkssvc_NetWkstaGetInfo(struct pipes_struct *p,
struct wkssvc_NetWkstaGetInfo *r)
{
switch (r->in.level) {
case 100:
/* Level 100 can be allowed from anyone including anonymous
* so no access checks are needed for this case */
r->out.info->info100 = create_wks_info_100(p->mem_ctx);
if (r->out.info->info100 == NULL) {
return WERR_NOMEM;
}
break;
case 101:
/* Level 101 can be allowed from any logged in user */
if (!nt_token_check_sid(&global_sid_Authenticated_Users,
p->session_info->security_token)) {
DEBUG(1,("User not allowed for NetWkstaGetInfo level "
"101\n"));
DEBUGADD(3,(" - does not have sid for Authenticated "
"Users %s:\n",
sid_string_dbg(
&global_sid_Authenticated_Users)));
security_token_debug(DBGC_CLASS, 3,
p->session_info->security_token);
return WERR_ACCESS_DENIED;
}
r->out.info->info101 = create_wks_info_101(p->mem_ctx);
if (r->out.info->info101 == NULL) {
return WERR_NOMEM;
}
break;
case 102:
/* Level 102 Should only be allowed from a domain administrator */
if (!nt_token_check_sid(&global_sid_Builtin_Administrators,
p->session_info->security_token)) {
DEBUG(1,("User not allowed for NetWkstaGetInfo level "
"102\n"));
DEBUGADD(3,(" - does not have sid for Administrators "
"group %s, sids are:\n",
sid_string_dbg(&global_sid_Builtin_Administrators)));
security_token_debug(DBGC_CLASS, 3,
p->session_info->security_token);
return WERR_ACCESS_DENIED;
}
r->out.info->info102 = create_wks_info_102(p->mem_ctx);
if (r->out.info->info102 == NULL) {
return WERR_NOMEM;
}
break;
default:
return WERR_UNKNOWN_LEVEL;
}
return WERR_OK;
}
示例9: tdb_validate_child
/*
* internal validation function, executed by the child.
*/
static int tdb_validate_child(struct tdb_context *tdb,
tdb_validate_data_func validate_fn)
{
int ret = 1;
int num_entries = 0;
struct tdb_validation_status v_status;
v_status.tdb_error = False;
v_status.bad_freelist = False;
v_status.bad_entry = False;
v_status.unknown_key = False;
v_status.success = True;
if (!tdb) {
v_status.tdb_error = True;
v_status.success = False;
goto out;
}
/* Check if the tdb's freelist is good. */
if (tdb_validate_freelist(tdb, &num_entries) == -1) {
v_status.bad_freelist = True;
v_status.success = False;
goto out;
}
DEBUG(10,("tdb_validate_child: tdb %s freelist has %d entries\n",
tdb_name(tdb), num_entries));
/* Now traverse the tdb to validate it. */
num_entries = tdb_traverse(tdb, validate_fn, (void *)&v_status);
if (!v_status.success) {
goto out;
} else if (num_entries == -1) {
v_status.tdb_error = True;
v_status.success = False;
goto out;
}
DEBUG(10,("tdb_validate_child: tdb %s is good with %d entries\n",
tdb_name(tdb), num_entries));
ret = 0; /* Cache is good. */
out:
DEBUG(10, ("tdb_validate_child: summary of validation status:\n"));
DEBUGADD(10,(" * tdb error: %s\n", v_status.tdb_error ? "yes" : "no"));
DEBUGADD(10,(" * bad freelist: %s\n",v_status.bad_freelist?"yes":"no"));
DEBUGADD(10,(" * bad entry: %s\n", v_status.bad_entry ? "yes" : "no"));
DEBUGADD(10,(" * unknown key: %s\n", v_status.unknown_key?"yes":"no"));
DEBUGADD(10,(" => overall success: %s\n", v_status.success?"yes":"no"));
return ret;
}
示例10: tdbsam_delete_sam_account
static NTSTATUS tdbsam_delete_sam_account(struct pdb_methods *my_methods, SAM_ACCOUNT *sam_pass)
{
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
struct tdbsam_privates *tdb_state = (struct tdbsam_privates *)my_methods->private_data;
TDB_CONTEXT *pwd_tdb;
TDB_DATA key;
fstring keystr;
uint32 rid;
fstring name;
fstrcpy(name, pdb_get_username(sam_pass));
strlower_m(name);
/* open the TDB */
if (!(pwd_tdb = tdb_open_log(tdb_state->tdbsam_location, 0, TDB_DEFAULT, O_RDWR, 0600))) {
DEBUG(0, ("Unable to open TDB passwd!"));
return nt_status;
}
/* set the search key */
slprintf(keystr, sizeof(keystr)-1, "%s%s", USERPREFIX, name);
key.dptr = keystr;
key.dsize = strlen (keystr) + 1;
rid = pdb_get_user_rid(sam_pass);
/* it's outaa here! 8^) */
if (tdb_delete(pwd_tdb, key) != TDB_SUCCESS) {
DEBUG(5, ("Error deleting entry from tdb passwd database!\n"));
DEBUGADD(5, (" Error: %s\n", tdb_errorstr(pwd_tdb)));
tdb_close(pwd_tdb);
return nt_status;
}
/* delete also the RID key */
/* set the search key */
slprintf(keystr, sizeof(keystr)-1, "%s%.8x", RIDPREFIX, rid);
key.dptr = keystr;
key.dsize = strlen (keystr) + 1;
/* it's outaa here! 8^) */
if (tdb_delete(pwd_tdb, key) != TDB_SUCCESS) {
DEBUG(5, ("Error deleting entry from tdb rid database!\n"));
DEBUGADD(5, (" Error: %s\n", tdb_errorstr(pwd_tdb)));
tdb_close(pwd_tdb);
return nt_status;
}
tdb_close(pwd_tdb);
return NT_STATUS_OK;
}
示例11: xlate_qblk_to_smb
static void xlate_qblk_to_smb(const struct dqblk * const qblk,
SMB_DISK_QUOTA *dp)
{
ZERO_STRUCTP(dp);
DEBUG(10, ("unix softlimit=%u hardlimit=%u curblock=%u\n",
(unsigned)qblk->dqb_bsoftlimit, (unsigned)qblk->dqb_bhardlimit,
#ifdef HAVE_STRUCT_DQBLK_DQB_CURBYTES
(unsigned)qblk->dqb_curbytes));
#else
(unsigned)qblk->dqb_curblocks));
#endif
DEBUGADD(10, ("unix softinodes=%u hardinodes=%u curinodes=%u\n",
(unsigned)qblk->dqb_isoftlimit, (unsigned)qblk->dqb_ihardlimit,
(unsigned)qblk->dqb_curinodes));
#ifdef HAVE_STRUCT_DQBLK_DQB_CURBYTES
/* On Darwin, quotas are counted in bytes. We report them
* in 512b blocks because various callers have assumptions
* about the block size.
*/
#define XLATE_TO_BLOCKS(bytes) (((bytes) + 1) / 512)
dp->bsize = 512;
dp->softlimit = XLATE_TO_BLOCKS(qblk->dqb_bsoftlimit);
dp->hardlimit = XLATE_TO_BLOCKS(qblk->dqb_bhardlimit);
dp->curblocks = XLATE_TO_BLOCKS(qblk->dqb_curbytes);
#undef XLATE_TO_BLOCKS
#else
dp->bsize = DEV_BSIZE;
dp->softlimit = qblk->dqb_bsoftlimit;
dp->hardlimit = qblk->dqb_bhardlimit;
dp->curblocks = qblk->dqb_curblocks;
#endif
dp->ihardlimit = qblk->dqb_ihardlimit;
dp->isoftlimit = qblk->dqb_isoftlimit;
dp->curinodes = qblk->dqb_curinodes;
dp->qflags = QUOTAS_ENABLED | QUOTAS_DENY_DISK;
DEBUG(10, ("softlimit=%u hardlimit=%u curblock=%u\n",
(unsigned)dp->softlimit, (unsigned)dp->hardlimit,
(unsigned)dp->curblocks));
DEBUGADD(10, ("softinodes=%u hardinodes=%u curinodes=%u\n",
(unsigned)dp->isoftlimit, (unsigned)dp->ihardlimit,
(unsigned)dp->curinodes));
}
示例12: smb_pwd_check_ntlmv1
static bool smb_pwd_check_ntlmv1(TALLOC_CTX *mem_ctx,
const DATA_BLOB *nt_response,
const uint8_t *part_passwd,
const DATA_BLOB *sec_blob,
DATA_BLOB *user_sess_key)
{
/* Finish the encryption of part_passwd. */
uint8_t p24[24];
if (part_passwd == NULL) {
DEBUG(10,("No password set - DISALLOWING access\n"));
/* No password set - always false ! */
return false;
}
if (sec_blob->length != 8) {
DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect challenge size (%lu)\n",
(unsigned long)sec_blob->length));
return false;
}
if (nt_response->length != 24) {
DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect password length (%lu)\n",
(unsigned long)nt_response->length));
return false;
}
SMBOWFencrypt(part_passwd, sec_blob->data, p24);
#if DEBUG_PASSWORD
DEBUG(100,("Part password (P16) was |\n"));
dump_data(100, part_passwd, 16);
DEBUGADD(100,("Password from client was |\n"));
dump_data(100, nt_response->data, nt_response->length);
DEBUGADD(100,("Given challenge was |\n"));
dump_data(100, sec_blob->data, sec_blob->length);
DEBUGADD(100,("Value from encryption was |\n"));
dump_data(100, p24, 24);
#endif
if (memcmp(p24, nt_response->data, 24) == 0) {
if (user_sess_key != NULL) {
*user_sess_key = data_blob_talloc(mem_ctx, NULL, 16);
SMBsesskeygen_ntv1(part_passwd, user_sess_key->data);
}
return true;
}
return false;
}
示例13: rcinit_status
static WERROR rcinit_status( const char *service, struct SERVICE_STATUS *status )
{
char *command = NULL;
int ret, fd;
if (asprintf(&command, "%s/%s/%s status",
get_dyn_MODULESDIR(), SVCCTL_SCRIPT_DIR, service) < 0) {
return WERR_NOT_ENOUGH_MEMORY;
}
/* we've already performed the access check when the service was opened */
/* assume as return code of 0 means that the service is ok. Anything else
is STOPPED */
become_root();
ret = smbrun(command, &fd, NULL);
unbecome_root();
DEBUGADD(5, ("rcinit_start: [%s] returned [%d]\n", command, ret));
close(fd);
SAFE_FREE(command);
ZERO_STRUCTP( status );
status->type = SERVICE_TYPE_WIN32_SHARE_PROCESS;
status->state = (ret == 0 ) ? SVCCTL_RUNNING : SVCCTL_STOPPED;
status->controls_accepted = SVCCTL_ACCEPT_STOP |
SVCCTL_ACCEPT_SHUTDOWN;
return WERR_OK;
}
示例14: prs_dcerpc_status
bool prs_dcerpc_status(const char *name, prs_struct *ps, int depth, NTSTATUS *status)
{
char *q = prs_mem_get(ps, sizeof(uint32));
if (q == NULL)
return False;
if (UNMARSHALLING(ps)) {
if (ps->bigendian_data)
*status = NT_STATUS(RIVAL(q,0));
else
*status = NT_STATUS(IVAL(q,0));
} else {
if (ps->bigendian_data)
RSIVAL(q,0,NT_STATUS_V(*status));
else
SIVAL(q,0,NT_STATUS_V(*status));
}
DEBUGADD(5,("%s%04x %s: %s\n", tab_depth(5,depth), ps->data_offset, name,
dcerpc_errstr(talloc_tos(), NT_STATUS_V(*status))));
ps->data_offset += sizeof(uint32);
return True;
}
示例15: dump_core
void dump_core(void)
{
/* Note that even if core dumping has been disabled, we still set up
* the core path. This is to handle the case where core dumping is
* turned on in smb.conf and the relevant daemon is not restarted.
*/
if (!lp_enable_core_files()) {
DEBUG(0, ("Exiting on internal error (core file administratively disabled\n"));
exit(1);
}
if (*corepath != '\0') {
/* The chdir might fail if we dump core before we finish
* processing the config file.
*/
if (chdir(corepath) != 0) {
DEBUG(0, ("unable to change to %s", corepath));
DEBUGADD(0, ("refusing to dump core\n"));
exit(1);
}
DEBUG(0,("dumping core in %s\n", corepath));
}
umask(~(0700));
dbgflush();
/* Ensure we don't have a signal handler for abort. */
#ifdef SIGABRT
CatchSignal(SIGABRT,SIGNAL_CAST SIG_DFL);
#endif
abort();
}