From 9998e0c0c56978bef9c1806912217ad73a90db70 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 23:09:19 +0000 Subject: Add sources defined in the spec file --- diff --git a/SPECS/create-munge-key b/SPECS/create-munge-key new file mode 100644 index 0000000..07dddd4 --- /dev/null +++ b/SPECS/create-munge-key @@ -0,0 +1,73 @@ +#! /bin/sh +# Generates a random key for munged +# +# (C) 2007 Gennaro Oliva +# You may freely distribute this file under the terms of the GNU General +# Public License, version 2 or later. + +#Setting default random file +randomfile=/dev/urandom + +#Usage message +usage="Try \`$0 -h' for more information." + +#Help message +needhelp() { +echo Usage: create-munge-key [OPTION]... +echo Generates a random key for munged +echo List of options +echo " -f force overwriting existing old key" +echo " -r specify /dev/random as random file for key generation" +echo " default is /dev/urandom" +echo " -h display this help and exit" +} + +#Parsing command line options +while getopts "hrf" options; do + case $options in + r ) randomfile=/dev/random;; + f ) force=yes;; + h ) needhelp + exit 0;; + \? ) echo $usage + exit 1;; + * ) echo $usage + exit 1;; + esac +done + +if [ `id -u` != 0 ] ; then + echo "Please run create-munge-key as root." + exit 1 +fi + + +#Checking random file presence +if [ ! -e $randomfile ] ; then + echo $0: cannot find random file $randomfile + exit 1 +fi + +#Checking if the user want to overwrite existing key file +if [ "$force" != "yes" ] && [ -e /etc/munge/munge.key ] ; then + echo The munge key /etc/munge/munge.key already exists + echo -n "Do you want to overwrite it? (y/N) " + read ans + if [ "$ans" != "y" -a "$ans" != "Y" ] ; then + exit 0 + fi +fi + +#Generating the key file and change owner and permissions +if [ "$randomfile" = "/dev/random" ] ; then + echo Please type on the keyboard, echo move your mouse, + echo utilize the disks. This gives the random number generator + echo a better chance to gain enough entropy. +fi +echo -n "Generating a pseudo-random key using $randomfile " +dd if=$randomfile bs=1 count=1024 > /etc/munge/munge.key \ + 2>/dev/null +chown munge:munge /etc/munge/munge.key +chmod 0400 /etc/munge/munge.key +echo completed. +exit 0 diff --git a/SPECS/munge-0.5.13.tar.xz b/SPECS/munge-0.5.13.tar.xz new file mode 100644 index 0000000..0dc7170 Binary files /dev/null and b/SPECS/munge-0.5.13.tar.xz differ diff --git a/SPECS/munge.logrotate b/SPECS/munge.logrotate new file mode 100644 index 0000000..8a92840 --- /dev/null +++ b/SPECS/munge.logrotate @@ -0,0 +1,5 @@ +/var/log/munge/munged.log { + missingok + notifempty + copytruncate +}