{"id":7084,"date":"2022-12-20T19:35:13","date_gmt":"2022-12-20T22:35:13","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/avc_context_to_sid-man3\/"},"modified":"2022-12-20T19:35:13","modified_gmt":"2022-12-20T22:35:13","slug":"avc_context_to_sid-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/avc_context_to_sid-man3\/","title":{"rendered":"avc_context_to_sid (man3)"},"content":{"rendered":"<h1 align=\"center\">avc_context_to_sid<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#RETURN VALUE\">RETURN VALUE<\/a><br \/> <a href=\"#ERRORS\">ERRORS<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">avc_context_to_sid, avc_sid_to_context, avc_get_initial_sid \u2212 obtain and manipulate SELinux security ID\u2019s<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <selinux\/selinux.h> <br \/> #include <selinux\/avc.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>int avc_context_to_sid(char *<\/b><i>ctx<\/i><b>, security_id_t *<\/b><i>sid<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>int avc_sid_to_context(security_id_t<\/b> <i>sid<\/i><b>, char **<\/b><i>ctx<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>int avc_get_initial_sid(const char *<\/b><i>name<\/i><b>, security_id_t *<\/b><i>sid<\/i><b>);<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Security ID\u2019s (SID\u2019s) are opaque representations of security contexts, managed by the userspace AVC.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>avc_context_to_sid<\/b>() returns a SID for the given <i>context<\/i> in the memory referenced by <i>sid<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>avc_sid_to_context<\/b>() returns a copy of the context represented by <i>sid<\/i> in the memory referenced by <i>ctx<\/i>. The user must free the copy with <b>freecon<\/b>(3).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>avc_get_initial_sid<\/b>() returns a SID for the kernel initial security identifier specified by <i>name<\/i>.<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>avc_context_to_sid<\/b>() and <b>avc_sid_to_context<\/b>() return zero on success. On error, \u22121 is returned and <i>errno<\/i> is set appropriately.<\/p>\n<h2>ERRORS <a name=\"ERRORS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><b>ENOMEM<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"56%\">\n<p style=\"margin-top: 1em\">An attempt to allocate memory failed.<\/p>\n<\/td>\n<td width=\"22%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">As of libselinux version 2.0.86, SID\u2019s are no longer reference counted. A SID will be valid from the time it is first obtained until the next call to <b>avc_destroy<\/b>(3). The <b>sidget<\/b>(3) and <b>sidput<\/b>(3) functions, formerly used to adjust the reference count, are no-ops and are deprecated.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Eamon Walsh <ewalsh@tycho.nsa.gov><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>avc_init<\/b>(3), <b>avc_has_perm<\/b>(3), <b>avc_cache_stats<\/b>(3), <b>avc_add_callback<\/b>(3), <b>getcon<\/b>(3), <b>freecon<\/b>(3), <b>selinux<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  avc_context_to_sid, avc_sid_to_context, avc_get_initial_sid \u2212 obtain and manipulate SELinux security ID\u2019s <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,3428,3007],"class_list":["post-7084","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-avc_context_to_sid","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7084"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7084\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}