From owner-svn-src-all@FreeBSD.ORG Thu Jun 4 08:00:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 709F7208; Thu, 4 Jun 2015 08:00:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FB99121A; Thu, 4 Jun 2015 08:00:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5480DQR006295; Thu, 4 Jun 2015 08:00:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5480CJd006286; Thu, 4 Jun 2015 08:00:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506040800.t5480CJd006286@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 4 Jun 2015 08:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283984 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2015 08:00:13 -0000 Author: bapt Date: Thu Jun 4 08:00:11 2015 New Revision: 283984 URL: https://svnweb.freebsd.org/changeset/base/283984 Log: revert r283969,283970 not needed anymore after r283981 Modified: head/lib/libutil/Makefile head/lib/libutil/libutil.h head/lib/libutil/pw_util.3 head/lib/libutil/pw_util.c Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Thu Jun 4 07:37:09 2015 (r283983) +++ head/lib/libutil/Makefile Thu Jun 4 08:00:11 2015 (r283984) @@ -78,7 +78,6 @@ MLINKS+=pw_util.3 pw_copy.3 \ pw_util.3 pw_make.3 \ pw_util.3 pw_make_v7.3 \ pw_util.3 pw_mkdb.3 \ - pw_util.3 pw_mkdb2.3 \ pw_util.3 pw_lock.3 \ pw_util.3 pw_scan.3 \ pw_util.3 pw_tempname.3 \ Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Thu Jun 4 07:37:09 2015 (r283983) +++ head/lib/libutil/libutil.h Thu Jun 4 08:00:11 2015 (r283984) @@ -144,9 +144,6 @@ char *fparseln(FILE *_fp, size_t *_len, #endif #ifdef _PWD_H_ -#define PWDB_NATIVE 0 -#define PWDB_LE 1 -#define PWDB_BE 2 int pw_copy(int _ffd, int _tfd, const struct passwd *_pw, struct passwd *_old_pw); struct passwd @@ -158,7 +155,6 @@ int pw_init(const char *_dir, const char char *pw_make(const struct passwd *_pw); char *pw_make_v7(const struct passwd *_pw); int pw_mkdb(const char *_user); -int pw_mkdb2(const char *_user, int endian); int pw_lock(void); struct passwd * pw_scan(const char *_line, int _flags); Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Thu Jun 4 07:37:09 2015 (r283983) +++ head/lib/libutil/pw_util.3 Thu Jun 4 08:00:11 2015 (r283984) @@ -37,7 +37,6 @@ .Nm pw_make , .Nm pw_make_v7 , .Nm pw_mkdb , -.Nm pw_mkdb2 , .Nm pw_lock , .Nm pw_scan , .Nm pw_tempname , @@ -67,8 +66,6 @@ .Ft int .Fn pw_mkdb "const char *user" .Ft int -.Fn pw_mkdb "const char *user" "int endian" -.Ft int .Fn pw_lock "void" .Ft "struct passwd *" .Fn pw_scan "const char *line" "int flags" @@ -228,30 +225,11 @@ function regenerates the password databa .Xr pwd_mkdb 8 . If .Fa user -is set, only the record corresponding to that user will be updated. +only the record corresponding to that user will be updated. The .Fn pw_mkdb function returns 0 in case of success and -1 in case of failure. .Pp -.Fn pw_mkdb2 -function regenerates the password database by running -.Xr pwd_mkdb 8 . -If -.Fa user -is set, only the record corresponding to that user will be updated. -.Pp -The -.Fa endian -variable can take the following values -.Bl -tag -width PWDB_NATIVE -.It Dv PWDB_NATIVE -The database will be generated in host native endianness. -.It Dv PWDB_LE -The database will be generated in Little-endian. -.It Dv PWDB_BE -The database will be generated in Big-endian. -.El -.Pp The .Fn pw_lock function locks the master password file. Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Thu Jun 4 07:37:09 2015 (r283983) +++ head/lib/libutil/pw_util.c Thu Jun 4 08:00:11 2015 (r283984) @@ -242,36 +242,14 @@ pw_tmp(int mfd) return (tfd); } -int -pw_mkdb(const char *user) -{ - - return (pw_mkdb2(user, PWDB_NATIVE)); -} - /* * Regenerate the password database. */ int -pw_mkdb2(const char *user, int endian) +pw_mkdb(const char *user) { int pstat; pid_t pid; - const char *arg; - - switch (endian) { - case PWDB_NATIVE: - arg = "-p"; - break; - case PWDB_LE: - arg = "-pL"; - break; - case PWDB_BE: - arg = "-pB"; - break; - default: - return (-1); - } (void)fflush(stderr); switch ((pid = fork())) { @@ -280,10 +258,10 @@ pw_mkdb2(const char *user, int endian) case 0: /* child */ if (user == NULL) - execl(_PATH_PWD_MKDB, "pwd_mkdb", arg, + execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-d", passwd_dir, tempname, (char *)NULL); else - execl(_PATH_PWD_MKDB, "pwd_mkdb", arg, + execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-d", passwd_dir, "-u", user, tempname, (char *)NULL); _exit(1);