]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - chpass/pw_copy.c
Switch to user UID/GID before checking/reading its ~/.login_conf
[pw-darwin.git] / chpass / pw_copy.c
index fa77f05da615bf0056800133783cd7fade5992a7..d60f75177492ff075ac44a897a548b5c78175747 100644 (file)
@@ -32,7 +32,7 @@
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)pw_copy.c  8.4 (Berkeley) 4/2/94";
+static const char sccsid[] = "@(#)pw_copy.c    8.4 (Berkeley) 4/2/94";
 #endif /* not lint */
 
 /*
@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)pw_copy.c 8.4 (Berkeley) 4/2/94";
 #include <pwd.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <pw_util.h>
 #include "pw_copy.h"
@@ -65,8 +66,8 @@ pw_copy(ffd, tfd, pw)
 
        snprintf(uidstr, sizeof(uidstr), "%d", pw->pw_uid);
        snprintf(gidstr, sizeof(gidstr), "%d", pw->pw_gid);
-       snprintf(chgstr, sizeof(chgstr), "%ld", pw->pw_change);
-       snprintf(expstr, sizeof(expstr), "%ld", pw->pw_expire);
+       snprintf(chgstr, sizeof(chgstr), "%ld", (long)pw->pw_change);
+       snprintf(expstr, sizeof(expstr), "%ld", (long)pw->pw_expire);
 
        if (!(from = fdopen(ffd, "r")))
                pw_error(_PATH_MASTERPASSWD, 1, 1);