Skip to content

Commit

Permalink
Whitespace changes for r283981. No actual code changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
delphij committed Jun 4, 2015
1 parent 82c0d88 commit f7eabb8
Showing 1 changed file with 88 additions and 88 deletions.
176 changes: 88 additions & 88 deletions usr.sbin/pwd_mkdb/pwd_mkdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,97 +469,97 @@ main(int argc, char *argv[])
}

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");
/* 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 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 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 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 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 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 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 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);
/* 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 ((dp->put)(dp, &key, &data, method) == -1)
error("put");
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 */
if (fprintf(oldfp, "%s\n", line) < 0)
Expand Down Expand Up @@ -589,13 +589,13 @@ main(int argc, char *argv[])
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");
}
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)
Expand Down

0 comments on commit f7eabb8

Please sign in to comment.