dst_orig = dst->full_path;
set_orig = true;
}
- while ((0 == err) && (ent = readdir (dir)) != NULL) {
+ while (0 == err && NULL != (ent = readdir(dir))) {
char *src_name = NULL;
char *dst_name;
struct path_info src_entry, dst_entry;
(void) gr_rewind ();
highest_found = gid_min;
lowest_found = gid_max;
- while ((grp = gr_next ()) != NULL) {
+ while (NULL != (grp = gr_next())) {
/*
* Does this entry have a lower GID than the lowest we've found
* so far?
(void) pw_rewind ();
highest_found = uid_min;
lowest_found = uid_max;
- while ((pwd = pw_next ()) != NULL) {
+ while (NULL != (pwd = pw_next())) {
/*
* Does this entry have a lower UID than the lowest we've found
* so far?
setsgent ();
- while ((sgrp = getsgent ()) != NULL) {
+ while (NULL != (sgrp = getsgent())) {
if (streq(name, sgrp->sg_namp)) {
break;
}
setportent();
- while ((port = getportent()) != NULL) {
+ while (NULL != (port = getportent())) {
char **ptn;
char **ptu;
fg = fopen(group_db_file, "rt");
if (!fg)
return NULL;
- while ((grp = fgetgrent(fg)) != NULL) {
+ while (NULL != (grp = fgetgrent(fg))) {
if (streq(name, grp->gr_name))
break;
}
fg = fopen(group_db_file, "rt");
if (!fg)
return NULL;
- while ((grp = fgetgrent(fg)) != NULL) {
+ while (NULL != (grp = fgetgrent(fg))) {
if (gid == grp->gr_gid)
break;
}
fg = fopen(passwd_db_file, "rt");
if (!fg)
return NULL;
- while ((pwd = fgetpwent(fg)) != NULL) {
+ while (NULL != (pwd = fgetpwent(fg))) {
if (uid == pwd->pw_uid)
break;
}
fg = fopen(passwd_db_file, "rt");
if (!fg)
return NULL;
- while ((pwd = fgetpwent(fg)) != NULL) {
+ while (NULL != (pwd = fgetpwent(fg))) {
if (streq(name, pwd->pw_name))
break;
}
fg = fopen(spw_db_file, "rt");
if (!fg)
return NULL;
- while ((sp = fgetspent(fg)) != NULL) {
+ while (NULL != (sp = fgetspent(fg))) {
if (streq(name, sp->sp_namp))
break;
}
{
const struct subordinate_range *range;
commonio_rewind(db);
- while ((range = commonio_next(db)) != NULL) {
+ while (NULL != (range = commonio_next(db))) {
if (streq(range->owner, owner))
return true;
}
* before.
*/
commonio_rewind(db);
- while ((range = commonio_next(db)) != NULL) {
+ while (NULL != (range = commonio_next(db))) {
unsigned long first = range->start;
unsigned long last = first + range->count - 1;
return NULL;
commonio_rewind(db);
- while ((range = commonio_next(db)) != NULL) {
+ while (NULL != (range = commonio_next(db))) {
unsigned long first = range->start;
unsigned long last = first + range->count - 1;
commonio_rewind(db);
low = min;
- while ((range = commonio_next(db)) != NULL) {
+ while (NULL != (range = commonio_next(db))) {
unsigned long first = range->start;
unsigned long last = first + range->count - 1;
have_owner_id = get_owner_id(owner, id_type, id);
commonio_rewind(db);
- while ((range = commonio_next(db)) != NULL) {
+ while (NULL != (range = commonio_next(db))) {
if (streq(range->owner, owner)) {
if (!append_range(&ranges, range, count++)) {
free(ranges);
*uids = NULL;
commonio_rewind(db);
- while ((range = commonio_next(db)) != NULL) {
+ while (NULL != (range = commonio_next(db))) {
if (id >= range->start && id < range->start + range-> count) {
n = append_uids(uids, range->owner, n);
if (n < 0)
commonio_rewind(db);
if (reuse) {
- while ((r = commonio_next(db)) != NULL) {
+ while (NULL != (r = commonio_next(db))) {
// TODO account for username vs uid_t
if (!streq(r->owner, range->owner))
continue;
struct utmpx *utent;
setutxent();
- while ((utent = getutxent()) != NULL)
+ while (NULL != (utent = getutxent()))
{
if (utent->ut_type != USER_PROCESS) {
continue;
return 0;
}
- while ((ent = readdir (proc)) != NULL) {
+ while (NULL != (ent = readdir(proc))) {
tmp_d_name = ent->d_name;
/*
* Ingo Molnar's patch introducing NPTL for 2.4 hides
SNPRINTF(task_path, "/proc/%lu/task", (unsigned long) pid);
task_dir = opendir (task_path);
if (task_dir != NULL) {
- while ((ent = readdir (task_dir)) != NULL) {
+ while (NULL != (ent = readdir(task_dir))) {
pid_t tid;
if (get_pid(ent->d_name, &tid) == -1) {
continue;
setutxent();
/* First, try to find a valid utmp entry for this process. */
- while ((ut = getutxent()) != NULL) {
+ while (NULL != (ut = getutxent())) {
if ( (LOGIN_PROCESS != ut->ut_type)
&& (USER_PROCESS != ut->ut_type))
continue;
struct passwd *pwd;
prefix_setpwent ();
- while ((pwd = prefix_getpwent ()) != NULL) {
+ while (NULL != (pwd = prefix_getpwent())) {
if (pwd->pw_gid == ogid) {
const struct passwd *lpwd;
struct passwd npwd;
* Remove /etc/gshadow entries for groups not in /etc/group.
*/
(void) sgr_rewind ();
- while ((sg = sgr_next ()) != NULL) {
+ while (NULL != (sg = sgr_next())) {
if (gr_locate (sg->sg_namp) != NULL) {
continue;
}
* Update group passwords if non-shadow password is "x".
*/
(void) gr_rewind ();
- while ((gr = gr_next ()) != NULL) {
+ while (NULL != (gr = gr_next())) {
sg = sgr_locate (gr->gr_name);
if ( (NULL != sg)
&& streq(gr->gr_passwd, SHADOW_PASSWD_STRING)) {
* for login sessions will be checked to see if the user
* is permitted to be signed on at this time.
*/
- while ((ut = getutxent()) != NULL) {
+ while (NULL != (ut = getutxent())) {
int tty_fd;
char tty_name[sizeof(ut->ut_line) + 6]; // /dev/ + NUL
return gr;
setgrent ();
- while ((gr = getgrent ()) != NULL) {
+ while (NULL != (gr = getgrent())) {
if (gr->gr_gid != gid) {
continue;
}
* Remove /etc/shadow entries for users not in /etc/passwd.
*/
(void) spw_rewind ();
- while ((sp = spw_next ()) != NULL) {
+ while (NULL != (sp = spw_next())) {
if (pw_locate (sp->sp_namp) != NULL) {
continue;
}
* missing shadow entries.
*/
(void) pw_rewind ();
- while ((pw = pw_next ()) != NULL) {
+ while (NULL != (pw = pw_next())) {
sp = spw_locate (pw->pw_name);
if (NULL != sp) {
/* do we need to update this entry? */
}
(void) pw_rewind ();
- while ((pw = pw_next ()) != NULL) {
+ while (NULL != (pw = pw_next())) {
spwd = spw_locate (pw->pw_name);
if (NULL == spwd) {
continue;
/*@observer@*/const char *line;
setusershell ();
- while ((line = getusershell ()) != NULL) {
+ while (NULL != (line = getusershell())) {
if (('#' != *line) && streq(line, shellname)) {
endusershell ();
return false;
* used as a primary group.
*/
prefix_setpwent ();
- while ((pwd = prefix_getpwent ()) != NULL) {
+ while (NULL != (pwd = prefix_getpwent())) {
if (streq(pwd->pw_name, user_name)) {
continue;
}
* Scan through the entire group file looking for the groups that
* the user is a member of.
*/
- while ((grp = gr_next()) != NULL)
+ while (NULL != (grp = gr_next()))
update_group(grp);
}
* Scan through the entire shadow group file looking for the groups
* that the user is a member of.
*/
- while ((sgrp = sgr_next()) != NULL)
+ while (NULL != (sgrp = sgr_next()))
update_gshadow(sgrp);
}
#endif /* SHADOWGRP */