search for: sun_family

Displaying 20 results from an estimated 65 matches for "sun_family".

Did you mean: sin_family
2019 May 28
1
[libnbd PATCH] connect: Better handling of long socket names
...sertions(+), 5 deletions(-) diff --git a/generator/states-connect.c b/generator/states-connect.c index a410e34..014f6bb 100644 --- a/generator/states-connect.c +++ b/generator/states-connect.c @@ -86,15 +86,20 @@ } CONNECT_UNIX.START: - struct sockaddr_un sun; + struct sockaddr_un sun = { .sun_family = AF_UNIX }; socklen_t len; + size_t socklen; assert (h->unixsocket != NULL); - sun.sun_family = AF_UNIX; - memset (sun.sun_path, 0, sizeof (sun.sun_path)); - strncpy (sun.sun_path, h->unixsocket, sizeof (sun.sun_path) - 1); - len = sizeof (sun.sun_family) + strlen (sun.sun_path)...
2015 Nov 04
2
Retrieving datas sent by host within the Guest
...ket stuff. If i try to retrive the datas by using such type of thing in the Guest : #define NAME "/dev/virtio-ports/agent" sock = socket(AF_UNIX, SOCK_STREAM, 0); 12 if (sock < 0) { 13 perror("opening stream socket"); 14 exit(1); 15 } 16 server.sun_family = AF_UNIX; 17 strcpy(server.sun_path, NAME); 18 if (bind(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un))) { 19 perror("binding stream socket"); 20 exit(1); 21 } I got ""binding stream socket Address already in use" when tr...
2005 Feb 26
1
[Fwd: [Xen-changelog] Move xcs to unix domain sockets.]
Just forwarding this changelog from yesterday. xcs now uses Unix domain sockets in unstable. This was a hot thread a couple months back with strong opinions on both sides and no clear resolution on the list, so I thought some people might like to know the developers'' resolution. This should be good news for those seeking tighter dom0''s, particularly those who
2015 Feb 24
4
Call for testing: OpenSSH 6.8
On Mon, 23 Feb 2015, Kevin Brott wrote: > > Yup - that cleared that hurdle ... now it dies here on AIX: > > xlc_r -O2 -qarch=ppc -qalloca -I/usr/include -I/opt/freeware/include > -I. -I. -O2 -qarch=ppc -qalloca -I/usr/include -I/opt/freeware/include > -DSSHDIR=\"/usr/local/etc\" -D_PATH_SSH_PROGRAM=\"/usr/local/bin/ssh\" >
2001 May 03
1
[PATCH]: Workaround a security leak on Windows
...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; strlcpy(sunaddr.sun_path, socket_name, sizeof(sunaddr.sun_path)); +#ifdef HAVE_CYGWIN + prev_mask = umask(0177); +#endif if (bind(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0) { perror("bind"); +#ifdef HAVE_CYGWIN + umask(prev_mask); +#endif clean...
2019 Sep 26
1
Re: [PATCH libnbd 2/2] api: Implement local command with systemd socket activation.
...(h->sa_tmpdir); > + memcpy (h->sa_sockpath, h->sa_tmpdir, len); > + > + s = socket (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0); > + if (s == -1) { > + SET_NEXT_STATE (%.DEAD); > + set_error (errno, "socket"); > + return 0; > + } > + > + addr.sun_family = AF_UNIX; > + memcpy (addr.sun_path, h->sa_sockpath, strlen (h->sa_sockpath) + 1); What if we used the abstract socket namespace instead? Then we don't have to worry about mkdtmp or cleanup of the socket file. True, that may only work on Linux, but we could add an API to query i...
2007 Oct 18
0
[PATCH] Use a control socket directory to restrict access
...'/'; + goto bail; + } + + controlsocketbasename = lastslash + 1; + } + + if (strlen(controlsocketbasename) >= sizeof addr.sun_path) { logger(LOG_ERR, _("Control socket filename too long!")); - return false; + goto bail; } memset(&addr, 0, sizeof addr); addr.sun_family = AF_UNIX; - strncpy(addr.sun_path, controlsocketname, sizeof addr.sun_path - 1); + strncpy(addr.sun_path, controlsocketbasename, sizeof addr.sun_path - 1); - control_socket = socket(PF_UNIX, SOCK_STREAM, 0); + struct stat statbuf; + if(stat(".", &statbuf) < 0) { + logger(LOG_ER...
2015 Nov 04
0
Re: Retrieving datas sent by host within the Guest
...s by using such type of thing in the Guest : > > >#define NAME "/dev/virtio-ports/agent" > >sock = socket(AF_UNIX, SOCK_STREAM, 0); >12 if (sock < 0) { >13 perror("opening stream socket"); >14 exit(1); >15 } >16 server.sun_family = AF_UNIX; >17 strcpy(server.sun_path, NAME); >18 if (bind(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un))) { >19 perror("binding stream socket"); >20 exit(1); >21 } > > >I got ""binding stream socket Addres...
1999 Nov 19
0
EGD socket problem ...
...Sunday :( The problem appears to be, in here, with the error generated by the 'fatal:' result when connect() is tested: char egd_message[2] = { 0x02, 0x00 }; struct sockaddr_un addr; int addr_len; memset(&addr, '\0', sizeof(addr)); addr.sun_family = AF_UNIX; /* FIXME: compile time check? */ if (sizeof(RANDOM_POOL) > sizeof(addr.sun_path)) fatal("Random pool path is too long"); strncpy(addr.sun_path, RANDOM_POOL, sizeof(addr.sun_path - 1)); addr.sun_path[sizeof(addr.sun_path - 1)]...
2003 Oct 27
0
rsyncing fifos and sockets on FreeBSD
...fo(pathname, mode); > #endif > #if (HAVE_SYS_UN_H && HAVE_SYS_SOCKET_H) > if (S_ISSOCK(mode)) { > int sock; > struct sockaddr_un saddr; > > if (strlen(pathname) + 1 > sizeof(saddr.sun_path)) { > errno = ENAMETOOLONG; return -1; > } > > saddr.sun_family = AF_UNIX; > strncpy(saddr.sun_path, pathname, sizeof(saddr.sun_path)); > > if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) == -1) { > return -1; > } > unlink(pathname); > if ((bind(sock, (struct sockaddr*)&saddr, sizeof(saddr))) == -1) { > return -1; >...
2015 Sep 26
5
[RFC][PATCH v2] Support a list of sockets on SSH_AUTH_SOCK
...*authsocket, int *fdp) { - const char *authsocket; int sock, oerrno; struct sockaddr_un sunaddr; - if (fdp != NULL) - *fdp = -1; - - authsocket = getenv(SSH_AUTHSOCKET_ENV_NAME); - if (!authsocket) - return SSH_ERR_AGENT_NOT_PRESENT; - memset(&sunaddr, 0, sizeof(sunaddr)); sunaddr.sun_family = AF_UNIX; strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path)); @@ -117,7 +108,32 @@ ssh_get_authentication_socket(int *fdp) *fdp = sock; else close(sock); - return 0; + return SSH_ERR_SUCCESS; +} + +/* Returns the number of the authentication fd, or -1 if there is none. */ +i...
1999 Aug 26
0
smbsh always segfaults
...fff394, 0xbffff308, 0x8, 0xf) = 0 SYS_174(0x2, 0xbffff4b0, 0xbffff424, 0x8, 0x2) = 0 SYS_174(0x14, 0xbffff4b0, 0xbffff424, 0x8, 0x14) = 0 SYS_174(0x16, 0xbffff4b0, 0xbffff424, 0x8, 0x16) = 0 SYS_174(0x15, 0xbffff4b0, 0xbffff424, 0x8, 0x15) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 5 connect(5, {sun_family=AF_UNIX, sun_path="/var/run/.nscd_socket"}, 110) = -1 ECONNREFUSED (Connection refused) fcntl(1023, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=1}) = 0 fstat(1023, {st_mode=S_ISVTX|0436, st_size=0, ...}) = 0 lseek(1023, 0, SEEK_SET) = 0 read(1023, "\5\0\5\0U...
2015 Jun 25
0
[PATCH v2 4/9] daemon: Add -l / --listen flag.
...list.\n" + "\n"); + perror (channel); + exit (EXIT_FAILURE); + } + } + else { + struct sockaddr_un addr; + + sock = socket (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0); + if (sock == -1) + error (EXIT_FAILURE, errno, "socket"); + addr.sun_family = AF_UNIX; + strncpy (addr.sun_path, channel, UNIX_PATH_MAX); + addr.sun_path[UNIX_PATH_MAX-1] = '\0'; + + if (bind (sock, (struct sockaddr *) &addr, sizeof addr) == -1) + error (EXIT_FAILURE, errno, "bind: %s", channel); + + if (listen (sock, 4) == -1) +...
2016 Jan 29
7
[PATCH 1/6] launch: unix: check for length of sockets
Error out early if the path to the socket will not fit into sockaddr_un::sun_path, as we will not be able to connect to it. --- src/launch-unix.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/launch-unix.c b/src/launch-unix.c index 740c554..973e14b 100644 --- a/src/launch-unix.c +++ b/src/launch-unix.c @@ -47,6 +47,12 @@ launch_unix (guestfs_h *g, void *datav, const char
2007 Aug 03
1
race condition with ControlMaster=auto
...= SSHCTL_MASTER_NO) - return; + options.control_master == SSHCTL_MASTER_NO || + control_fd != -1) + return 1; - debug("setting up multiplex master socket"); + debug("trying to set up multiplex master socket"); memset(&addr, '\0', sizeof(addr)); addr.sun_family = AF_UNIX; @@ -1073,11 +1074,9 @@ old_umask = umask(0177); if (bind(control_fd, (struct sockaddr *)&addr, addr_len) == -1) { control_fd = -1; - if (errno == EINVAL || errno == EADDRINUSE) - fatal("ControlSocket %s already exists", - options.control_path); - else + if...
2002 Jun 24
0
Rsync 2.5.5: FreeBSD mknod can't create FIFO's
...@@ -67,6 +67,35 @@ { if (dry_run) return 0; CHECK_RO + +#if HAVE_MKFIFO + if (S_ISFIFO(mode)) { + return mkfifo(pathname, mode); + } +#endif + +#if HAVE_SYS_UN_H + if (S_ISSOCK(mode)) { + int sock; + struct sockaddr_un saddr; + int len = strlen(pathname) + 1; /* include null */ + + saddr.sun_family = AF_UNIX; + strncpy(saddr.sun_path, pathname, sizeof(saddr.sun_path)); + saddr.sun_len = len > sizeof(saddr.sun_path) ? sizeof(saddr.sun_path) : len; + + if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) { + return -1; + } + unlink(pathname); + if ((bind(sock, (struct sockaddr*)&...
2019 Sep 26
5
[PATCH libnbd 1/2] lib: Avoid killing subprocess twice.
If the user calls nbd_kill_subprocess, we shouldn't kill the process again when we close the handle (since the process has likely gone and we might be killing a different process). --- lib/handle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/handle.c b/lib/handle.c index 2af25fe..5ad818e 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -315,6 +315,8 @@
2005 Jun 12
2
%h,%p,%u expansion for ControlPath
This allows me to set 'ControlPath ~/.ssh/sockets/%h.%p.%u' for example. Have I missed a good reason why ssh_connect finds the default port number for itself instead of just having it in options.port (like we do for the the default in options.user)? --- openssh-4.1p1/ssh.c~ 2005-06-12 09:47:18.000000000 +0100 +++ openssh-4.1p1/ssh.c 2005-06-12 09:40:53.000000000 +0100 @@ -604,6 +604,17
2000 Jun 20
2
Critical EGD handling in 2.1.1p1
Hi, when running OpenSSH with EGD as entropy source, the sshd server connects to the EGD socket and leaves it open to re-seed on the fly. Unfortunately the connection is not checked when re-seeding, so that a failure or restart of EGD will lead to a "fatal()" abort of the sshd server process. Since a dying server process can not be accepted, I would recommend to not have sshd call it
2001 Jun 18
2
Client protocol error:(nil): lseek: Illegal seek
...= 16413 wait4(16413, [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 16413 --- SIGCHLD (Child exited) --- lstat("socket", {st_mode=S_IFSOCK|0600, st_size=0, ...}) = 0 getuid() = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 3 connect(3, {sun_family=AF_UNIX, sun_path="socket"}, 9) = 0 shmat(3, 0x9, 0x2) = -1 ENOSYS (Function not implemented) fcntl(3, F_SETFD, FD_CLOEXEC) = 0 chdir("/c/Program Files/EverQuest") = 0 rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, 8) = 0 socketcall(0x11, 0xbffffb...