From: Gerfried Fuchs Date: Mon, 8 Jul 2002 10:33:12 +0000 (+0200) Subject: Imported Debian patch 1.2.2-2.woody1 X-Git-Tag: debian/1.2.2-2.woody1^0 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=d858fa441d75da1e93c99d2ac068786cdcba8c08;p=pkg%2Fbeep.git Imported Debian patch 1.2.2-2.woody1 --- diff --git a/Makefile b/Makefile index 5856f9f..cc359c4 100644 --- a/Makefile +++ b/Makefile @@ -15,5 +15,5 @@ beep : beep.c install : cp ${EXEC_NAME} ${INSTALL_DIR} - rm -f /usr/man/man1/beep.1.bz2 + # rm -f /usr/man/man1/beep.1.bz2 cp ${MAN_FILE} ${MAN_DIR} diff --git a/beep.c b/beep.c index f774b56..6e4be8d 100644 --- a/beep.c +++ b/beep.c @@ -218,8 +218,8 @@ void play_beep(beep_parms_t parms) { int i; /* loop counter */ /* try to snag the console */ - if((console_fd = open("/dev/console", O_WRONLY)) == -1) { - fprintf(stderr, "Could not open /dev/console for writing.\n"); + if((console_fd = open("/dev/tty0", O_WRONLY)) == -1) { + fprintf(stderr, "Could not open /dev/tty0 for writing.\n"); printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ perror("open"); exit(1); diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..4dfef2b --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,9 @@ +beep for Debian +--------------- + +The code is quite short so it should be clear that it's not exploitable. +I therefore think that "suid root with only group audio executeable" is an +acceptable default - you are of course able to change it anytime with +dpkg-reconfigure beep + + -- Gerfried Fuchs , Wed, 27 Feb 2002 12:48:26 +0100 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..d46af92 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,56 @@ +beep (1.2.2-2.woody1) woody-proposed-updates; urgency=medium + + * Installed the postrm script into the binary package (similar to #144946). + No other changes where made, just installing the postrm script into the + binary package. + + -- Gerfried Fuchs Mon, 8 Jul 2002 12:33:12 +0200 + +beep (1.2.2-2) unstable; urgency=medium + + * Open /dev/tty0 instead of /dev/console (closes: #134015) + + -- Gerfried Fuchs Tue, 23 Apr 2002 17:33:29 +0200 + +beep (1.2.2-1) unstable; urgency=low + + * New upstream release + * printf("\a") now if it can't open /dev/console (closes: #134466) + * Put a sane paragraph into the copyright file, not only the location of the + GPL on Debian Systems. + + -- Gerfried Fuchs Tue, 02 Apr 2002 08:21:36 +0200 + +beep (1.2.1-5) unstable; urgency=low + + * Updated watchfile to uscan version=2. + + -- Gerfried Fuchs Mon, 18 Mar 2002 11:30:31 +0100 + +beep (1.2.1-4) unstable; urgency=medium + + * Added russion templates file -- thanks to Ilgiz Kalmetev (closes: #137619) + * changed from char to int to make it work on systems where char is unsigned + -- thanks to Daniel Eisenbud (closes: #136281) --> urgency reason + + -- Gerfried Fuchs Mon, 11 Mar 2002 12:52:08 +0100 + +beep (1.2.1-3) unstable; urgency=low + + * Rewrote the templates file with hints from JoeyH, dancer and Francesco -- + thanks, dudes (closes: #135866, #134811) + * Cleaned up rules file a little bit. + + -- Gerfried Fuchs Wed, 27 Feb 2002 12:47:54 +0100 + +beep (1.2.1-2) unstable; urgency=low + + * Un-debhepler-ized rules file. + + -- Gerfried Fuchs Wed, 13 Feb 2002 13:15:33 +0100 + +beep (1.2.1-1) unstable; urgency=low + + * Initial Release. + + -- Gerfried Fuchs Fri, 08 Feb 2002 12:38:28 +0100 diff --git a/debian/config b/debian/config new file mode 100644 index 0000000..aa95410 --- /dev/null +++ b/debian/config @@ -0,0 +1,10 @@ +#!/bin/sh -e + +# Source debconf library. +. /usr/share/debconf/confmodule + +# how to suid the beep program +db_input medium beep/suid_option || true +db_go + +exit 0 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..93c4d1b --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: beep +Section: sound +Priority: optional +Maintainer: Gerfried Fuchs +Standards-Version: 3.5.6 + +Package: beep +Architecture: any +Depends: ${shlibs:Depends}, debconf +Description: Advanced pc-speaker beeper + beep does what you'd expect: it beeps. But unlike printf "\a" beep allows + you to control pitch, duration, and repetitions. Its job is to live inside + shell/perl scripts and allow more granularity than one has otherwise. It is + controlled completely through command line options. It's not supposed to be + complex, and it isn't - but it makes system monitoring (or whatever else it + gets hacked into) much more informative. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..fb76ae1 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,27 @@ +This package was debianized by Gerfried Fuchs on +Thu, 18 Oct 2001 09:26:50 +0200. + +It was downloaded from http://www.johnath.com/beep/ + +Upstream Author: Johnathan Nightingale + +Copyright: +========== +This software is copyright (C) 2000 by Johnathan Nightingale. + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 dated June, 1991. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..44c01f1 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,48 @@ +#!/bin/sh -e + +action="$1" + +# Source debconf library. +if [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule +fi + +if [ "$action" != configure ]; then + exit 0 +fi + +if [ -d /usr/doc -a ! -e /usr/doc/beep -a -d /usr/share/doc/beep ]; then + ln -sf ../share/doc/beep /usr/doc/beep +fi + +suid=false +if [ -e /usr/share/debconf/confmodule ]; then + db_get beep/suid_option + suid="$RET" +fi + +# repair typo in option (see #135866) +if [ "$suid" = "suid root with only group audio executeable" ] ; then + db_set beep/suid_option "suid root with only group audio executable" + suid="suid root with only group audio executable" +fi + +if [ -x /usr/sbin/dpkg-statoverride ] ; then + if ! dpkg-statoverride --list /usr/bin/beep >/dev/null ; then + if [ "$suid" = "suid root for all" ] ; then + chmod 4755 /usr/bin/beep + elif [ "$suid" = "suid root with only group audio executable" ] ; then + chmod 4754 /usr/bin/beep + elif [ "$suid" = "not suid at all" ] ; then + chmod 0755 /usr/bin/beep + fi + fi +else + if [ "$suid" = "suid root for all" ] ; then + chmod 4755 /usr/bin/beep + elif [ "$suid" = "suid root with only group audio executable" ] ; then + chmod 4754 /usr/bin/beep + elif [ "$suid" = "not suid at all" ] ; then + chmod 0755 /usr/bin/beep + fi +fi diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..ce18ea0 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,6 @@ +#!/bin/sh +set -e +if [ "$1" = purge -a -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge +fi diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..0695335 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,5 @@ +#!/bin/sh +set -e +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/beep ]; then + rm -f /usr/doc/beep +fi diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..dba1de3 --- /dev/null +++ b/debian/rules @@ -0,0 +1,64 @@ +#!/usr/bin/make -f + +clean: + $(checkdir) + $(checkroot) + -rm -rf debian/beep debian/substvars debian/files build-stamp + -$(MAKE) clean + + +build: build-stamp +build-stamp: + $(checkdir) + $(MAKE) + touch build-stamp + + +install: build + $(checkdir) + $(checkroot) + -rm -rf debian/beep debian/substvars + mkdir -m755 debian/beep + cd debian/beep && mkdir -m755 -p usr/bin usr/share/man/man1 \ + usr/share/doc/beep + $(MAKE) install INSTALL_DIR=$(CURDIR)/debian/beep/usr/bin \ + MAN_DIR=$(CURDIR)/debian/beep/usr/share/man/man1 + strip --remove-section=.comment --remove-section=.note \ + debian/beep/usr/bin/beep + chown root.audio debian/beep/usr/bin/beep + install -m644 -p CREDITS README debian/beep/usr/share/doc/beep + install -m644 -p CHANGELOG debian/beep/usr/share/doc/beep/changelog + gzip -9 debian/beep/usr/share/doc/beep/changelog \ + debian/beep/usr/share/doc/beep/README + + +binary-arch: build install + $(checkdir) + $(checkroot) + mkdir -m755 debian/beep/DEBIAN + install -m644 -p debian/README.Debian debian/copyright \ + debian/beep/usr/share/doc/beep + install -m644 -p debian/changelog \ + debian/beep/usr/share/doc/beep/changelog.Debian + gzip -9 debian/beep/usr/share/doc/beep/changelog.Debian + install -m755 -p debian/postinst debian/prerm debian/postrm \ + debian/config debian/beep/DEBIAN + install -m644 -p debian/templates debian/beep/DEBIAN + dpkg-shlibdeps -Tdebian/substvars -dDepends debian/beep/usr/bin/beep + dpkg-gencontrol -ldebian/changelog -isp -Tdebian/substvars -pbeep \ + -Pdebian/beep + cd debian/beep && find * -type f ! -regex '^DEBIAN/.*' -print0 | \ + xargs -r0 md5sum > DEBIAN/md5sums + dpkg --build debian/beep .. + + +define checkdir + test -f debian/rules +endef + +define checkroot + test root = "`whoami`" +endef + +binary: binary-arch +.PHONY: clean build install binary-arch binary diff --git a/debian/templates b/debian/templates new file mode 100644 index 0000000..92e2093 --- /dev/null +++ b/debian/templates @@ -0,0 +1,15 @@ +Template: beep/suid_option +Type: select +Choices: suid root for all, suid root with only group audio executable, not suid at all +Default: suid root with only group audio executable +Description: How to handle suid root for beep program? + beep must be run as root since it needs to access the speaker hardware. + There are several posibilities to make the program usable: Either only + for root (no suid bit at all), executable only by users of the group + audio, or usable for all. + . + Any program that is suid root is a potential security risk so this is not + the default. Because each program that is suid root is security risk this + is not done by default. However, the program is quite small (~150 lines + of code) and is fairly easy to verify the safety of the code yourself, if + you don't trust my judgement. diff --git a/debian/templates.de b/debian/templates.de new file mode 100644 index 0000000..7cca443 --- /dev/null +++ b/debian/templates.de @@ -0,0 +1,27 @@ +Template: beep/suid_option +Type: select +Choices: suid root for all, suid root with only group audio executable, not suid at all +Choices-de: suid root für alle, suid root nur für Gruppe audio ausführbar, nicht suid gesetzt +Default: suid root with only group audio executable +Description: How to handle suid root for beep program? + beep must be run as root since it needs to access the speaker hardware. + There are several posibilities to make the program usable: Either only + for root (no suid bit at all), executable only by users of the group + audio, or usable for all. + . + Any program that is suid root is a potential security risk so this is not + the default. Because each program that is suid root is security risk this + is not done by default. However, the program is quite small (~150 lines + of code) and is fairly easy to verify the safety of the code yourself, if + you don't trust my judgement. +Description-de: Wie soll beep suid root gesetzt werden? + beep muss als root ausgeführt werden, da es auf den Lautsprecher + zugreifen muss. Es gibt mehrere Möglichkeiten, das Programm benutzbar zu + machen: Entweder nur für root (gar kein suid), benutzbar von den + Mitgliedern der Gruppe audio, oder für alle benutzbar. + . + Jedes Programm, dass suid root gesetzt ist, ist ein potentielles + Sicherheitsproblem und daher wird es auch nicht automatisch durchgeführt. + Jeoch ist das Programm recht kurz (~150 Zeilen Code) und kann von Ihnen + recht leicht geprüft werden, falls Sie meiner Einschätzung nicht + vertrauen. diff --git a/debian/templates.ru b/debian/templates.ru new file mode 100644 index 0000000..f2cb520 --- /dev/null +++ b/debian/templates.ru @@ -0,0 +1,29 @@ +Template: beep/suid_option +Type: select +Choices: suid root for all, suid root with only group audio executable, not suid at all +Default: suid root with only group audio executable +Description: How to handle suid root for beep program? + beep must be run as root since it needs to access the speaker hardware. + There are several posibilities to make the program usable: Either only + for root (no suid bit at all), executable only by users of the group + audio, or usable for all. + . + Any program that is suid root is a potential security risk so this is not + the default. Because each program that is suid root is security risk this + is not done by default. However, the program is quite small (~150 lines + of code) and is fairly easy to verify the safety of the code yourself, if + you don't trust my judgement. +Choices-ru: suid root ÄÌÑ ×ÓÅÈ, suid root ÔÏÌØËÏ ÄÌÑ ÇÒÕÐÐÙ audio, ÎÅ ÓÔÁ×ÉÔØ suid ×ÏÏÂÝÅ +Default-ru: suid root ÔÏÌØËÏ ÄÌÑ "Ú×ÕËÏ×ÏÊ" ÇÒÕÐÐÙ +Description-ru: ëÁË ÏÂÒÁÂÏÔÁÔØ suid root ÄÌÑ ÐÒÏÇÒÁÍÍÙ beep? + beep ÄÏÌÖÅÎ ÒÁÂÏÔÁÔØ ÏÔ ÉÍÅÎÉ ÐÏÌØÚÏ×ÁÔÅÌÑ root, ÔÁË ËÁË ÅÍÕ ÎÕÖÅÎ + ÄÏÓÔÕÐ Ë ÄÉÎÁÍÉËÕ. åÓÔØ ÎÅÓËÏÌØËÏ ×ÏÚÍÏÖÎÏÓÔÅÊ ÉÓÐÏÌØÚÏ×ÁÔØ ÐÒÏÇÒÁÍÍÕ: + ÉÌÉ ÔÏÌØËÏ ÄÌÑ root (ÎÅ ÕÓÔÁÎÁ×ÌÉ×ÁÔØ ÂÉÔ suid ÎÉ ÄÌÑ ËÏÇÏ), ÉÌÉ + ÓÄÅÌÁÔØ ×ÙÐÏÌÎÉÍÙÍ ÔÏÌØËÏ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÅÊ ÇÒÕÐÐÙ audio, ÉÌÉ + ×ÙÐÏÌÎÉÍÙÍ ÄÌÑ ×ÓÅÈ. + . + ðÒÏÇÒÁÍÍÙ, Õ ËÏÔÏÒÙÈ ÕÓÔÁÎÏ×ÌÅÎ suid root, ÎÅÓÕÔ × ÓÅÂÅ ÕÇÒÏÚÕ + ÂÅÚÏÐÁÓÎÏÓÔÉ, ÔÁË ÞÔÏ ÐÏ ÕÍÏÌÞÁÎÉÀ ÜÔÏ ÎÅ ÕÓÔÁÎÁ×ÌÉ×ÁÅÔÓÑ. ïÄÎÁËÏ, + ÐÒÏÇÒÁÍÍÁ ÉÓËÌÀÞÉÔÅÌØÎÏ ÍÁÌÁ (~150 ÓÔÒÏË ËÏÄÁ), É ×Ù ×ÅÓØÍÁ ÌÅÇËÏ + ÍÏÖÅÔÅ ÐÒÏ×ÅÒÉÔØ ÂÅÚÏÐÁÓÎÏÓÔØ ÄÁÎÎÏÇÏ ËÏÄÁ ÓÁÍÉ, ÅÓÌÉ ÎÅ ÄÏ×ÅÒÑÅÔÅ ÍÎÅ. + diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..0c6fea3 --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=2 +# Site/Directory Pattern Version Script +http://www.johnath.com/beep/ beep-([\d\.]*)\.tar\.gz debian uupdate