lpr_selinux(8)
π lpr_selinux β the SELinux glow-up for your lpr processes
ok so bestie, welcome to the lpr_selinux(8) era β¨ this is the Security Enhanced Linux Policy page for the lpr processes, and honestly? it's giving "your printer queue but make it secure". let's get into it π
β¨ NAME β¨
lpr_selinux β the Security Enhanced Linux Policy for the lpr processes. that's the whole name, no notes π
πΈ DESCRIPTION πΈ
Security-Enhanced Linux secures the lpr processes via flexible mandatory access control. yes, mandatory β not "if you feel like it" access control, like, actual enforced vibes π₯
The lpr processes execute with the lpr_t SELinux type. you can check if you've got these processes running by executing the ps command with the -Z qualifier. for example:
ps -eZ | grep lpr_t
that's it, that's the vibe check π¦
π ENTRYPOINTS π
The lpr_t SELinux type can be entered via the lpr_exec_t file type. so like, that's the door πͺβ¨
The default entrypoint paths for the lpr_t domain are the following:
/usr/bin/lp(.cups)?, /usr/bin/lpc(.cups)?, /usr/bin/lpq(.cups)?,
/usr/bin/lpr(.cups)?, /usr/bin/lprm(.cups)?, /usr/bin/cancel(.cups)?,
/usr/bin/lpstat(.cups)?, /opt/gutenprint/bin(/.*)?,
/opt/gutenprint/sbin(/.*)?, /usr/linuxprinter/bin/l?lpr,
/usr/local/linuxprinter/bin/l?lpr, /usr/bin/accept, /usr/bin/lpinfo,
/usr/bin/lpmove, /usr/bin/lpadmin, /usr/bin/lpoptions
icons only, the whole squad is here π
π§ PROCESS TYPES π§
SELinux defines process types (domains) for each process running on the system. very demure, very mindful of everyone's boundaries π
You can see the context of a process using the -Z option to ps.
Policy governs the access confined processes have to files. SELinux lpr policy is very flexible, allowing users to set up their lpr processes in as secure a method as possible. slay π«Ά
The following process types are defined for lpr:
lpr_t
Note:semanage permissive -a lpr_tcan be used to make the process typelpr_tpermissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, it's chill but it's still watching you ππ
β BOOLEANS β
SELinux policy is customizable based on least access required. lpr policy is extremely flexible and has several booleans that let you manipulate the policy and run lpr with the tightest access possible. tightest access = main character energy, no cap π
If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default.
setsebool -P fips_mode 1
If you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default.
setsebool -P nis_enabled 1
If you want to determine whether to support lpd server, you must turn on the use_lpd_server boolean. Disabled by default.
setsebool -P use_lpd_server 1
π MANAGED FILES π
The SELinux process type lpr_t can manage files labeled with the following file types. the paths listed are the default paths for these file types. also remember: the process's UID still needs to have DAC permissions, so like, SELinux can't fix everything for you bestie π
krb5_host_rcache_t
/var/tmp/krb5_0.rcache2
/var/cache/krb5rcache(/.*)?
/var/tmp/nfs_0
/var/tmp/DNS_25
/var/tmp/host_0
/var/tmp/imap_0
/var/tmp/HTTP_23
/var/tmp/HTTP_48
/var/tmp/ldap_55
/var/tmp/ldap_487
/var/tmp/ldapmap1_0
lpr_tmp_t
(no default paths listed, just the type itself β it's mysterious like that π)
print_spool_t
/var/spool/lpd(/.*)?
/var/spool/cups(/.*)?
/var/spool/cups-pdf(/.*)?
π¦ FILE CONTEXTS π¦
SELinux requires files to have an extended attribute to define the file type. yes, an extended attribute β files have lore now β¨
You can see the context of a file using the -Z option to ls.
Policy governs the access confined processes have to these files. SELinux lpr policy is very flexible, allowing users to set up their lpr processes in as secure a method as possible. iconic π
π STANDARD FILE CONTEXT π
SELinux defines the file context types for lpr. if you wanted to store files with these types in different paths, you need to execute the semanage command to specify alternate labeling, and then use restorecon to put the labels on disk. like so:
semanage fcontext -a -t lpr_exec_t '/srv/lpr/content(/.*)?'
restorecon -R -v /srv/mylpr_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex girlies rise π§
The following file types are defined for lpr:
lpr_exec_t
- Set files with the
lpr_exec_ttype if you want to transition an executable to thelpr_tdomain.
Paths:
/usr/bin/lp(.cups)?, /usr/bin/lpc(.cups)?, /usr/bin/lpq(.cups)?,
/usr/bin/lpr(.cups)?, /usr/bin/lprm(.cups)?,
/usr/bin/cancel(.cups)?, /usr/bin/lpstat(.cups)?,
/opt/gutenprint/bin(/.*)?, /opt/gutenprint/sbin(/.*)?,
/usr/linuxprinter/bin/l?lpr, /usr/local/linuxprinter/bin/l?lpr,
/usr/bin/accept, /usr/bin/lpinfo, /usr/bin/lpmove,
/usr/bin/lpadmin, /usr/bin/lpoptions
lpr_tmp_t
- Set files with the
lpr_tmp_ttype if you want to storelprtemporary files in the/tmpdirectories. lil temp era π
Note: File context can be temporarily modified with thechconcommand. If you want to permanently change the file context, you need to use thesemanage fcontextcommand β this will modify the SELinux labeling database. You will need to userestoreconto apply the labels. like,chconis a cute lil temporary tattoo andsemanage fcontext+restoreconis the real thing, iykyk π
π COMMANDS π
semanage fcontextcan also be used to manipulate default file context mappings.semanage permissivecan also be used to manipulate whether or not a process type is permissive.semanage modulecan also be used to enable/disable/install/remove policy modules.semanage booleancan also be used to manipulate the booleans.system-config-selinuxis a GUI tool available to customize SELinux policy settings. yes bestie, a whole GUI, for when clicking is the mood π±οΈβ¨
πΈ AUTHOR πΈ
This manual page was auto-generated using sepolicy manpage. not me being written by a script π (respectfully, it ate)
π«Ά SEE ALSO π«Ά
selinux(8), lpr(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8)
and that's the whole page bestie, no crumbs left π this lpr version of the lpr_selinux(8) page is dated 26-10-06, and it came to you straight from the lpr corner of the manual β go forth and label responsibly πππ¦
π¦ where this page comes from
- opensuse-leap 16.0: selinux-policy-doc 20250627+git412.dbf877ab7-160000.1.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms