diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix index a1fb0b3951e4..c916839f126c 100644 --- a/nixos/modules/services/printing/cupsd.nix +++ b/nixos/modules/services/printing/cupsd.nix @@ -384,14 +384,11 @@ in preStart = lib.optionalString cfg.stateless '' rm -rf /var/cache/cups /var/lib/cups /var/spool/cups '' + '' - mkdir -m 0700 -p /var/cache/cups - mkdir -m 0700 -p /var/spool/cups - mkdir -m 0755 -p ${cfg.tempDir} - - mkdir -m 0755 -p /var/lib/cups + (umask 077 && mkdir -p /var/cache/cups /var/spool/cups) + (umask 022 && mkdir -p ${cfg.tempDir} /var/lib/cups) # While cups will automatically create self-signed certificates if accessed via TLS, # this directory to store the certificates needs to be created manually. - mkdir -m 0700 -p /var/lib/cups/ssl + (umask 077 && mkdir -p /var/lib/cups/ssl) # Backwards compatibility if [ ! -L /etc/cups ]; then