Hi Leo,

Your method of employing a file system helper via RPC to perform file 
system operations as an authenticated user appears to be well-conceived. 
Regarding your inquiry about leveraging stdin/stdout for communication 
within a gRPC-based framework, it is worth noting that gRPC is inherently 
designed to operate over TCP/UDP sockets, and stdin/stdout communication is 
not a built-in feature of gRPC.

There are several approaches you could consider.  if you wish you can 
follow the below steps also.

1. *Use gRPC over Unix Domain Sockets (UDS)*
2. *Custom I/O Stream Transport.*
3. *Consider gRPC with a forkfork Instead of Popen.* 

If avoiding the use of sockets is a firm requirement, you might explore 
alternatives like JSON-RPC over stdin/stdout or other lightweight RPC 
protocols that are better suited for pipe-based inter-process communication 
(IPC). Please let me know if you would any.

Thanks and Regards
Chandra

On Tuesday, April 1, 2025 at 7:43:27 PM UTC+5:30 Leo wrote:

> Hi folks,
>
> I am working on a WebDAV daemon (WebDAV server) written in Python which 
> runs filesystem-related functions as the authenticated user than *root* 
> or *nobody*.
>
> The approach I tried to fulfill this attribute is implementing a so-called 
> filesystem-helper which is a RPC server implements filesystem related 
> functions. (e.g. *open*, *read*, *write*, *close*, *mkdir*, etc)
>
> The daemon act as a RPC client and spawn filesystem helpers on successful 
> user authentication by invoking *subprocess.Popen(). *The helper invokes 
> *os.setuid()* & *os.setgid()* immediately after spawn.
>
> Thus the helper is now running as the authenticated user and accepting 
> requests from the deamon.
>
> My question is, (TCP/UDP) sockets are used by RPC implementations between 
> their client-server communication conventionally, if gRPC is being used in 
> this scenario, is it possible for the server (filesystem helper, child 
> process) and client (daemon, parent process) communicate on *stdin*/
> *stdout*?
>
> Thanks,
> Leo
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/grpc-io/e1103dac-ef14-485b-a92c-bccc321df95dn%40googlegroups.com.

Reply via email to