diff options
author | Cameron Katri <me@cameronkatri.com> | 2021-05-02 16:00:07 -0400 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2021-05-02 16:00:07 -0400 |
commit | f3dab068fce37270e5e4e1a00e5a44e30f00baf7 (patch) | |
tree | d6b8c70074d440e56c1d7cdbfc7b68d8b96bda96 /libutil/pw_util.c | |
parent | 6b46c62f4663c84790120a4e74e155a6ef16b41c (diff) | |
download | pw-darwin-f3dab068fce37270e5e4e1a00e5a44e30f00baf7.tar.gz pw-darwin-f3dab068fce37270e5e4e1a00e5a44e30f00baf7.tar.zst pw-darwin-f3dab068fce37270e5e4e1a00e5a44e30f00baf7.zip |
Recommit everything, add chpass, improve history (except for a few files that git-filter-repo dislikes for some reason [_secure_path.c and login_cap.h])
Diffstat (limited to 'libutil/pw_util.c')
-rw-r--r-- | libutil/pw_util.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libutil/pw_util.c b/libutil/pw_util.c index 4d708c0..ad2b36a 100644 --- a/libutil/pw_util.c +++ b/libutil/pw_util.c @@ -64,6 +64,10 @@ __SCCSID("@(#)pw_util.c 8.3 (Berkeley) 4/2/94"); #include <string.h> #include <unistd.h> +#include <os/availability.h> +API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) +void * reallocarray(void * in_ptr, size_t nmemb, size_t size) __DARWIN_EXTSN(reallocarray) __result_use_check; + #include "libutil.h" static pid_t editpid = -1; @@ -95,7 +99,7 @@ pw_init(const char *dir, const char *master) #endif if (dir == NULL) { - strcpy(passwd_dir, _PATH_ETC); + strcpy(passwd_dir, _PATH_PWD); } else { if (strlen(dir) >= sizeof(passwd_dir)) { errno = ENAMETOOLONG; @@ -344,8 +348,8 @@ pw_edit(int notsetuid) sigprocmask(SIG_SETMASK, &oldsigset, NULL); if (stat(tempname, &st2) == -1) return (-1); - return (st1.st_mtim.tv_sec != st2.st_mtim.tv_sec || - st1.st_mtim.tv_nsec != st2.st_mtim.tv_nsec); + return (st1.st_mtimespec.tv_sec != st2.st_mtimespec.tv_sec || + st1.st_mtimespec.tv_nsec != st2.st_mtimespec.tv_nsec); } /* |