It seems that fd_set_perms() is always called after checking that
fd >= 0 (also when called as action() in glob_item_recursively()),
so it seems that the assertion really came from fd==0.
Fixes #20140.
Also three other similar cases are updated.
int r;
assert(i);
- assert(fd);
+ assert(fd >= 0);
assert(path);
if (!i->mode_set && !i->uid_set && !i->gid_set)
char **name, **value;
assert(i);
- assert(fd);
+ assert(fd >= 0);
assert(path);
xsprintf(procfs_path, "/proc/self/fd/%i", fd);
struct stat stbuf;
assert(item);
- assert(fd);
+ assert(fd >= 0);
assert(path);
if (!st) {
int r;
assert(item);
- assert(fd);
+ assert(fd >= 0);
assert(path);
if (!item->attribute_set || item->attribute_mask == 0)