s/rval/ret/g -- old habits die hard
This commit is contained in:
@@ -365,7 +365,7 @@ bool
|
|||||||
run_early_defaults(void)
|
run_early_defaults(void)
|
||||||
{
|
{
|
||||||
struct early_default *early;
|
struct early_default *early;
|
||||||
bool rc = true;
|
bool ret = true;
|
||||||
debug_decl(run_early_defaults, SUDOERS_DEBUG_DEFAULTS)
|
debug_decl(run_early_defaults, SUDOERS_DEBUG_DEFAULTS)
|
||||||
|
|
||||||
for (early = early_defaults; early->var != NULL; early++) {
|
for (early = early_defaults; early->var != NULL; early++) {
|
||||||
@@ -373,11 +373,11 @@ run_early_defaults(void)
|
|||||||
continue;
|
continue;
|
||||||
if (early->def->callback != NULL) {
|
if (early->def->callback != NULL) {
|
||||||
if (!early->def->callback(&early->def->sd_un))
|
if (!early->def->callback(&early->def->sd_un))
|
||||||
rc = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
early->def = NULL;
|
early->def = NULL;
|
||||||
}
|
}
|
||||||
debug_return_bool(rc);
|
debug_return_bool(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -656,7 +656,7 @@ bool
|
|||||||
update_defaults(int what, bool quiet)
|
update_defaults(int what, bool quiet)
|
||||||
{
|
{
|
||||||
struct defaults *def;
|
struct defaults *def;
|
||||||
bool rc = true;
|
bool ret = true;
|
||||||
debug_decl(update_defaults, SUDOERS_DEBUG_DEFAULTS)
|
debug_decl(update_defaults, SUDOERS_DEBUG_DEFAULTS)
|
||||||
|
|
||||||
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
|
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
|
||||||
@@ -674,10 +674,10 @@ update_defaults(int what, bool quiet)
|
|||||||
!default_binding_matches(def, what))
|
!default_binding_matches(def, what))
|
||||||
continue;
|
continue;
|
||||||
if (!set_early_default(def->var, def->val, def->op, quiet, early))
|
if (!set_early_default(def->var, def->val, def->op, quiet, early))
|
||||||
rc = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
if (!run_early_defaults())
|
if (!run_early_defaults())
|
||||||
rc = false;
|
ret = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Then set the rest of the defaults.
|
* Then set the rest of the defaults.
|
||||||
@@ -691,9 +691,9 @@ update_defaults(int what, bool quiet)
|
|||||||
!default_binding_matches(def, what))
|
!default_binding_matches(def, what))
|
||||||
continue;
|
continue;
|
||||||
if (!set_default(def->var, def->val, def->op, quiet))
|
if (!set_default(def->var, def->val, def->op, quiet))
|
||||||
rc = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
debug_return_bool(rc);
|
debug_return_bool(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -705,7 +705,7 @@ check_defaults(int what, bool quiet)
|
|||||||
{
|
{
|
||||||
struct sudo_defs_types *cur, tmp;
|
struct sudo_defs_types *cur, tmp;
|
||||||
struct defaults *def;
|
struct defaults *def;
|
||||||
bool rc = true;
|
bool ret = true;
|
||||||
debug_decl(check_defaults, SUDOERS_DEBUG_DEFAULTS)
|
debug_decl(check_defaults, SUDOERS_DEBUG_DEFAULTS)
|
||||||
|
|
||||||
TAILQ_FOREACH(def, &defaults, entries) {
|
TAILQ_FOREACH(def, &defaults, entries) {
|
||||||
@@ -718,17 +718,17 @@ check_defaults(int what, bool quiet)
|
|||||||
if (cur->name == NULL) {
|
if (cur->name == NULL) {
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
sudo_warnx(U_("unknown defaults entry `%s'"), def->var);
|
sudo_warnx(U_("unknown defaults entry `%s'"), def->var);
|
||||||
rc = false;
|
ret = false;
|
||||||
} else {
|
} else {
|
||||||
/* Don't actually set the defaults value, just checking. */
|
/* Don't actually set the defaults value, just checking. */
|
||||||
tmp = *cur;
|
tmp = *cur;
|
||||||
memset(&tmp.sd_un, 0, sizeof(tmp.sd_un));
|
memset(&tmp.sd_un, 0, sizeof(tmp.sd_un));
|
||||||
if (!set_default_entry(&tmp, def->val, def->op, quiet, false))
|
if (!set_default_entry(&tmp, def->val, def->op, quiet, false))
|
||||||
rc = false;
|
ret = false;
|
||||||
free_default(&tmp);
|
free_default(&tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debug_return_bool(rc);
|
debug_return_bool(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
@@ -42,7 +42,7 @@ sudo_mkdir_parents(char *path, uid_t uid, gid_t *gidp, mode_t mode, bool quiet)
|
|||||||
struct stat sb;
|
struct stat sb;
|
||||||
gid_t parent_gid = 0;
|
gid_t parent_gid = 0;
|
||||||
char *slash = path;
|
char *slash = path;
|
||||||
bool rval = true;
|
bool ret = true;
|
||||||
debug_decl(sudo_mkdir_parents, SUDOERS_DEBUG_UTIL)
|
debug_decl(sudo_mkdir_parents, SUDOERS_DEBUG_UTIL)
|
||||||
|
|
||||||
/* If no gid specified, inherit from parent dir. */
|
/* If no gid specified, inherit from parent dir. */
|
||||||
@@ -63,21 +63,21 @@ sudo_mkdir_parents(char *path, uid_t uid, gid_t *gidp, mode_t mode, bool quiet)
|
|||||||
if (errno != EEXIST) {
|
if (errno != EEXIST) {
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
sudo_warn(U_("unable to mkdir %s"), path);
|
sudo_warn(U_("unable to mkdir %s"), path);
|
||||||
rval = false;
|
ret = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Already exists, make sure it is a directory. */
|
/* Already exists, make sure it is a directory. */
|
||||||
if (stat(path, &sb) != 0) {
|
if (stat(path, &sb) != 0) {
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
sudo_warn(U_("unable to stat %s"), path);
|
sudo_warn(U_("unable to stat %s"), path);
|
||||||
rval = false;
|
ret = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!S_ISDIR(sb.st_mode)) {
|
if (!S_ISDIR(sb.st_mode)) {
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
sudo_warnx(U_("%s exists but is not a directory (0%o)"),
|
sudo_warnx(U_("%s exists but is not a directory (0%o)"),
|
||||||
path, (unsigned int) sb.st_mode);
|
path, (unsigned int) sb.st_mode);
|
||||||
rval = false;
|
ret = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Inherit gid of parent dir for ownership. */
|
/* Inherit gid of parent dir for ownership. */
|
||||||
@@ -88,7 +88,7 @@ sudo_mkdir_parents(char *path, uid_t uid, gid_t *gidp, mode_t mode, bool quiet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Return parent gid if none was specified by caller. */
|
/* Return parent gid if none was specified by caller. */
|
||||||
if (rval && *gidp == (gid_t)-1)
|
if (ret && *gidp == (gid_t)-1)
|
||||||
*gidp = parent_gid;
|
*gidp = parent_gid;
|
||||||
debug_return_bool(rval);
|
debug_return_bool(ret);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user