| 39 | #endif |
| 40 | |
| 41 | static struct passwd *xgetpwuid_self(int *is_bogus) |
| 42 | { |
| 43 | struct passwd *pw; |
| 44 | |
| 45 | errno = 0; |
| 46 | pw = getpwuid(getuid()); |
| 47 | if (!pw) { |
| 48 | static struct passwd fallback; |
| 49 | fallback.pw_name = (char *) "unknown"; |
| 50 | #ifndef NO_GECOS_IN_PWENT |
| 51 | fallback.pw_gecos = (char *) "Unknown"; |
| 52 | #endif |
| 53 | pw = &fallback; |
| 54 | if (is_bogus) |
| 55 | *is_bogus = 1; |
| 56 | } |
| 57 | return pw; |
| 58 | } |
| 59 | |
| 60 | static void copy_gecos(const struct passwd *w, struct strbuf *name) |
| 61 | { |
no test coverage detected