]> andersk Git - openssh.git/commitdiff
- (djm) Merged cleanup patch from Mark Miller <markm@swoon.net>
authordjm <djm>
Sun, 24 Sep 2000 00:10:13 +0000 (00:10 +0000)
committerdjm <djm>
Sun, 24 Sep 2000 00:10:13 +0000 (00:10 +0000)
 - (djm) A bit more cleanup - created cygwin_util.h

ChangeLog
bsd-arc4random.c
configure.in
cygwin_util.c
cygwin_util.h [new file with mode: 0644]
defines.h
includes.h
next-posix.h

index b6f22341d8c45a7d90d102ecdad22bf2a950278d..0290869b9b8053c0df7851c2f75565707f6504bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+20000924
+ - (djm) Merged cleanup patch from Mark Miller <markm@swoon.net>
+ - (djm) A bit more cleanup - created cygwin_util.h
+
 20000923
  - (djm) Fix address logging in utmp from Kevin Steves 
    <stevesk@sweden.hp.com>
index fb378d8488a6bccb726b506759893ade42c36494..ea0abf3f4966f21ef5d1da453d5003f0042d6eae 100644 (file)
  */
 
 #include "includes.h"
-#include <openssl/rand.h>
-#include <openssl/rc4.h>
 
 #ifndef HAVE_ARC4RANDOM
 
+#include <openssl/rand.h>
+#include <openssl/rc4.h>
+
 /* Size of key to use */
 #define SEED_SIZE 20
 
index 305d9a4939c13bcf202b6fec539de2ef82ab2ea7..398ab8c1b81d118da115418f4d05db8867c687a2 100644 (file)
@@ -230,7 +230,7 @@ if test -z "$no_libnsl" ; then
 fi
 
 # Checks for header files.
-AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h ttyent.h usersec.h util.h utmp.h utmpx.h)
+AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h ttyent.h usersec.h util.h utmp.h utmpx.h)
 
 dnl    Checks for library functions.
 AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo futimes gai_strerror getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid sigaction sigvec snprintf strerror strlcat strlcpy strsep vsnprintf vhangup _getpty __b64_ntop)
index 88748c4fb3be077e6a32cb69705db86aa6783f5b..b540ebe1a70f1390266b536018e46bd586fdcb84 100644 (file)
@@ -16,6 +16,7 @@
 #include "config.h"
 
 #ifdef HAVE_CYGWIN
+
 #include <fcntl.h>
 #include <io.h>
 #include <stdlib.h>
 
 int binary_open(const char *filename, int flags, mode_t mode)
 {
-       return open(filename, flags | O_BINARY, mode);
+       return open(filename, flags | O_BINARY, mode);
 }
 
 int binary_pipe(int fd[2])
 {
-       int ret = pipe(fd);
-       if (!ret) {
-               setmode (fd[0], O_BINARY);
-               setmode (fd[1], O_BINARY);
-       }
-       return ret;
+       int ret = pipe(fd);
+
+       if (!ret) {
+               setmode (fd[0], O_BINARY);
+               setmode (fd[1], O_BINARY);
+       }
+       return ret;
 }
 
-int check_nt_auth (int pwd_authenticated, uid_t uid)
+int check_nt_auth(int pwd_authenticated, uid_t uid)
 {
        /*
-        * The only authentication which is able to change the user
-        * context on NT systems is the password authentication. So
-        * we deny all requsts for changing the user context if another
-        * authentication method is used.
-        * This may change in future when a special openssh
-        * subauthentication package is available.
-        */
+       * The only authentication which is able to change the user
+       * context on NT systems is the password authentication. So
+       * we deny all requsts for changing the user context if another
+       * authentication method is used.
+       * This may change in future when a special openssh
+       * subauthentication package is available.
+       */
        if (is_winnt && !pwd_authenticated && geteuid() != uid)
                return 0;
+       
        return 1;
 }
 
-int check_ntsec (const char *filename)
+int check_ntsec(const char *filename)
 {
        char *cygwin;
        int allow_ntea = 0;
@@ -98,4 +101,5 @@ int check_ntsec (const char *filename)
 
        return 0;
 }
-#endif
+
+#endif /* HAVE_CYGWIN */
diff --git a/cygwin_util.h b/cygwin_util.h
new file mode 100644 (file)
index 0000000..efd28bf
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ *
+ * cygwin_util.c
+ *
+ * Author: Corinna Vinschen <vinschen@cygnus.com>
+ *
+ * Copyright (c) 2000 Corinna Vinschen <vinschen@cygnus.com>, Duisburg, Germany
+ *                    All rights reserved
+ *
+ * Created: Sat Sep 02 12:17:00 2000 cv
+ *
+ * This file contains functions for forcing opened file descriptors to
+ * binary mode on Windows systems.
+ */
+
+#include "config.h"
+
+#ifdef HAVE_CYGWIN
+
+int binary_open(const char *filename, int flags, mode_t mode);
+int binary_pipe(int fd[2]);
+int check_nt_auth(int pwd_authenticated, uid_t uid);
+int check_ntsec(const char *filename);
+
+#define open binary_open
+#define pipe binary_pipe
+
+#endif /* HAVE_CYGWIN */
index b34045963070316f7849a1428ac49102fc3b5096..837ed02073ae4963975e3d78f94fb6a25312295c 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -250,6 +250,8 @@ typedef int mode_t;
 #ifndef _PATH_RSH
 # ifdef RSH_PATH
 #  define _PATH_RSH RSH_PATH
+# else /* RSH_PATH */
+#  define _PATH_RSH "/usr/bin/rsh"
 # endif /* RSH_PATH */
 #endif /* _PATH_RSH */
 
@@ -257,6 +259,11 @@ typedef int mode_t;
 # define _PATH_NOLOGIN "/etc/nologin"
 #endif
 
+/* Define this to be the path of the xauth program. */
+#ifndef XAUTH_PATH
+#define XAUTH_PATH "/usr/X11R6/bin/xauth"
+#endif /* XAUTH_PATH */
+
 /* Macros */
 
 #if defined(HAVE_LOGIN_GETCAPBOOL) && defined(HAVE_LOGIN_CAP_H)
@@ -332,6 +339,15 @@ typedef int mode_t;
 # define getpgrp() getpgrp(0)
 #endif
 
+/*
+ * Define this to use pipes instead of socketpairs for communicating with the
+ * client program.  Socketpairs do not seem to work on all systems.
+ *
+ * configure.in sets this for a few OS's which are known to have problems
+ * but you may need to set it yourself
+ */
+/* #define USE_PIPES 1 */
+
 /**
  ** login recorder definitions
  **/
index da08722ec9074bd9f1caf4b134324532b3ae5751..b7b01374535c7271bef28c22ab420e4fb040edb7 100644 (file)
@@ -46,10 +46,10 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #include <grp.h>
 #include <time.h>
 #include <dirent.h>
-#ifdef HAVE_CYGWIN
+
+#ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #endif
-
 #ifdef HAVE_BSTRING_H
 # include <bstring.h>
 #endif 
@@ -90,34 +90,8 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #endif
 
 #include "version.h"
-
-/* OpenBSD function replacements */
 #include "openbsd-compat.h"
-
-/* Entropy collection */
+#include "cygwin_util.h"
 #include "entropy.h"
 
-/* Define this to be the path of the xauth program. */
-#ifndef XAUTH_PATH
-#define XAUTH_PATH "/usr/X11R6/bin/xauth"
-#endif /* XAUTH_PATH */
-
-/* Define this to be the path of the rsh program. */
-#ifndef _PATH_RSH
-#define _PATH_RSH "/usr/bin/rsh"
-#endif /* _PATH_RSH */
-
-/*
- * Define this to use pipes instead of socketpairs for communicating with the
- * client program.  Socketpairs do not seem to work on all systems.
- */
-/* #define USE_PIPES 1 */
-
-#ifdef HAVE_CYGWIN
-#define open binary_open
-#define pipe binary_pipe
-extern int binary_open();
-extern int binary_pipe();
-#endif
-
-#endif                         /* INCLUDES_H */
+#endif /* INCLUDES_H */
index 077b132e4d38973989676acf7f2493dfd4fba037..fc06e41bc3d29aaa5688c2adfe8c9f23c79a13d0 100644 (file)
@@ -10,7 +10,7 @@
 #include <sys/dir.h>
 
 /* readdir() returns struct direct (BSD) not struct dirent (POSIX) */
-#define dirent direct                                                
+#define dirent direct
 
 /* POSIX utime() struct */
 struct utimbuf {
@@ -19,7 +19,7 @@ struct utimbuf {
 };
 
 /* FILE */
-#define O_NONBLOCK      00004   /* non-blocking open */
+#define O_NONBLOCK     00004   /* non-blocking open */
 
 /* WAITPID */
 #undef WIFEXITED
@@ -29,8 +29,8 @@ struct utimbuf {
 #define WIFEXITED(w)   (!((w) & 0377))
 #define WIFSTOPPED(w)  ((w) & 0100)
 #define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w))
-#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((w >> 8) & 0377) : -1)
-#define WTERMSIG(w)    (int)(WIFSIGNALED(w) ? (w & 0177) : -1)
+#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? (((w) >> 8) & 0377) : -1)
+#define WTERMSIG(w)    (int)(WIFSIGNALED(w) ? ((w) & 0177) : -1)
 #define WCOREFLAG      0x80
 #define WCOREDUMP(w)   ((w) & WCOREFLAG)
 
@@ -42,17 +42,17 @@ pid_t posix_wait(int *status);                              /* new wait() */
 #define wait posix_wait        
 
 /* MISC functions */
-int waitpid(int pid,int *stat_loc,int options);
+int waitpid(int pid, int *stat_loc, int options);
 pid_t setsid(void);
 
-/* TC */
-int tcgetattr(int fd,struct termios *t);
-int tcsetattr(int fd,int opt,const struct termios *t);
+/* TERMCAP */
+int tcgetattr(int fd, struct termios *t);
+int tcsetattr(int fd, int opt, const struct termios *t);
 int tcsetpgrp(int fd, pid_t pgrp);
 speed_t cfgetospeed(const struct termios *t);
 speed_t cfgetispeed(const struct termios *t);
-int cfsetospeed(struct termios *t,int speed);
-
+int cfsetospeed(struct termios *t, int speed);
 
 #endif /* HAVE_NEXT */
+
 #endif /* _NEXT_POSIX_H */
This page took 0.082783 seconds and 5 git commands to generate.