elf/elf.h
For b/31273149, revert the value of DT_PPC64_NUM from 4 to 3.
(stanshebs, google-local)
+
+nss/nss_borg/borg-pwd.c
+ Add /etc/passwd.borg.base as fallback passwd file. (b/30413914, b/32608777)
+ (mrothwell/stanshebs, google-local)
int *errnop) {
enum nss_status ret;
-
+ // Save a copy of the buffer address, in case first call errors
+ // and sets it to 0.
+ struct passwd *sparecopy = result;
if (
f != NULL && (fgetpwent_r(f, result, buffer, buflen, &result) == 0)) {
DEBUG("Returning borg user %d:%s\n", result->pw_uid, result->pw_name);
ret = NSS_STATUS_SUCCESS;
} else if (
- fb != NULL && (fgetpwent_r(fb, result, buffer, buflen, &result) == 0)) {
+ // Yes, this is one of those cases where an assign makes sense.
+ fb != NULL && (result = sparecopy) && (fgetpwent_r(fb, result, buffer, buflen, &result) == 0)) {
DEBUG("Returning base user %d:%s\n", result->pw_uid, result->pw_name);
ret = NSS_STATUS_SUCCESS;
} else {