| 678 | } |
| 679 | |
| 680 | static struct passwd *getpw_str(const char *username, size_t len) |
| 681 | { |
| 682 | struct passwd *pw; |
| 683 | char *username_z = xmemdupz(username, len); |
| 684 | pw = getpwnam(username_z); |
| 685 | free(username_z); |
| 686 | return pw; |
| 687 | } |
| 688 | |
| 689 | /* |
| 690 | * Return a string with ~ and ~user expanded via getpw*. Returns NULL on getpw |
no test coverage detected