.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "aa_splitcon 3" .TH aa_splitcon 3 2024-02-07 "AppArmor 3.1.7" AppArmor .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME aa_splitcon \- split the confinement context into a label and mode .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fB#include \fR .PP \&\fBchar *aa_splitcon(char *con, char **mode);\fR .PP Link with \fB\-lapparmor\fR when compiling. .SH DESCRIPTION .IX Header "DESCRIPTION" The \fBaa_splitcon()\fR function splits a confinement context into separate label and mode strings. The \f(CW@con\fR string is modified so that the label portion is NUL terminated. The enforcement mode is also NUL terminated and the parenthesis surrounding the mode are removed. If \f(CW@mode\fR is non-NULL, it will point to the first character in the enforcement mode string on success. .PP The Linux kernel's /proc//attr/current interface appends a trailing newline character to AppArmor contexts that are read from that file. If \f(CW@con\fR contains a single trailing newline character, it will be stripped by \&\fBaa_splitcon()\fR prior to all other processing. .SH "RETURN VALUE" .IX Header "RETURN VALUE" Returns a pointer to the first character in the label string. NULL is returned on error. .SH EXAMPLE .IX Header "EXAMPLE" .Vb 7 \& Context Label Mode \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\- \& unconfined unconfined NULL \& unconfined\en unconfined NULL \& /bin/ping (enforce) /bin/ping enforce \& /bin/ping (enforce)\en /bin/ping enforce \& /usr/sbin/rsyslogd (complain) /usr/sbin/rsyslogd complain .Ve .SH BUGS .IX Header "BUGS" None known. If you find any, please report them at . .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBaa_getcon\fR\|(2) and .