search for: have_setrlimit

Displaying 17 results from an estimated 17 matches for "have_setrlimit".

2015 May 26
0
[PATCH] lib: Limit space and time used by 'qemu-img info' subprocess.
...y or * adding a terminating \0 to the string, or die with an internal * error if no command has been added. @@ -390,6 +422,10 @@ run_command (struct command *cmd, bool get_stdin_fd, bool get_stdout_fd, int outfd[2] = { -1, -1 }; int infd[2] = { -1, -1 }; char status_string[80]; +#ifdef HAVE_SETRLIMIT + struct child_rlimits *child_rlimit; + struct rlimit rlimit; +#endif get_stdout_fd = get_stdout_fd || cmd->stdout_callback != NULL; get_stderr_fd = get_stderr_fd || cmd->capture_errors; @@ -510,6 +546,23 @@ run_command (struct command *cmd, bool get_stdin_fd, bool get_stdout_fd,...
2002 Dec 27
1
RLIMIT_AS patch for FreeBSD
....org/cgi/man.cgi?setrlimit ) You may be interested in integrating this patch. --- src/lib/restrict-process-size.c Fri Dec 27 18:19:41 2002 +++ src/lib/restrict-process-size.c-new Fri Dec 27 18:19:22 2002 @@ -32,7 +32,8 @@ void restrict_process_size(unsigned int size __attr_unused__) { -#ifdef HAVE_SETRLIMIT +#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_AS) +/* FreeBSD has setrlimit(2) but does not define RLIMIT_AS */ struct rlimit rlim; rlim.rlim_max = rlim.rlim_cur = Thanks, -- Dominic <dom at cus.org.uk> <d.marks at student.umist.ac.uk>
2001 May 03
1
[PATCH]: Workaround a security leak on Windows
...gent.c =================================================================== RCS file: /cvs/openssh_cvs/ssh-agent.c,v retrieving revision 1.54 diff -u -p -r1.54 ssh-agent.c --- ssh-agent.c 2001/04/04 01:53:21 1.54 +++ ssh-agent.c 2001/05/03 12:19:50 @@ -714,6 +714,9 @@ main(int ac, char **av) #ifdef HAVE_SETRLIMIT struct rlimit rlim; #endif +#ifdef HAVE_CYGWIN + int prev_mask; +#endif pid_t pid; char *shell, *format, *pidstr, pidstrbuf[1 + 3 * sizeof pid]; extern int optind; @@ -805,10 +808,19 @@ main(int ac, char **av) memset(&sunaddr, 0, sizeof(sunaddr)); sunaddr.sun_family = AF_UNIX; st...
2017 Oct 06
0
[PATCH v2 1/2] lib: command: If command fails, exit with 126 or 127 as defined by POSIX.
...diff --git a/lib/command.c b/lib/command.c index 3d8bc7dbf..36f953dcf 100644 --- a/lib/command.c +++ b/lib/command.c @@ -539,7 +539,7 @@ static void run_child (struct command *cmd) { struct sigaction sa; - int i, fd, max_fd, r; + int i, err, fd, max_fd, r; char status_string[80]; #ifdef HAVE_SETRLIMIT struct child_rlimits *child_rlimit; @@ -614,8 +614,12 @@ run_child (struct command *cmd) switch (cmd->style) { case COMMAND_STYLE_EXECV: execvp (cmd->argv.argv[0], cmd->argv.argv); + err = errno; perror (cmd->argv.argv[0]); - _exit (EXIT_FAILURE); + /* These...
2001 Jun 07
0
Patch for systems with no setreuid()
...orig Thu Jun 7 14:18:57 2001 +++ config.h.in Thu Jun 7 14:19:33 2001 @@ -503,6 +503,9 @@ /* Define if you have the setreuid function. */ #undef HAVE_SETREUID +/* Define if you have the setresuid function. */ +#undef HAVE_SETRESUID + /* Define if you have the setrlimit function. */ #undef HAVE_SETRLIMIT --- configure.orig Thu Jun 7 14:12:53 2001 +++ configure Thu Jun 7 14:13:40 2001 @@ -3184,7 +3184,7 @@ fi -for ac_func in arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage g...
2015 Jan 22
2
[PATCH] increase fd_limit to max_client_limit automatically
...im_t)max_client_limit) { - i_warning("fd limit (ulimit -n) is lower than required " - "under max. load (%u < %u), because of %s", - (unsigned int)fd_limit, max_client_limit, - max_client_limit_source); + if (getrlimit(RLIMIT_NOFILE, &fd_limit) == 0) { +#ifdef HAVE_SETRLIMIT + rlim_t old = fd_limit.rlim_cur; + fd_limit.rlim_cur = I_MAX(old, max_client_limit); + if (setrlimit(RLIMIT_NOFILE, &fd_limit) < 0) + fd_limit.rlim_cur = old; +#endif + if (fd_limit.rlim_cur < (rlim_t)max_client_limit) + i_warning("fd limit (ulimit -n) is lower than required...
2015 Oct 14
0
[PATCH 2/2] lib: Add comment and regression test for case where main process has large heap.
...ssions/test-big-heap /tests/rsync/rsyncd.pid /tests/syslinux/extlinux-guest.img /tests/syslinux/syslinux-guest.img diff --git a/src/command.c b/src/command.c index 0547111..e9f357a 100644 --- a/src/command.c +++ b/src/command.c @@ -558,6 +558,17 @@ run_child (struct command *cmd) } #endif /* HAVE_SETRLIMIT */ + /* NB: If the main process (which we have forked a copy of) uses + * more heap than the RLIMIT_AS we set above, then any call to + * malloc or any extension of the stack will fail with ENOMEM or + * SIGSEGV respectively. Luckily we only use RLIMIT_AS followed by + * execvp below, s...
2015 Sep 29
8
[PATCH 0/7] copy-in/copy-out: Capture errors from tar subprocess (RHBZ#1267032).
Commits 3c27f3d91e1566854747bbe844186783fc84f3a8 and 1b6f0daa9ae7fcc94e389232d0c397816cda973d added an internal API for running commands asynchronously. It is only used by the copy-in and copy-out APIs. Unfortunately this made the command code very complex: it was almost impossible to redirect stderr to a file, and there were a lot of long-range dependencies through the file. It was also buggy:
2023 Jun 17
2
[PATCH] ssh-agent: add systemd socket-based activation
...socket_name[0]) unlink(socket_name); @@ -2000,7 +2012,7 @@ int main(int ac, char **av) { int c_flag = 0, d_flag = 0, D_flag = 0, k_flag = 0, s_flag = 0; - int sock, ch, result, saved_errno; + int sock = 0, ch, result, saved_errno; char *shell, *format, *pidstr, *agentsocket = NULL; #ifdef HAVE_SETRLIMIT struct rlimit rlim; @@ -2015,6 +2027,9 @@ main(int ac, char **av) struct pollfd *pfd = NULL; size_t npfd = 0; u_int maxfds; +#ifdef WITH_SYSTEMD + int nfds = 0; +#endif /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ sanitise_stdfd(); @@ -2142,6 +2157,25 @@ main(int...
2017 Oct 06
3
[PATCH v2 0/2] lib: Allow db_dump package to be a weak dependency
Previously posted: https://www.redhat.com/archives/libguestfs/2017-October/msg00032.html This takes a completely different approach. It turns out that POSIX / the shell already defines a special exit code 127 for ‘command not found’. We can make a small adjustment to lib/command.c to return this exit code in that case. Then we just have to modify the db_dump code to test for this exit code. I
2015 Oct 14
2
[PATCH 1/2] lib: info: Move common code for setting child rlimits.
This is almost just refactoring, but I also set the memory limit to really 1 GB, and not 1×10⁹. --- src/info.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/info.c b/src/info.c index d7f45f0..616ef50 100644 --- a/src/info.c +++ b/src/info.c @@ -56,6 +56,7 @@ static yajl_val get_json_output (guestfs_h *g, const char *filename); static char
2003 Feb 11
1
Problems configuring OpenSSH 3.5p1 on Sol 5.8
..._NTOA 1 #define HAVE_INET_NTOP 1 #define HAVE_INNETGR 1 #define HAVE_MEMMOVE 1 #define HAVE_MMAP 1 #define HAVE_REALPATH 1 #define HAVE_RECVMSG 1 #define HAVE_RRESVPORT_AF 1 #define HAVE_SENDMSG 1 #define HAVE_SETEGID 1 #define HAVE_SETEUID 1 #define HAVE_SETGROUPS 1 #define HAVE_SETREUID 1 #define HAVE_SETRLIMIT 1 #define HAVE_SETSID 1 #define HAVE_SETVBUF 1 #define HAVE_SIGACTION 1 #define HAVE_SNPRINTF 1 #define HAVE_SOCKETPAIR 1 #define HAVE_STRERROR 1 #define HAVE_STRLCAT 1 #define HAVE_STRLCPY 1 #define HAVE_SYSCONF 1 #define HAVE_TCGETPGRP 1 #define HAVE_TRUNCATE 1 #define HAVE_UTIMES 1 #define HAVE_...
2005 Sep 19
1
ssh hangs or gives Segmentation fault
...VE_SETEGID 1 #define HAVE_SETENV 1 #define HAVE_SETEUID 1 #define HAVE_SETGROUPS 1 /* #undef HAVE_SETLOGIN */ /* #undef HAVE_SETLUID */ /* #undef HAVE_SETPCRED */ /* #undef HAVE_SETPROCTITLE */ #define HAVE_SETREGID 1 #define HAVE_SETRESGID 1 #define HAVE_SETRESUID 1 #define HAVE_SETREUID 1 #define HAVE_SETRLIMIT 1 #define HAVE_SETSID 1 #define HAVE_SETUTENT 1 #define HAVE_SETUTXENT 1 #define HAVE_SETVBUF 1 #define HAVE_SHADOW_H 1 #define HAVE_SIGACTION 1 #define HAVE_SIGVEC 1 #define HAVE_SIG_ATOMIC_T 1 #define HAVE_SNPRINTF 1 #define HAVE_SOCKETPAIR 1 #define HAVE_SO_PEERCRED #define HAVE_STDDEF_H 1 #def...
2006 Apr 11
0
Problem building openssh-4.3p2 under cygwin and windows XP
...define HAVE_PUTUTXLINE 1 #define HAVE_REALPATH 1 #define HAVE_RECVMSG 1 #define HAVE_SA_FAMILY_T 1 #define HAVE_SENDMSG 1 #define HAVE_SETDTABLESIZE 1 #define HAVE_SETEGID 1 #define HAVE_SETENV 1 #define HAVE_SETEUID 1 #define HAVE_SETGROUPS 1 #define HAVE_SETREGID 1 #define HAVE_SETREUID 1 #define HAVE_SETRLIMIT 1 #define HAVE_SETSID 1 #define HAVE_SETUTENT 1 #define HAVE_SETUTXENT 1 #define HAVE_SETVBUF 1 #define HAVE_SIGACTION 1 #define HAVE_SIG_ATOMIC_T 1 #define HAVE_SIZE_T 1 #define HAVE_SNPRINTF 1 #define HAVE_SOCKETPAIR 1 #define HAVE_SSIZE_T 1 #define HAVE_SS_FAMILY_IN_SS 1 #define HAVE_STDDEF_H 1...
2016 Mar 17
2
Building with LLVM_PARALLEL_XXX_JOBS
On Mon, Mar 14, 2016 at 5:30 PM, Chris Bieneman <cbieneman at apple.com> wrote: [ brutal-snip ] ... > [ TODO#S: Before doing a 2nd build (and in a 3rd run using more > optimized binaries) ] > > How do I anable LTO via CMAKE? > > > LLVM_ENALBLE_LTO=On > [ v4 of my build-script attached ] Hi Chris, thanks for the response! That seems to work (see below). $ cd
2017 Feb 11
2
Asan self host problems: Failed to deallocate
Trying to run a self host "ninja check-clang" with ASan enabled I hit a /lot/ of errors like this (strangely I hit none of these in check-llvm, only in check-clang): Any ideas? ==10525==ERROR: AddressSanitizer failed to deallocate 0x10800 (67584) bytes at address 0x631000014800 ==10525==AddressSanitizer CHECK failed:
2017 Feb 15
2
Asan self host problems: Failed to deallocate
...AVE_PTHREAD_MUTEX_LOCK:INTERNAL=1 //Have library pthread HAVE_PTHREAD_RWLOCK_INIT:INTERNAL=1 //Have symbol realpath HAVE_REALPATH:INTERNAL=1 //Have include rpc/xdr.h HAVE_RPC_XDR_H:INTERNAL=1 //Have symbol sbrk HAVE_SBRK:INTERNAL=1 //Have symbol setenv HAVE_SETENV:INTERNAL=1 //Have symbol setrlimit HAVE_SETRLIMIT:INTERNAL=1 //Have symbol sigaltstack HAVE_SIGALTSTACK:INTERNAL=1 //Have include signal.h HAVE_SIGNAL_H:INTERNAL=1 //Have include stdint.h HAVE_STDINT_H:INTERNAL=1 //Have symbol strerror HAVE_STRERROR:INTERNAL=1 //Have symbol strerror_r HAVE_STRERROR_R:INTERNAL=1 //Have symbol strtoll HAVE_STRTOLL:I...