]> andersk Git - openssh.git/commitdiff
20001227
authormouring <mouring>
Wed, 27 Dec 2000 04:57:41 +0000 (04:57 +0000)
committermouring <mouring>
Wed, 27 Dec 2000 04:57:41 +0000 (04:57 +0000)
 - (bal) Typo in configure.in: entut?ent should be endut?ent.  Suggested by
   Takumi Yamane <yamtak@b-session.com>
 - (bal) Checks for getrlimit(), sysconf(), and setdtablesize().  Patch
   by Corinna Vinschen <vinschen@redhat.com>

ChangeLog
configure.in
ssh-agent.c
ssh-keyscan.c

index a727479b99a3faab733f73af9f4f352c4d6293cd..d23a7f555ff56b31ede546d62968c34106b3112b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+20001227
+ - (bal) Typo in configure.in: entut?ent should be endut?ent.  Suggested by 
+   Takumi Yamane <yamtak@b-session.com>
+ - (bal) Checks for getrlimit(), sysconf(), and setdtablesize().  Patch
+   by Corinna Vinschen <vinschen@redhat.com>
+
 20001223
  - (bal) Fixed Makefile.in to support recompile of all ssh and sshd objects
    if a change to config.h has occurred.  Suggested by Gert Doering
index 4601cd38baba13f7a7f82c7181e0ee424ac9d41a..fa93d5e1d633266bc03384bc74a4063c4633a43a 100644 (file)
@@ -304,16 +304,16 @@ fi
 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/queue.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stddef.h time.h ttyent.h usersec.h util.h utmp.h utmpx.h vis.h)
 
 dnl    Checks for library functions.
-AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strsep strtok_r vsnprintf vhangup vis waitpid _getpty __b64_ntop)
+AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getnameinfo getrlimit getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strsep strtok_r sysconf vsnprintf vhangup vis waitpid _getpty __b64_ntop)
 dnl    Checks for time functions
 AC_CHECK_FUNCS(gettimeofday time)
 dnl    Checks for libutil functions
 AC_CHECK_FUNCS(login logout updwtmp logwtmp)
 dnl    Checks for utmp functions
-AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
+AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
 AC_CHECK_FUNCS(utmpname)
 dnl    Checks for utmpx functions
-AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
+AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
 AC_CHECK_FUNCS(setutxent utmpxname)
 
 AC_CHECK_FUNC(getuserattr, 
index 9c0a583e89056a22933702b0e7e086a7c8c2cadc..55704e492c4550057cc0f48eb7e2d926fdeb99df 100644 (file)
@@ -674,7 +674,9 @@ main(int ac, char **av)
        fd_set readset, writeset;
        int sock, c_flag = 0, k_flag = 0, s_flag = 0, ch;
        struct sockaddr_un sunaddr;
+#ifdef HAVE_SETRLIMIT
        struct rlimit rlim;
+#endif
        pid_t pid;
        char *shell, *format, *pidstr, pidstrbuf[1 + 3 * sizeof pid];
        extern int optind;
@@ -805,12 +807,14 @@ main(int ac, char **av)
        close(1);
        close(2);
 
+#ifdef HAVE_SETRLIMIT
        /* deny core dumps, since memory contains unencrypted private keys */
        rlim.rlim_cur = rlim.rlim_max = 0;
        if (setrlimit(RLIMIT_CORE, &rlim) < 0) {
                perror("setrlimit rlimit_core failed");
                cleanup_exit(1);
        }
+#endif
        if (setsid() == -1) {
                perror("setsid");
                cleanup_exit(1);
index d85cc337fb141fa2a3cb0e4cd6b2937853d2638b..41bd733ce3b855dc051c40060b813b87d16eb9f9 100644 (file)
@@ -183,6 +183,7 @@ getline(Linebuf * lb)
 static int
 fdlim_get(int hard)
 {
+#if defined(HAVE_GETRLIMIT)
        struct rlimit rlfd;
        if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)
                return (-1);
@@ -190,19 +191,30 @@ fdlim_get(int hard)
                return 10000;
        else
                return hard ? rlfd.rlim_max : rlfd.rlim_cur;
+#elif defined (HAVE_SYSCONF)
+       return sysconf (_SC_OPEN_MAX);
+#else
+       return 10000;
+#endif
 }
 
 static int
 fdlim_set(int lim)
 {
+#if defined(HAVE_SETRLIMIT)
        struct rlimit rlfd;
+#endif
        if (lim <= 0)
                return (-1);
+#if defined(HAVE_SETRLIMIT)
        if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)
                return (-1);
        rlfd.rlim_cur = lim;
        if (setrlimit(RLIMIT_NOFILE, &rlfd) < 0)
                return (-1);
+#elif defined (HAVE_SETDTABLESIZE)
+       setdtablesize (lim);
+#endif
        return (0);
 }
 
This page took 0.055799 seconds and 5 git commands to generate.