MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zfs_secpolicy_write_perms

Function zfs_secpolicy_write_perms

freebsd/contrib/openzfs/module/zfs/zfs_ioctl.c:470–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468}
469
470static int
471zfs_secpolicy_write_perms(const char *name, const char *perm, cred_t *cr)
472{
473 int error;
474 dsl_dataset_t *ds;
475 dsl_pool_t *dp;
476
477 /*
478 * First do a quick check for root in the global zone, which
479 * is allowed to do all write_perms. This ensures that zfs_ioc_*
480 * will get to handle nonexistent datasets.
481 */
482 if (INGLOBALZONE(curproc) && secpolicy_zfs(cr) == 0)
483 return (0);
484
485 error = dsl_pool_hold(name, FTAG, &dp);
486 if (error != 0)
487 return (error);
488
489 error = dsl_dataset_hold(dp, name, FTAG, &ds);
490 if (error != 0) {
491 dsl_pool_rele(dp, FTAG);
492 return (error);
493 }
494
495 error = zfs_secpolicy_write_perms_ds(name, ds, perm, cr);
496
497 dsl_dataset_rele(ds, FTAG);
498 dsl_pool_rele(dp, FTAG);
499 return (error);
500}
501
502/*
503 * Policy for setting the security label property.

Callers 15

zfs_secpolicy_setpropFunction · 0.85
zfs_secpolicy_rollbackFunction · 0.85
zfs_secpolicy_send_newFunction · 0.85
zfs_secpolicy_promoteFunction · 0.85
zfs_secpolicy_recvFunction · 0.85
zfs_secpolicy_bookmarkFunction · 0.85
zfs_secpolicy_diffFunction · 0.85

Calls 6

dsl_pool_holdFunction · 0.85
dsl_dataset_holdFunction · 0.85
dsl_pool_releFunction · 0.85
dsl_dataset_releFunction · 0.85
secpolicy_zfsFunction · 0.50

Tested by

no test coverage detected