Print the context information of FILENAME, and return true iff the context could not be obtained. */
| 833 | /* Print the context information of FILENAME, and return true iff the |
| 834 | context could not be obtained. */ |
| 835 | NODISCARD |
| 836 | static bool |
| 837 | out_file_context (char *pformat, size_t prefix_len, char const *filename) |
| 838 | { |
| 839 | char *scontext; |
| 840 | bool fail = false; |
| 841 | |
| 842 | if ((follow_links |
| 843 | ? getfilecon (filename, &scontext) |
| 844 | : lgetfilecon (filename, &scontext)) < 0) |
| 845 | { |
| 846 | error (0, errno, _("failed to get security context of %s"), |
| 847 | quoteaf (filename)); |
| 848 | scontext = NULL; |
| 849 | fail = true; |
| 850 | } |
| 851 | strcpy (pformat + prefix_len, "s"); |
| 852 | printf (pformat, (scontext ? scontext : "?")); |
| 853 | if (scontext) |
| 854 | freecon (scontext); |
| 855 | return fail; |
| 856 | } |
| 857 | |
| 858 | /* Print statfs info. Return zero upon success, nonzero upon failure. */ |
| 859 | NODISCARD |