opie/opie.patch

changeset 482
8c83aede6fbd
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/opie/opie.patch	Mon Aug 06 13:34:16 2012 +0200
     1.3 @@ -0,0 +1,137 @@
     1.4 +Index: Makefile.in
     1.5 +--- Makefile.in.orig	2005-11-07 19:38:27 +0100
     1.6 ++++ Makefile.in	2005-11-07 19:38:52 +0100
     1.7 +@@ -152,7 +152,7 @@
     1.8 + 	@-for i in otp-md4 otp-md5; do ln -s opiekey.1 $(LOCALMAN)/man1/$$i.1; done
     1.9 + 	@if test ! -d $(LOCALMAN)/man1; then $(MKDIR) $(LOCALMAN)/man1; chmod 755 $(LOCALMAN)/man1; fi; cp opiekey.1 $(LOCALMAN)/man1/opiekey.1; $(CHOWN) $(OWNER) $(LOCALMAN)/man1/opiekey.1; chgrp $(GROUP) $(LOCALMAN)/man1/opiekey.1; chmod 644 $(LOCALMAN)/man1/opiekey.1
    1.10 + 
    1.11 +-server:	libopie/libopie.a libmissing/libmissing.a opietest-passed opielogin opiesu opiepasswd opieinfo opieftpd opieserv
    1.12 ++server:	libopie/libopie.a libmissing/libmissing.a opietest-passed opielogin opiesu opiepasswd opieinfo opieserv
    1.13 + 
    1.14 + server-install: server
    1.15 + 	@echo "Installing OPIE server software..."
    1.16 +Index: libopie/atob8.c
    1.17 +--- libopie/atob8.c.orig	1999-03-11 03:09:57 +0100
    1.18 ++++ libopie/atob8.c	2005-11-07 19:39:30 +0100
    1.19 +@@ -72,5 +72,5 @@
    1.20 +     *out++ |= val;
    1.21 +   }
    1.22 + 
    1.23 +-  return out;
    1.24 ++  return (char *)out;
    1.25 + }
    1.26 +Index: opie_cfg.h
    1.27 +--- opie_cfg.h.orig	2001-11-20 17:23:37 +0100
    1.28 ++++ opie_cfg.h	2005-11-07 19:39:05 +0100
    1.29 +@@ -69,6 +69,9 @@
    1.30 + #define DOUTMPX 0
    1.31 + #endif /* HAVE_GETUTXLINE && HAVE_UTMPX_H */
    1.32 + 
    1.33 ++#include <stdlib.h>
    1.34 ++#include <stdio.h>
    1.35 ++#include <string.h>
    1.36 + #include <sys/types.h>
    1.37 + /* Adapted from the Autoconf hypertext info pages */
    1.38 + #if HAVE_DIRENT_H
    1.39 +Index: libopie/generator.c
    1.40 +--- libopie/generator.c.orig	2006-06-18 02:06:28.215630000 +0200
    1.41 ++++ libopie/generator.c	2006-06-18 02:06:15.049431000 +0200
    1.42 +@@ -62,7 +62,7 @@
    1.43 + static int opieauto_connect FUNCTION_NOARGS
    1.44 + {
    1.45 +   int s;
    1.46 +-  struct sockaddr_un sun;
    1.47 ++  struct sockaddr_un locsun;
    1.48 +   char buffer[1024];
    1.49 +   char *c, *c2 ="/.opieauto";
    1.50 +   uid_t myuid = getuid(), myeuid = geteuid();
    1.51 +@@ -74,8 +74,8 @@
    1.52 +     return -1;
    1.53 +   };
    1.54 + 
    1.55 +-  memset(&sun, 0, sizeof(struct sockaddr_un));
    1.56 +-  sun.sun_family = AF_UNIX;
    1.57 ++  memset(&locsun, 0, sizeof(struct sockaddr_un));
    1.58 ++  locsun.sun_family = AF_UNIX;
    1.59 + 
    1.60 +   if (!(c = getenv("HOME"))) {
    1.61 + #if DEBUG
    1.62 +@@ -84,15 +84,15 @@
    1.63 +     return -1;
    1.64 +   };
    1.65 + 
    1.66 +-  if (strlen(c) > (sizeof(sun.sun_path) - strlen(c2) - 1)) {
    1.67 ++  if (strlen(c) > (sizeof(locsun.sun_path) - strlen(c2) - 1)) {
    1.68 + #if DEBUG
    1.69 +     syslog(LOG_DEBUG, "opieauto_connect: HOME is too long: %s", c);
    1.70 + #endif /* DEBUG */
    1.71 +     return -1;
    1.72 +   };
    1.73 + 
    1.74 +-  strcpy(sun.sun_path, c);
    1.75 +-  strcat(sun.sun_path, c2);
    1.76 ++  strcpy(locsun.sun_path, c);
    1.77 ++  strcat(locsun.sun_path, c2);
    1.78 + 
    1.79 +   if ((s = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
    1.80 + #if DEBUG
    1.81 +@@ -104,14 +104,14 @@
    1.82 +   {
    1.83 +     struct stat st;
    1.84 + 
    1.85 +-    if (stat(sun.sun_path, &st) < 0) {
    1.86 ++    if (stat(locsun.sun_path, &st) < 0) {
    1.87 + #if DEBUG
    1.88 +       syslog(LOG_DEBUG, "opieauto_connect: stat: %s(%d)\n", strerror(errno), errno);
    1.89 + #endif /* DEBUG */
    1.90 +       goto ret;
    1.91 +     };
    1.92 + 
    1.93 +-    if (connect(s, (struct sockaddr *)&sun, sizeof(struct sockaddr_un))) {
    1.94 ++    if (connect(s, (struct sockaddr *)&locsun, sizeof(struct sockaddr_un))) {
    1.95 + #if DEBUG
    1.96 +       syslog(LOG_DEBUG, "opieauto_connect: connect: %s(%d)\n", strerror(errno), errno);
    1.97 + #endif /* DEBUG */
    1.98 +Index: opieauto.c
    1.99 +--- opieauto.c.orig	2001-11-20 16:18:42.000000000 +0100
   1.100 ++++ opieauto.c	2006-06-18 02:28:20.526432000 +0200
   1.101 +@@ -282,10 +282,10 @@
   1.102 +     baile("atexit");
   1.103 + 
   1.104 +   {
   1.105 +-    struct sockaddr_un sun;
   1.106 ++    struct sockaddr_un locsun;
   1.107 + 
   1.108 +-    memset(&sun, 0, sizeof(struct sockaddr_un));
   1.109 +-    sun.sun_family = AF_UNIX;
   1.110 ++    memset(&locsun, 0, sizeof(struct sockaddr_un));
   1.111 ++    locsun.sun_family = AF_UNIX;
   1.112 + 
   1.113 +     {
   1.114 +     char *c;
   1.115 +@@ -294,12 +294,12 @@
   1.116 +     if (!(c = getenv("HOME")))
   1.117 +       bail("getenv(HOME) failed -- no HOME variable?");
   1.118 + 
   1.119 +-    if (strlen(c) > (sizeof(sun.sun_path) - strlen(c2) - 1))
   1.120 ++    if (strlen(c) > (sizeof(locsun.sun_path) - strlen(c2) - 1))
   1.121 +       bail("your HOME is too long");
   1.122 + 
   1.123 +-    strcpy(sun.sun_path, c);
   1.124 +-    strcat(sun.sun_path, c2);
   1.125 +-    sockpath = strdup(sun.sun_path);
   1.126 ++    strcpy(locsun.sun_path, c);
   1.127 ++    strcat(locsun.sun_path, c2);
   1.128 ++    sockpath = strdup(locsun.sun_path);
   1.129 +     };
   1.130 + 
   1.131 +     if ((parents = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
   1.132 +@@ -311,7 +311,7 @@
   1.133 +     if (umask(0177) < 0)
   1.134 +       baile("umask");
   1.135 + 
   1.136 +-    if (bind(parents, (struct sockaddr *)&sun, sizeof(struct sockaddr_un)))
   1.137 ++    if (bind(parents, (struct sockaddr *)&locsun, sizeof(struct sockaddr_un)))
   1.138 +       baile("bind");
   1.139 + 
   1.140 +     if (stat(sockpath, &st) < 0)

mercurial