linux如何使用FUSEcryfs或gocryptfs拦截对文件的未经授权的进程访问

问题描述

现在,我使用cryfs或gocryptfs加密某些数据。 该数据只能由指定的进程访问。 如果另一个进程要访问此数据,那么cryfs或gocryptfs只需将密文返回给该未经授权的进程。

libfuse是否支持功能?或者有一些好的方法来了解哪个进程正在访问机密数据。

解决方法

libfuse通过以下调用提供当前的调用进程ID(除其他外):fuse_get_context()

返回的结构为:

struct fuse_context {
    /** Pointer to the fuse object */
    struct fuse *fuse;

    /** User ID of the calling process */
    uid_t uid;

    /** Group ID of the calling process */
    gid_t gid;

    /** Process ID of the calling thread */
    pid_t pid;

    /** Private filesystem data */
    void *private_data;

    /** Umask of the calling process */
    mode_t umask;
};

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...