fs_crypto_migrate_tag()

Updated: October 26, 2022

Mark a file for migration into an encryption domain

Synopsis:

#include <fs_crypto_api.h>
#include <sys/fs_crypto.h>

int fs_crypto_migrate_tag( const char *path,
                           int domain,
                           int *preply );

Arguments:

path
The path of the file to mark for migration.
domain
The domain that the file is to migrate to. This can be 0, (FS_CRYPTO_UNASSIGNED_DOMAIN) if you don't want the item to be in any domain, and hence unencrypted.
preply
A pointer to a location where the function can store additional success or error information.

Library:

libfscrypto

Use the -l fscrypto option to qcc to link against this library.

Description:

The fs_crypto_migrate_tag() function marks a file for migration into an encryption domain. When you've marked all the files that you want to migrate, call fs_crypto_migrate_control() to start the background encryption.

For directories, this operation is functionally equivalent to fs_crypto_file_set_domain(). Regular files may have unencrypted data contents.

Note:
  • In order to use filesystem encryption, download the Encrypted Filesystem package from the QNX Software Center.
  • In order for you to tag files for migration, the source and destination domains must be unlocked.

This function sets the variable pointed to by preply to one of the following values:

FS_CRYPTO_REPLY_BAD_FILE
The path specifies a restricted file that can't migrate.
FS_CRYPTO_REPLY_COMPLETE
The file was successfully marked.
FS_CRYPTO_REPLY_INVALID
The command wasn't completed successfully.
FS_CRYPTO_REPLY_READONLY
The filesystem is mounted read-only.
FS_CRYPTO_REPLY_NOSUPPORT
The file isn't a regular file.

Returns:

EOK
Success.
EINVAL
Invalid arguments.
ENOTSUP
The file isn't a regular file.

This function can also return any of the errors indicated by devctl() or open().

Classification:

QNX Neutrino

Safety:  
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread Yes