search for: parent_pid

Displaying 19 results from an estimated 19 matches for "parent_pid".

2006 Apr 12
1
[PATCH] bug in check_parent_exists() in ssh-agent.c
The check_parent_exists() function in ssh-agent.c does this: if (parent_pid != -1 && kill(parent_pid, 0) < 0) however, the kill can fail with EPERM even if the parent_pid exists. For example, consider this command: ssh-agent sh -c 'ssh-add ; exec sudo sh -i' The original ssh-agent process sets things up so that the "sh -c '...'&q...
2011 May 12
6
[Bug 1905] New: check_parent_exists() logic does not cover all cases
...To: unassigned-bugs at mindrot.org ReportedBy: dkg at fifthhorseman.net As initially reported on the mailing list: http://lists.mindrot.org/pipermail/openssh-unix-dev/2006-April/024144.html Alan P. Barrett wrote: The check_parent_exists() function in ssh-agent.c does this: if (parent_pid != -1 && kill(parent_pid, 0) < 0) however, the kill can fail with EPERM even if the parent_pid exists. For example, consider this command: ssh-agent sh -c 'ssh-add ; exec sudo sh -i' The original ssh-agent process sets things up so that the "sh -c '...'&q...
2023 Jun 17
2
[PATCH] ssh-agent: add systemd socket-based activation
...m; @@ -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 ac, char **av) parent_pid = getpid(); +#ifdef WITH_SYSTEMD + nfds = sd_listen_fds(1); + if (nfds > 0) { + sock = SD_LISTEN_FDS_START; + if (agentsocket == NULL) { + fprintf(stderr, "%s not set, cannot use socket-activation", + SSH_AUTHSOCKET_ENV_NAME); + exit(1); + } else if (sd_is_socket_unix(sock,...
2014 Jul 25
3
[PATCH] launch: Close file descriptors after fork (RHBZ#1123007).
...after setting up stderr above). */ @@ -747,7 +754,7 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) if (g->recovery_proc) { r = fork (); if (r == 0) { - int i, fd, max_fd; + int i; struct sigaction sa; pid_t qemu_pid = data->pid; pid_t parent_pid = getppid (); @@ -767,13 +774,7 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) /* Close all other file descriptors. This ensures that we don't * hold open (eg) pipes from the parent process. */ - max_fd = sysconf (_SC_OPEN_MAX); - if (max_fd == -...
2001 Sep 28
1
openssh-2.9.9p2 assumes pid_t, uid_t, etc. are not 'long'
...format = c_flag ? "unsetenv %s;\n" : "unset %s;\n"; printf(format, SSH_AUTHSOCKET_ENV_NAME); printf(format, SSH_AGENTPID_ENV_NAME); - printf("echo Agent pid %d killed;\n", pid); + printf("echo Agent pid %ld killed;\n", (long)pid); exit(0); } parent_pid = getpid(); @@ -965,7 +965,7 @@ main(int ac, char **av) format = c_flag ? "setenv %s %s;\n" : "%s=%s; export %s;\n"; printf(format, SSH_AUTHSOCKET_ENV_NAME, socket_name, SSH_AUTHSOCKET_ENV_NAME); - printf("echo Agent pid %d;\n", parent_pid); + printf(&qu...
2008 Jul 24
4
v1.1.2 released
http://dovecot.org/releases/1.1/dovecot-1.1.2.tar.gz http://dovecot.org/releases/1.1/dovecot-1.1.2.tar.gz.sig Development of new features in this release and the upcoming multi-master replication are sponsored by Directi (www.directi.com). Lucene indexing is currently deprecated in favor of the new Solr indexing. I'm even considering removing the Lucene C++ library support, so if you're
2008 Jul 24
4
v1.1.2 released
http://dovecot.org/releases/1.1/dovecot-1.1.2.tar.gz http://dovecot.org/releases/1.1/dovecot-1.1.2.tar.gz.sig Development of new features in this release and the upcoming multi-master replication are sponsored by Directi (www.directi.com). Lucene indexing is currently deprecated in favor of the new Solr indexing. I'm even considering removing the Lucene C++ library support, so if you're
2014 Jul 30
2
[PATCH v2] launch: Close file descriptors after fork (RHBZ#1123007).
https://bugzilla.redhat.com/show_bug.cgi?id=1123007 This is version 2 of the patch which avoids incorrectly closing stderr, so we can still see debug and error messages. Rich.
2014 Jul 28
1
Re: [PATCH] launch: Close file descriptors after fork (RHBZ#1123007).
...after setting up stderr above). */ @@ -747,7 +754,7 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) if (g->recovery_proc) { r = fork (); if (r == 0) { - int i, fd, max_fd; + int i; struct sigaction sa; pid_t qemu_pid = data->pid; pid_t parent_pid = getppid (); @@ -767,13 +774,7 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) /* Close all other file descriptors. This ensures that we don't * hold open (eg) pipes from the parent process. */ - max_fd = sysconf (_SC_OPEN_MAX); - if (max_fd == -...
2008 Jun 04
12
Mongrel as Windows service with normal privileges
I am trying to run Mongrel 1.1.5 with mongrel_service 0.3.4 on Ruby 1.8.6 with a "normal" user account, i.e. a user which belongs only to the Windows group "Users". The rationale behind this is that running a web server with full administrative rights (e.g. Local System) is not something that I would like to do. Unfortunately, starting the service from the services control
2020 Jun 14
12
[Bug 3181] New: ssh-agent doesn't exit automatically after child program exits
https://bugzilla.mindrot.org/show_bug.cgi?id=3181 Bug ID: 3181 Summary: ssh-agent doesn't exit automatically after child program exits Product: Portable OpenSSH Version: 8.0p1 Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 Component: ssh-agent
2011 Aug 02
0
Adding fflush() to ssh-agent so its output can be redirected to a file
....c.orig 2011-08-01 20:42:08.890134187 -0700 +++ ssh-agent.c 2011-08-01 21:13:08.995357974 -0700 @@ -1281,6 +1281,7 @@ printf(format, SSH_AUTHSOCKET_ENV_NAME, socket_name, SSH_AUTHSOCKET_ENV_NAME); printf("echo Agent pid %ld;\n", (long)parent_pid); + fflush(stdout); goto skip; } pid = fork();
2015 Nov 09
6
[PATCH 0/5] build: Enable some more warnings.
Add some warnings. Well, the first patch is a miscellaneous change, but patches 2-5 add some warnings. Rich.
2001 Apr 04
1
compiler warnings about format strings
...format = c_flag ? "unsetenv %s;\n" : "unset %s;\n"; printf(format, SSH_AUTHSOCKET_ENV_NAME); printf(format, SSH_AGENTPID_ENV_NAME); - printf("echo Agent pid %d killed;\n", pid); + printf("echo Agent pid %ld killed;\n", (long)pid); exit(0); } parent_pid = getpid(); @@ -849,7 +849,7 @@ SSH_AUTHSOCKET_ENV_NAME); printf(format, SSH_AGENTPID_ENV_NAME, pidstrbuf, SSH_AGENTPID_ENV_NAME); - printf("echo Agent pid %d;\n", pid); + printf("echo Agent pid %ld;\n", (long)pid); exit(0); } if (setenv(SSH_AUT...
2012 Mar 09
1
[PATCH 1/2] Close all file descriptors in the recovery process.
...diff --git a/src/launch.c b/src/launch.c index 1dc23f4..a9af445 100644 --- a/src/launch.c +++ b/src/launch.c @@ -844,9 +844,21 @@ launch_appliance (guestfs_h *g) if (g->recovery_proc) { r = fork (); if (r == 0) { + int fd, max_fd; pid_t qemu_pid = g->pid; pid_t parent_pid = getppid (); + /* Close all other file descriptors. This ensures that we don't + * hold open (eg) pipes from the parent process. + */ + max_fd = sysconf (_SC_OPEN_MAX); + if (max_fd == -1) + max_fd = 1024; + if (max_fd > 65536) + max_fd = 655...
2013 Aug 09
4
[PATCH v2 0/4] Experimental User-Mode Linux backend.
v1 was here: https://www.redhat.com/archives/libguestfs/2013-August/msg00005.html This now works, to some extent. The main problem now is that devices are named /dev/ubd[a-] which of course confuses everything. I'm thinking it may be easier to add a udev rule to rename them. Rich.
2013 Aug 09
5
[PATCH 0/4] Not quite working User-Mode Linux backend.
This is a User-Mode Linux backend for libguestfs. You can select it by doing: export LIBGUESTFS_BACKEND=uml export LIBGUESTFS_QEMU=/path/to/vmlinux Note we're reusing the 'qemu' variable in the handle for convenience. QEmu is not involved when using the UML backend. This almost works. UML itself crashes when the daemon tries to connect to the serial port. I suspect it's
2017 Apr 27
4
[PATCH 0/4] common: Add a simple mini-library for handling qemu command and config files.
Currently we have an OCaml library for generating the qemu command line (used only by ‘virt-v2v -o qemu’). However we also generate a qemu command line in ‘lib/launch-direct.c’, and we might in future need to generate a ‘-readconfig’-compatible configuration file if we want to go beyond 10,000 drives for scalability testing. Therefore this patch series reimplements the qemu command line code as
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
..." %s", g->cmdline[i]); fprintf (stderr, "\n"); } @@ -1172,11 +1172,11 @@ guestfs_launch (guestfs_h *g) */ for (;;) { if (kill (qemu_pid, 0) == -1) /* qemu's gone away, we aren't needed */ - _exit (0); + _exit (0); if (kill (parent_pid, 0) == -1) { - /* Parent's gone away, qemu still around, so kill qemu. */ - kill (qemu_pid, 9); - _exit (0); + /* Parent's gone away, qemu still around, so kill qemu. */ + kill (qemu_pid, 9); + _exit (0); } sleep (2); } @@ -1257,8 +1257,8 @@ guestfs_l...