Function

NM-1.0NMutils_copy_cert_as_userSince 1.56

  • Reads filename on behalf of user user and writes the content to a new file in /run/NetworkManager/cert/. The new file has permission 600 and is owned by root.

    This function is useful for VPN plugins that run as root and need to verify that the user owning the connection (the one listed in the connection.permissions property) can access the file.

    Parameters

    • filename: string

      the file name of the certificate or key to copy

    • user: string

      the user to impersonate when reading the file

    Returns string

    the name of the new temporary file. Or null if an error occurred, including when the given user can't access the file.

    1.56