diff options
author | drochner <drochner@pkgsrc.org> | 2006-03-01 17:16:01 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2006-03-01 17:16:01 +0000 |
commit | 82ccd20b2980a694a39ebb1709b1dedaa2c80eda (patch) | |
tree | 35d39384f129d34d9fdb53a3d95747a6e2a54198 /sysutils | |
parent | 6f58f9198ebb319335935163e910a6186fabb2c1 (diff) | |
download | pkgsrc-82ccd20b2980a694a39ebb1709b1dedaa2c80eda.tar.gz |
update for changes in <dev/scsipi/scsi*.h> headers in NetBSD-3 and later;
now this is for NetBSD>=3 only (until the next header change...), but
as I'm appearently the only person who has bought that crap I don't
feel bad about it
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/easydiskpasswd/Makefile | 7 | ||||
-rw-r--r-- | sysutils/easydiskpasswd/files/easydiskpasswd.c | 14 |
2 files changed, 11 insertions, 10 deletions
diff --git a/sysutils/easydiskpasswd/Makefile b/sysutils/easydiskpasswd/Makefile index d47a78f0417..da8001edd7d 100644 --- a/sysutils/easydiskpasswd/Makefile +++ b/sysutils/easydiskpasswd/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2006/01/04 04:29:08 schmonz Exp $ +# $NetBSD: Makefile,v 1.9 2006/03/01 17:16:01 drochner Exp $ DISTNAME= easydiskpasswd-1.0 CATEGORIES= sysutils @@ -12,8 +12,9 @@ BROKEN_IN= pkgsrc-2005Q4 WRKSRC= ${WRKDIR} NO_CHECKSUM= yes -# we depend on SCIOCCOMMAND and the "make" infrastructure -ONLY_FOR_PLATFORM= NetBSD-*-* +# we depend on SCIOCCOMMAND, a header defining sense codes +# and the "make" infrastructure +ONLY_FOR_PLATFORM= NetBSD-[3-9]*-* do-extract: ${CP} ${FILESDIR}/easydiskpasswd.c ${FILESDIR}/Makefile ${WRKSRC} diff --git a/sysutils/easydiskpasswd/files/easydiskpasswd.c b/sysutils/easydiskpasswd/files/easydiskpasswd.c index 2de296bf3f0..25e71f96a1e 100644 --- a/sysutils/easydiskpasswd/files/easydiskpasswd.c +++ b/sysutils/easydiskpasswd/files/easydiskpasswd.c @@ -1,4 +1,4 @@ -/* $NetBSD: easydiskpasswd.c,v 1.1.1.1 2002/09/19 20:56:57 drochner Exp $ */ +/* $NetBSD: easydiskpasswd.c,v 1.2 2006/03/01 17:16:01 drochner Exp $ */ /* * Copyright (c) 2002 * Matthias Drochner. All rights reserved. @@ -32,7 +32,7 @@ #include <sys/types.h> #include <sys/param.h> #include <sys/scsiio.h> -#include <dev/scsipi/scsipi_all.h> +#include <dev/scsipi/scsi_spc.h> #include <util.h> #include <string.h> #include <fcntl.h> @@ -106,7 +106,7 @@ main(argc, argv) char pathbuf[MAXPATHLEN]; const char *passwd = 0; struct scsireq cmd; - struct scsipi_sense_data *sd; + struct scsi_sense_data *sd; while ((ch = getopt(argc, argv, "dp:")) != -1) switch (ch) { @@ -158,11 +158,11 @@ main(argc, argv) err(2, "SCIOCCOMMAND"); if (cmd.retsts == SCCMD_SENSE) { - sd = (struct scsipi_sense_data *)&cmd.sense; - if ((sd->flags & SSD_KEY) == SKEY_ILLEGAL_REQUEST) { - if (sd->add_sense_code == 0x24) + sd = (struct scsi_sense_data *)&cmd.sense; + if (SSD_SENSE_KEY(sd->flags) == SKEY_ILLEGAL_REQUEST) { + if (sd->asc == 0x24) errx(3, "wrong password"); - if (sd->add_sense_code == 0x20) { + if (sd->asc == 0x20) { /* XXX shouldn't get here (caught above) */ warnx("no password set"); exit (0); |