From 61820dc75cdd9eab89314571f86d09289c735135 Mon Sep 17 00:00:00 2001 From: Antoine Leca Date: Wed, 20 Jul 2016 11:50:25 +0200 Subject: [PATCH 1/3] Remove long-obsolete pwdauth(8) command (in usr/lib) --- distrib/sets/lists/minix-base/mi | 2 +- distrib/sets/lists/minix-man/mi | 2 +- minix/commands/Makefile | 2 +- minix/commands/pwdauth/Makefile | 8 ---- minix/commands/pwdauth/pwdauth.8 | 57 ------------------------- minix/commands/pwdauth/pwdauth.c | 73 -------------------------------- minix/man/man5/passwd.5 | 4 +- 7 files changed, 5 insertions(+), 143 deletions(-) delete mode 100644 minix/commands/pwdauth/Makefile delete mode 100644 minix/commands/pwdauth/pwdauth.8 delete mode 100644 minix/commands/pwdauth/pwdauth.c diff --git a/distrib/sets/lists/minix-base/mi b/distrib/sets/lists/minix-base/mi index 41c615fe9..40f00982e 100644 --- a/distrib/sets/lists/minix-base/mi +++ b/distrib/sets/lists/minix-base/mi @@ -927,7 +927,7 @@ ./usr/lib/pkgconfig/openssl.pc minix-base crypto ./usr/lib/pkgconfig/sqlite3.pc minix-base ./usr/lib/pkgconfig/zlib.pc minix-base -./usr/lib/pwdauth minix-base +./usr/lib/pwdauth minix-base obsolete ./usr/lib/security minix-base ./usr/libdata minix-base ./usr/libdata/debug minix-base diff --git a/distrib/sets/lists/minix-man/mi b/distrib/sets/lists/minix-man/mi index 3447dd600..a188227b3 100644 --- a/distrib/sets/lists/minix-man/mi +++ b/distrib/sets/lists/minix-man/mi @@ -3424,7 +3424,7 @@ ./usr/man/man8/pr_routes.8 minix-man ./usr/man/man8/printroot.8 minix-man ./usr/man/man8/pwd_mkdb.8 minix-man -./usr/man/man8/pwdauth.8 minix-man +./usr/man/man8/pwdauth.8 minix-man obsolete ./usr/man/man8/rarpd.8 minix-man ./usr/man/man8/rawspeed.8 minix-man ./usr/man/man8/rdate.8 minix-man diff --git a/minix/commands/Makefile b/minix/commands/Makefile index ff23a8d9b..68157c149 100644 --- a/minix/commands/Makefile +++ b/minix/commands/Makefile @@ -18,7 +18,7 @@ SUBDIR= add_route arp at backup \ mount mt netconf \ nonamed \ postinstall prep printroot \ - profile progressbar pr_routes pwdauth \ + profile progressbar pr_routes \ ramdisk rarpd rawspeed readclock \ remsync rget rlogin \ rotate service setup \ diff --git a/minix/commands/pwdauth/Makefile b/minix/commands/pwdauth/Makefile deleted file mode 100644 index beba9b27e..000000000 --- a/minix/commands/pwdauth/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -PROG= pwdauth -BINDIR= /usr/lib -BINMODE= 4755 -MAN= pwdauth.8 - -LDADD+=-lcrypt - -.include diff --git a/minix/commands/pwdauth/pwdauth.8 b/minix/commands/pwdauth/pwdauth.8 deleted file mode 100644 index c1e55dad0..000000000 --- a/minix/commands/pwdauth/pwdauth.8 +++ /dev/null @@ -1,57 +0,0 @@ -.SH NAME -pwdauth \- password authentication program -.SH SYNOPSIS -.B /usr/lib/pwdauth -.SH DESCRIPTION -.B Pwdauth -is a program that is used by the -.BR crypt (3) -function to do the hard work. It is a setuid root utility so that it is -able to read the shadow password file. -.PP -.B Pwdauth -expects on standard input two null terminated strings, the -password typed by the user, and the salt. That is, the two arguments of -the -.B crypt -function. The input read in a single read call must be 1024 characters or -less including the nulls. -.B Pwdauth -takes one of two actions depending on the salt. -.PP -If the salt has the form "\fB##\fIuser\fR" then the -.I user -is used to index the shadow password file to obtain the encrypted password. -The input password is encrypted with the one-way encryption function -contained within -.B pwdauth -and compared to the encrypted password from the shadow password file. If -equal then -.B pwdauth -returns the string "\fB##\fIuser\fR" with exit code 0, otherwise exit -code 2 to signal failure. The string "\fB##\fIuser\fR" is also returned -if both the shadow password and the input password are null strings to -allow a password-less login. -.PP -If the salt is not of the form "\fB##\fIuser\fR" then the password is -encrypted and the result of the encryption is returned. If salt and -password are null strings then a null string is returned. -.PP -The return value is written to standard output as a null terminated string -of 1024 characters or less including the null. -.PP -The exit code is 1 on any error. -.SH "SEE ALSO" -.BR crypt (3), -.BR passwd (5). -.SH NOTES -A password must be checked like in this example: -.PP -.RS -pw_ok = (strcmp(crypt(key, pw->pw_passwd), pw->pw_passwd) == 0); -.RE -.PP -The second argument of crypt must be the entire encrypted password and -not just the two character salt. -.SH AUTHOR -Kees J. Bot (kjb@cs.vu.nl) diff --git a/minix/commands/pwdauth/pwdauth.c b/minix/commands/pwdauth/pwdauth.c deleted file mode 100644 index 7951731de..000000000 --- a/minix/commands/pwdauth/pwdauth.c +++ /dev/null @@ -1,73 +0,0 @@ -/* pwdauth 2.0 - check a shadow password Author: Kees J. Bot - * 7 Feb 1994 - * - * This program gets as input the key and salt arguments of the crypt(3) - * function as two null terminated strings. The crypt result is output as - * one null terminated string. Input and output must be <= 1024 characters. - * The exit code will be 1 on any error. - * - * If the key has the form '##name' then the key will be encrypted and the - * result checked to be equal to the encrypted password in the shadow password - * file. If equal than '##name' will be returned, otherwise exit code 2. - * - * Otherwise the key will be encrypted normally and the result returned. - * - * As a special case, anything matches a null encrypted password to allow - * a no-password login. - */ -#define nil 0 -#include -#include -#include -#include -#include -#include - -#define setkey pwdauth_setkey -#define encrypt pwdauth_encrypt - -#define LEN 1024 - -int main(int argc, char **argv) -{ - char key[LEN]; - char *salt; - struct passwd *pw; - int n; - - /* Read input data. Check if there are exactly two null terminated - * strings. - */ - n= read(0, key, LEN); - if (n < 0) return 1; - salt = key + n; - n = 0; - while (salt > key) if (*--salt == 0) n++; - if (n != 2) return 1; - salt = key + strlen(key) + 1; - - if (salt[0] == '#' && salt[1] == '#') { - if ((pw= getpwnam(salt + 2)) == nil) return 2; - - /* A null encrypted password matches a null key, otherwise - * do the normal crypt(3) authentication check. - */ - if (*pw->pw_passwd == 0 && *key == 0) { - /* fine */ - } else - if (strcmp(crypt(key, pw->pw_passwd), pw->pw_passwd) != 0) { - return 2; - } - } else { - /* Normal encryption. */ - if (*salt == 0 && *key == 0) { - /* fine */ - } else { - salt= crypt(key, salt); - } - } - - /* Return the (possibly new) salt to the caller. */ - if (write(1, salt, strlen(salt) + 1) < 0) return 1; - return 0; -} diff --git a/minix/man/man5/passwd.5 b/minix/man/man5/passwd.5 index ac902d1e6..a0ca47649 100644 --- a/minix/man/man5/passwd.5 +++ b/minix/man/man5/passwd.5 @@ -94,7 +94,7 @@ to indicate the entry in the shadow password file. The password in this entry is then used for authentication of the user. The shadow file can only be read by the privileged utility -.BR pwdauth (8), +.BR pwd_mkdb (8), so that the encrypted passwords in the shadow file are kept secret, and thus safe from a dictionary attack. .SS "Special password and group file entries" @@ -188,7 +188,7 @@ The shadow password file. .BR crypt (3), .BR getpwent (3), .BR getgrent (3), -.BR pwdauth (8). +.BR pwd_mkdb (8). .SH NOTES The .B nobody From c16bc74ff80e9ebe75388b10a289acd00ab07200 Mon Sep 17 00:00:00 2001 From: Antoine Leca Date: Wed, 20 Jul 2016 12:13:26 +0200 Subject: [PATCH 2/3] Drop obsolete postinstall script Conflicts with NetBSD /usr/sbin/postinstall(8) --- distrib/sets/lists/minix-base/mi | 2 +- minix/commands/Makefile | 2 +- minix/commands/postinstall/Makefile | 4 ---- minix/commands/postinstall/postinstall.sh | 11 ----------- 4 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 minix/commands/postinstall/Makefile delete mode 100644 minix/commands/postinstall/postinstall.sh diff --git a/distrib/sets/lists/minix-base/mi b/distrib/sets/lists/minix-base/mi index 40f00982e..cb0c69fdb 100644 --- a/distrib/sets/lists/minix-base/mi +++ b/distrib/sets/lists/minix-base/mi @@ -441,7 +441,7 @@ ./usr/bin/pkgin_cd minix-base ./usr/bin/pkgin_sets minix-base ./usr/bin/playwave minix-base -./usr/bin/postinstall minix-base +./usr/bin/postinstall minix-base obsolete ./usr/bin/pr minix-base ./usr/bin/pr_routes minix-base ./usr/bin/prep minix-base diff --git a/minix/commands/Makefile b/minix/commands/Makefile index 68157c149..08f04f17f 100644 --- a/minix/commands/Makefile +++ b/minix/commands/Makefile @@ -17,7 +17,7 @@ SUBDIR= add_route arp at backup \ lpd lspci mail MAKEDEV \ mount mt netconf \ nonamed \ - postinstall prep printroot \ + prep printroot \ profile progressbar pr_routes \ ramdisk rarpd rawspeed readclock \ remsync rget rlogin \ diff --git a/minix/commands/postinstall/Makefile b/minix/commands/postinstall/Makefile deleted file mode 100644 index 485cf0213..000000000 --- a/minix/commands/postinstall/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -SCRIPTS= postinstall.sh -MAN= - -.include diff --git a/minix/commands/postinstall/postinstall.sh b/minix/commands/postinstall/postinstall.sh deleted file mode 100644 index e831e0daf..000000000 --- a/minix/commands/postinstall/postinstall.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -echo -n "Would you like to install binary packages from the CD? (y/N) " -read y -if [ "$y" = y -o "$y" = Y ] -then echo "Ok, showing you a list of packages, please type y" - echo "for every package you want installed." - /usr/bin/packme -else echo "Ok, not installing binary packages." -fi -echo "Use the 'packme' command after rebooting MINIX to get another chance" -echo "to install binary packages." From 1a83c06185f94916504e4af342694a22fd53d257 Mon Sep 17 00:00:00 2001 From: Antoine Leca Date: Wed, 20 Jul 2016 17:43:35 +0200 Subject: [PATCH 3/3] Clean up traces from long-gone sys_int86 interface Change-Id: I78ddb4d903aa5909e18e55474da35e6b8c9d5e05 --- distrib/sets/lists/minix-comp/md.i386 | 2 +- minix/commands/service/parse.c | 1 - minix/include/arch/i386/include/Makefile | 2 +- minix/include/arch/i386/include/int86.h | 61 ------------------------ minix/include/minix/com.h | 2 +- minix/include/minix/syslib.h | 2 - minix/lib/libsys/arch/i386/Makefile.inc | 1 - minix/lib/libsys/arch/i386/sys_int86.c | 17 ------- 8 files changed, 3 insertions(+), 85 deletions(-) delete mode 100644 minix/include/arch/i386/include/int86.h delete mode 100644 minix/lib/libsys/arch/i386/sys_int86.c diff --git a/distrib/sets/lists/minix-comp/md.i386 b/distrib/sets/lists/minix-comp/md.i386 index 78d78305f..a7f9af776 100644 --- a/distrib/sets/lists/minix-comp/md.i386 +++ b/distrib/sets/lists/minix-comp/md.i386 @@ -134,7 +134,7 @@ ./usr/include/i386/ibcs2_machdep.h minix-comp ./usr/include/i386/ieee.h minix-comp ./usr/include/i386/ieeefp.h minix-comp -./usr/include/i386/int86.h minix-comp +./usr/include/i386/int86.h minix-comp obsolete ./usr/include/i386/int_const.h minix-comp ./usr/include/i386/int_fmtio.h minix-comp ./usr/include/i386/int_limits.h minix-comp diff --git a/minix/commands/service/parse.c b/minix/commands/service/parse.c index af2d349ef..dfae9e3c3 100644 --- a/minix/commands/service/parse.c +++ b/minix/commands/service/parse.c @@ -835,7 +835,6 @@ struct { "UMAP_REMOTE", SYS_UMAP_REMOTE }, { "VUMAP", SYS_VUMAP }, { "IRQCTL", SYS_IRQCTL }, - { "INT86", SYS_INT86 }, { "DEVIO", SYS_DEVIO }, { "SDEVIO", SYS_SDEVIO }, { "VDEVIO", SYS_VDEVIO }, diff --git a/minix/include/arch/i386/include/Makefile b/minix/include/arch/i386/include/Makefile index 1fa8a6df5..196c83a88 100644 --- a/minix/include/arch/i386/include/Makefile +++ b/minix/include/arch/i386/include/Makefile @@ -2,7 +2,7 @@ INCSDIR= /usr/include/i386 INCS= archconst.h archtypes.h bios.h cmos.h \ - diskparm.h elf.h fpu.h int86.h interrupt.h \ + diskparm.h elf.h fpu.h interrupt.h \ ipcconst.h memory.h partition.h \ pci_amd.h pci.h pci_intel.h pci_sis.h \ pci_via.h ports.h stackframe.h vm.h diff --git a/minix/include/arch/i386/include/int86.h b/minix/include/arch/i386/include/int86.h deleted file mode 100644 index 30d6fa67f..000000000 --- a/minix/include/arch/i386/include/int86.h +++ /dev/null @@ -1,61 +0,0 @@ -/* int86.h - 8086 interrupt types Author: Kees J. Bot - * 3 May 2000 - */ - -/* Registers used in an PC real mode call for BIOS or DOS services. A - * driver is called through the vector if the interrupt number is zero. - */ -union reg86 { - struct l { - u32_t ef; /* 32 bit flags (output only) */ - u32_t vec; /* Driver vector (input only) */ - u32_t _ds_es[1]; - u32_t eax; /* 32 bit general registers */ - u32_t ebx; - u32_t ecx; - u32_t edx; - u32_t esi; - u32_t edi; - u32_t ebp; - } l; - struct w { - u16_t f, _ef[1]; /* 16 bit flags (output only) */ - u16_t off, seg; /* Driver vector (input only) */ - u16_t ds, es; /* DS and ES real mode segment regs */ - u16_t ax, _eax[1]; /* 16 bit general registers */ - u16_t bx, _ebx[1]; - u16_t cx, _ecx[1]; - u16_t dx, _edx[1]; - u16_t si, _esi[1]; - u16_t di, _edi[1]; - u16_t bp, _ebp[1]; - } w; - struct b { - u8_t intno, _intno[3]; /* Interrupt number (input only) */ - u8_t _vec[4]; - u8_t _ds_es[4]; - u8_t al, ah, _eax[2]; /* 8 bit general registers */ - u8_t bl, bh, _ebx[2]; - u8_t cl, ch, _ecx[2]; - u8_t dl, dh, _edx[2]; - u8_t _esi[4]; - u8_t _edi[4]; - u8_t _ebp[4]; - } b; -}; - -struct reg86u { union reg86 u; }; /* Better for forward declarations */ - -/* Parameters passed on ioctls to the memory task. */ - -struct mio_int86 { /* MIOCINT86 */ - union reg86 reg86; /* x86 registers as above */ - u16_t off, seg; /* Address of kernel buffer */ - void *buf; /* User data buffer */ - size_t len; /* Size of user buffer */ -}; - -struct mio_ldt86 { /* MIOCGLDT86, MIOCSLDT86 */ - size_t idx; /* Index in process' LDT */ - u16_t entry[4]; /* One LDT entry to get or set. */ -}; diff --git a/minix/include/minix/com.h b/minix/include/minix/com.h index f6a728630..35367e9ea 100644 --- a/minix/include/minix/com.h +++ b/minix/include/minix/com.h @@ -224,7 +224,7 @@ # define SYS_VUMAP (KERNEL_CALL + 18) /* sys_vumap() */ # define SYS_IRQCTL (KERNEL_CALL + 19) /* sys_irqctl() */ -# define SYS_INT86 (KERNEL_CALL + 20) /* sys_int86() */ + # define SYS_DEVIO (KERNEL_CALL + 21) /* sys_devio() */ # define SYS_SDEVIO (KERNEL_CALL + 22) /* sys_sdevio() */ # define SYS_VDEVIO (KERNEL_CALL + 23) /* sys_vdevio() */ diff --git a/minix/include/minix/syslib.h b/minix/include/minix/syslib.h index 6f884508d..1b5ebf11a 100644 --- a/minix/include/minix/syslib.h +++ b/minix/include/minix/syslib.h @@ -15,7 +15,6 @@ #include /* Forward declaration */ -struct reg86u; struct rs_pci; struct rusage; @@ -55,7 +54,6 @@ int sys_privquery_mem(endpoint_t proc_ep, phys_bytes physstart, phys_bytes physlen); int sys_setgrant(cp_grant_t *grants, int ngrants); -int sys_int86(struct reg86u *reg86p); int sys_vm_setbuf(phys_bytes base, phys_bytes size, phys_bytes high); int sys_vm_map(endpoint_t proc_ep, int do_map, phys_bytes base, phys_bytes size, phys_bytes offset); diff --git a/minix/lib/libsys/arch/i386/Makefile.inc b/minix/lib/libsys/arch/i386/Makefile.inc index 9b9aa2d38..19f85b7e0 100644 --- a/minix/lib/libsys/arch/i386/Makefile.inc +++ b/minix/lib/libsys/arch/i386/Makefile.inc @@ -11,7 +11,6 @@ SRCS+= \ spin.c \ sys_eniop.c \ sys_in.c \ - sys_int86.c \ sys_out.c \ sys_readbios.c \ sys_sdevio.c \ diff --git a/minix/lib/libsys/arch/i386/sys_int86.c b/minix/lib/libsys/arch/i386/sys_int86.c deleted file mode 100644 index f697819cb..000000000 --- a/minix/lib/libsys/arch/i386/sys_int86.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "syslib.h" - -/*===========================================================================* - * sys_int86 * - *===========================================================================*/ -int sys_int86(reg86p) -struct reg86u *reg86p; -{ - message m; - int result; - - m.m1_p1= (char *)reg86p; - - result = _kernel_call(SYS_INT86, &m); - return(result); -} -