Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137486206
D15144.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D15144.diff
View Options
Index: head/usr.sbin/pwd_mkdb/pwd_mkdb.8
===================================================================
--- head/usr.sbin/pwd_mkdb/pwd_mkdb.8
+++ head/usr.sbin/pwd_mkdb/pwd_mkdb.8
@@ -28,7 +28,7 @@
.\" @(#)pwd_mkdb.8 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd April 22, 2018
+.Dd April 30, 2018
.Dt PWD_MKDB 8
.Os
.Sh NAME
@@ -36,7 +36,7 @@
.Nd "generate the password databases"
.Sh SYNOPSIS
.Nm
-.Op Fl BCilLNp
+.Op Fl BCiLNp
.Op Fl d Ar directory
.Op Fl s Ar cachesize
.Op Fl u Ar username
@@ -112,31 +112,8 @@
The databases are used by the C library password routines (see
.Xr getpwent 3 ) .
.Pp
-By default,
-the
-.Nm
-utility generates new,
-machine independent format
-.Pq v4
-entries only.
-For compatibility with
-.Fx 5.0
-and earlier releases,
-the
-.Fl l
-option may be specified,
-which enables generation of legacy format
-.Pq v3
-entries.
-The legacy format entries are endianness dependent.
-The
-.Fl l
-option is deprecated and is not present in
-.Fx 12.0
-and later.
-.Pp
-The following options may be specified and will affect the
-generation of legacy entries.
+The following options affected the generation of legacy entries,
+and are now deprecated.
.Bl -tag -width flag
.It Fl B
Store data in big-endian format.
Index: head/usr.sbin/pwd_mkdb/pwd_mkdb.c
===================================================================
--- head/usr.sbin/pwd_mkdb/pwd_mkdb.c
+++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c
@@ -115,26 +115,25 @@
char sbuf2[MAXPATHLEN];
char *username;
u_int method, methoduid;
- int Cflag, dflag, iflag, lflag;
+ int Cflag, dflag, iflag;
int nblock = 0;
- iflag = dflag = Cflag = lflag = 0;
+ iflag = dflag = Cflag = 0;
strcpy(prefix, _PATH_PWD);
makeold = 0;
username = NULL;
oldfp = NULL;
- while ((ch = getopt(argc, argv, "BCLlNd:ips:u:v")) != -1)
+ while ((ch = getopt(argc, argv, "BCLNd:ips:u:v")) != -1)
switch(ch) {
case 'B': /* big-endian output */
+ warnx("endiannes options (-B/-L) are deprecated");
openinfo.lorder = BIG_ENDIAN;
break;
case 'C': /* verify only */
Cflag = 1;
break;
- case 'l': /* generate legacy entries */
- lflag = 1;
- break;
case 'L': /* little-endian output */
+ warnx("endiannes options (-B/-L) are deprecated");
openinfo.lorder = LITTLE_ENDIAN;
break;
case 'N': /* do not wait for lock */
@@ -166,8 +165,6 @@
if (argc != 1 || (username && (*username == '+' || *username == '-')))
usage();
- if (lflag)
- warnx("legacy (v3) database format support is deprecated");
/*
* This could be changed to allow the user to interrupt.
@@ -472,98 +469,6 @@
if ((sdp->put)(sdp, &key, &sdata, method) == -1)
error("put");
}
-
- if (lflag) {
- /* Create insecure data. (legacy version) */
- p = buf;
- COMPACT(pwd.pw_name);
- COMPACT("*");
- LSCALAR(pwd.pw_uid);
- LSCALAR(pwd.pw_gid);
- LSCALAR(pwd.pw_change);
- COMPACT(pwd.pw_class);
- COMPACT(pwd.pw_gecos);
- COMPACT(pwd.pw_dir);
- COMPACT(pwd.pw_shell);
- LSCALAR(pwd.pw_expire);
- LSCALAR(pwd.pw_fields);
- data.size = p - buf;
-
- /* Create secure data. (legacy version) */
- p = sbuf;
- COMPACT(pwd.pw_name);
- COMPACT(pwd.pw_passwd);
- LSCALAR(pwd.pw_uid);
- LSCALAR(pwd.pw_gid);
- LSCALAR(pwd.pw_change);
- COMPACT(pwd.pw_class);
- COMPACT(pwd.pw_gecos);
- COMPACT(pwd.pw_dir);
- COMPACT(pwd.pw_shell);
- LSCALAR(pwd.pw_expire);
- LSCALAR(pwd.pw_fields);
- sdata.size = p - sbuf;
-
- /* Store insecure by name. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME);
- len = strlen(pwd.pw_name);
- memmove(tbuf + 1, pwd.pw_name, len);
- key.size = len + 1;
- if ((dp->put)(dp, &key, &data, method) == -1)
- error("put");
-
- /* Store insecure by number. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM);
- store = HTOL(cnt);
- memmove(tbuf + 1, &store, sizeof(store));
- key.size = sizeof(store) + 1;
- if ((dp->put)(dp, &key, &data, method) == -1)
- error("put");
-
- /* Store insecure by uid. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID);
- store = HTOL(pwd.pw_uid);
- memmove(tbuf + 1, &store, sizeof(store));
- key.size = sizeof(store) + 1;
- if ((dp->put)(dp, &key, &data, methoduid) == -1)
- error("put");
-
- /* Store secure by name. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME);
- len = strlen(pwd.pw_name);
- memmove(tbuf + 1, pwd.pw_name, len);
- key.size = len + 1;
- if ((sdp->put)(sdp, &key, &sdata, method) == -1)
- error("put");
-
- /* Store secure by number. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM);
- store = HTOL(cnt);
- memmove(tbuf + 1, &store, sizeof(store));
- key.size = sizeof(store) + 1;
- if ((sdp->put)(sdp, &key, &sdata, method) == -1)
- error("put");
-
- /* Store secure by uid. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID);
- store = HTOL(pwd.pw_uid);
- memmove(tbuf + 1, &store, sizeof(store));
- key.size = sizeof(store) + 1;
- if ((sdp->put)(sdp, &key, &sdata, methoduid) == -1)
- error("put");
-
- /* Store insecure and secure special plus and special minus */
- if (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-') {
- tbuf[0] = LEGACY_VERSION(_PW_KEYYPBYNUM);
- store = HTOL(ypcnt);
- memmove(tbuf + 1, &store, sizeof(store));
- key.size = sizeof(store) + 1;
- if ((dp->put)(dp, &key, &data, method) == -1)
- error("put");
- if ((sdp->put)(sdp, &key, &sdata, method) == -1)
- error("put");
- }
- }
}
/* Create original format password file entry */
if (is_comment && makeold){ /* copy comments */
@@ -593,14 +498,6 @@
error("put");
if ((sdp->put)(sdp, &key, &data, method) == -1)
error("put");
- if (lflag) {
- tbuf[0] = LEGACY_VERSION(_PW_KEYYPENABLED);
- key.size = 1;
- if ((dp->put)(dp, &key, &data, method) == -1)
- error("put");
- if ((sdp->put)(sdp, &key, &data, method) == -1)
- error("put");
- }
}
if ((dp->close)(dp) == -1)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 24, 10:02 PM (14 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26076993
Default Alt Text
D15144.diff (5 KB)
Attached To
Mode
D15144: pwd_mkdb: retire legacy v3 db support (-l option)
Attached
Detach File
Event Timeline
Log In to Comment