Page MenuHomeFreeBSD

D15144.id41698.diff
No OneTemporary

D15144.id41698.diff

Index: usr.sbin/pwd_mkdb/pwd_mkdb.8
===================================================================
--- usr.sbin/pwd_mkdb/pwd_mkdb.8
+++ usr.sbin/pwd_mkdb/pwd_mkdb.8
@@ -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
@@ -119,16 +119,6 @@
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.
.Pp
The following options may be specified and will affect the
generation of legacy entries.
Index: usr.sbin/pwd_mkdb/pwd_mkdb.c
===================================================================
--- usr.sbin/pwd_mkdb/pwd_mkdb.c
+++ usr.sbin/pwd_mkdb/pwd_mkdb.c
@@ -77,7 +77,7 @@
256, /* nelem */
2048 * 1024, /* cachesize */
NULL, /* hash() */
- BYTE_ORDER /* lorder */
+ BIG_ENDIAN /* lorder */
};
static enum state { FILE_INSECURE, FILE_SECURE, FILE_ORIG } clean;
@@ -115,15 +115,15 @@
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 */
openinfo.lorder = BIG_ENDIAN;
@@ -131,9 +131,6 @@
case 'C': /* verify only */
Cflag = 1;
break;
- case 'l': /* generate legacy entries */
- lflag = 1;
- break;
case 'L': /* little-endian output */
openinfo.lorder = LITTLE_ENDIAN;
break;
@@ -166,8 +163,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 +467,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 +496,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

Mime Type
text/plain
Expires
Wed, Sep 16, 9:52 PM (13 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39032250
Default Alt Text
D15144.id41698.diff (5 KB)

Event Timeline