Re: [PATCH] Unix domain socket filename redirection (patch update)

2017-06-21 Thread Zartaj Majeed
need to use strncmp for relative path check: if (!strncmp (s, "/./", 3) || !strncmp (s, "/../", 4)) { ++s; } On Wed, Jun 21, 2017 at 8:53 AM, Zartaj Majeed wrote: > This update to the patch adds the following: > > 1. Check socket file path length less than sizeof

Re: [PATCH] Unix domain socket filename redirection (patch update)

2017-06-21 Thread Zartaj Majeed
This update to the patch adds the following: 1. Check socket file path length less than sizeof sun_path array in struct sockaddr_un 2. Allow relative socket file paths starting with "./" or "../". This means the pseudo filename opened in bash is of the form "/dev/unixstream/./xyz.sock" or

Re: [PATCH] Unix domain socket filename redirection

2017-06-21 Thread George
On Tue, 2017-06-20 at 23:47 -0500, Eduardo A. Bustamante López wrote: > On Tue, Jun 20, 2017 at 11:49:56AM -0400, tetsu...@scope-eye.net wrote: > [...] > > > > So implementing Unix Domain Sockets in the shell would give you the > > ability to connect to existing services on the machine that use

Re: [PATCH] Unix domain socket filename redirection

2017-06-20 Thread Eduardo A . Bustamante López
On Tue, Jun 20, 2017 at 11:49:56AM -0400, tetsu...@scope-eye.net wrote: [...] > So implementing Unix Domain Sockets in the shell would give you the > ability to connect to existing services on the machine that use named > sockets for control (systemd, dbus, cups, etc.) or you could use the >

Re: [PATCH] Unix domain socket filename redirection

2017-06-20 Thread tetsujin
s Bash supports. So even if it were integrated into the shell, it still must be considered an optional feature. It may be possible to provide a single interface that would also cover other APIs with similar features (the STREAMS API maybe?) - Original Message - From: To:"Z" <za

Re: [PATCH] Unix domain socket filename redirection

2017-06-19 Thread Zartaj Majeed
Attaching the patch usock.diff.txt On Mon, Jun 19, 2017 at 11:36 PM, Eduardo A. Bustamante López wrote: > On Mon, Jun 19, 2017 at 07:30:42PM -0400, Z wrote: >> This patch adds support for Unix domain sockets. A filename of the form >> /dev/unixstream/path used in a

Re: [PATCH] Unix domain socket filename redirection

2017-06-19 Thread Eduardo A . Bustamante López
On Mon, Jun 19, 2017 at 07:30:42PM -0400, Z wrote: > This patch adds support for Unix domain sockets. A filename of the form > /dev/unixstream/path used in a redirection makes bash attempt to open a > connection to the Unix domain stream socket at /path. Similarly a filename > of the form

[PATCH] Unix domain socket filename redirection

2017-06-19 Thread Z
This patch adds support for Unix domain sockets. A filename of the form /dev/unixstream/path used in a redirection makes bash attempt to open a connection to the Unix domain stream socket at /path. Similarly a filename of the form /dev/unixdgram/path makes bash attempt to open a connection to the

[PATCH] Unix domain socket filename redirection

2017-06-19 Thread Z
This patch adds support for Unix domain sockets. A filename of the form /dev/unixstream/path used in a redirection makes bash attempt to open a connection to the Unix domain stream socket at /path. Similarly a filename of the form /dev/unixdgram/path makes bash attempt to open a connection to the