[Pkg-wmaker-commits] [wmtv] 07/48: Imported Debian patch 0.6.5-2potato2

Doug Torrance dtorrance-guest at moszumanska.debian.org
Mon Feb 1 20:13:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmtv.

commit 290f9986ffa04bfe3aa1bf39efeef1e1255d7531
Author: Nicolas Boullis <Boullis.Nicolas at libertysurf.fr>
Date:   Fri Dec 7 01:00:46 2001 +0100

    Imported Debian patch 0.6.5-2potato2
---
 Makefile         |  10 +--
 conffiles        |   1 +
 debian/changelog |  28 ++++++++
 debian/conffiles |   1 +
 debian/control   |  13 ++++
 debian/copyright |  10 +++
 debian/dirs      |   2 +
 debian/docs      |   1 +
 debian/rules     |  74 ++++++++++++++++++++
 debian/wmtv.1x   | 203 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/wmtv.c       |  34 +++++++---
 wmtvrc.sample    |  23 ++++---
 12 files changed, 376 insertions(+), 24 deletions(-)

diff --git a/Makefile b/Makefile
index 0e8407b..3669139 100644
--- a/Makefile
+++ b/Makefile
@@ -8,16 +8,16 @@ OBJS	=	src/wmtv.o \
 			src/wmgeneral/wmgeneral.o \
 
 .c.o:
-	cc -c -O2 -Wall -D$(shell echo `uname -s`) $< -o $*.o $(INCDIR)
+	cc -g -c -O2 -Wall -D$(shell echo `uname -s`) $< -o $*.o $(INCDIR)
 
 all: wmtv
 
 wmtv: $(OBJS)
-	cc -o wmtv $^ $(LIBDIR) $(LIBS)
+	cc -g -o wmtv $^ $(LIBDIR) $(LIBS)
 
-install:: all
-	install -s -m 4755 -o root wmtv /usr/X11R6/bin
-	install -m 0644 -o root -g root wmtvrc.sample /etc/wmtvrc
+install: all
+	install -s -m 4755 -o root wmtv $(DESTDIR)/usr/X11R6/bin/wmtv
+	install -m 0644 -o root -g root wmtvrc.sample $(DESTDIR)/etc/wmtvrc
 
 clean:
 	for i in $(OBJS) ; do \
diff --git a/conffiles b/conffiles
new file mode 100644
index 0000000..d8826dc
--- /dev/null
+++ b/conffiles
@@ -0,0 +1 @@
+/etc/wmtvrc
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..6369c72
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,28 @@
+wmtv (0.6.5-2potato2) stable; urgency=high
+
+  * Fixed possible symlinks attacks and buffer overflows.
+
+ -- Nicolas Boullis <Boullis.Nicolas at libertysurf.fr>  Fri,  7 Dec 2001 01:00:46 +0100
+
+wmtv (0.6.5-2potato1) unstable; urgency=low
+
+  * Fixed local root vulnerability by dropping privileges before
+    executing an external viewer (#118778).
+
+ -- Remi Lefebvre <remi at debian.org>  Tue, 20 Nov 2001 02:28:51 +0100
+
+wmtv (0.6.5-2) unstable; urgency=low
+
+  * Complies with new policy.
+
+ -- Remi Lefebvre <remi at debian.org>  Wed, 29 Sep 1999 15:54:10 -0400
+
+wmtv (0.6.5-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Remi Lefebvre <remi at debian.org>  Sun,  8 Aug 1999 14:52:41 -0400
+
+Local variables:
+mode: debian-changelog
+End:
diff --git a/debian/conffiles b/debian/conffiles
new file mode 100644
index 0000000..d8826dc
--- /dev/null
+++ b/debian/conffiles
@@ -0,0 +1 @@
+/etc/wmtvrc
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..83a4ef5
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,13 @@
+Source: wmtv
+Section: x11 
+Priority: extra 
+Maintainer: Nicolas Boullis <Boullis.Nicolas at libertysurf.fr>
+Standards-Version: 3.0.0
+
+Package: wmtv
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Dockable video4linux tv player for windowmaker
+ A miniature size dockable tv app. It currently supports channel presets,
+ PAL/Secam/NTSC, fine tuning, scanning of TV stations use of external TV 
+ application and more.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..7f50033
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,10 @@
+This package was debianized by Remi Lefebvre <remi at debian.org> on
+Sun,  8 Aug 1999 14:52:41 -0400.
+
+It was downloaded from http://www.student.uwa.edu.au/~wliang 
+
+Upstream Author(s): Wee Liang <wliang at tartarus.uwa.edu.au>
+
+Copyright:
+GPLv2. You should find a copy of it in /usr/doc/copyright/GPL on 
+Debian GNU/Linux systems.
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..bee0244
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1,2 @@
+usr/X11R6/bin
+etc
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+README
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..3bbe5ff
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,74 @@
+#!/usr/bin/make -f
+#-*- makefile -*-
+# Made with the aid of dh_make, by Craig Small
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+# Some lines taken from debmake, by Christoph Lameter.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+export DH_COMPAT=2
+
+build: build-stamp
+build-stamp:
+	dh_testversion 2
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE) 
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp install-stamp
+
+	# Add here commands to clean up after the build process.
+	-$(MAKE) clean
+
+	dh_clean
+
+install: install-stamp
+install-stamp: build-stamp
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/tmp.
+	$(MAKE) install DESTDIR=`pwd`/debian/wmtv
+
+	touch install-stamp
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+#	dh_testversion
+	dh_testdir
+	dh_testroot
+	dh_installdocs
+	dh_installcron
+	dh_installmanpages
+	dh_installchangelogs CHANGES
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms -Xwmtv
+	# You may want to make some executables suid here
+	dh_suidregister
+#	dh_makeshlibs
+	dh_installdeb
+#	dh_perl 
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+source diff:                                                                  
+	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary
diff --git a/debian/wmtv.1x b/debian/wmtv.1x
new file mode 100644
index 0000000..e58f452
--- /dev/null
+++ b/debian/wmtv.1x
@@ -0,0 +1,203 @@
+.TH wmtv 1
+.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
+.\" other parms are allowed: see man(7), man(1)
+.SH "NAME"
+wmtv \- dockable video4linux tv player for window-maker.  
+
+.SH "SYNOPSIS"
+.B wmtv
+.I "[--exe program]"
+
+.SH "DESCRIPTION"
+.BR wmtv 
+is a dockable video4linux tv player. It supports channel presets, 
+PAL/Secam/NTSC, fine tuning, full screen display, ... This manual 
+page was written for the Debian GNU/Linux distribution because the 
+original program does not have a manual page. It is widely based on
+the README provided with the program.
+
+.SH "OPTIONS"
+.TP
+.B \-e, \-\-exe
+Uses an external tv player to be launched when double clicking on the
+tv screen.
+
+.SH "USAGE"
+This sections describes how to use the application in docked
+state. See lower for fullscreen mode usage.
+
+Button map:
+.br
+    [ < ] [ > ] [ 0 ]
+.br
+     <1>   <2>   <3>
+
+There are 3 modes of operation on this applications. You can cycle
+through the 3 modes by clicking on the right most button <3> repeatedly.
+
+The 3 modes are described below:
+
+.in +5
+.B "On mode"
+.br
+.B "---------"
+.br
+Clicking on the rightmost button <3> for the first time (after the
+start of WMTV) would turn TV on. During this mode, the left <1> and 
+right <2> but tons are used to change preset channels which has been 
+defined in your config file. Left button to move down 1 channel and 
+Right button to move up one channel.
+
+.B "Tune mode"
+.br
+.B "---------"
+.br
+Clicking again on button <3> after On mode would bring WMTV into
+tune mode. During this mode, the left <1> and right <2> buttons have
+two purposes individually. Left clicking on the left <1> or right <2>
+buttons would perform scans of channels. Scanning will stop when there
+is a strong signal strength. Right clicking on the left <1> or right
+<2> button would fine tune the current frequency. After tuning,
+clicking on button <3> would set the fine tuned offset into your
+config file and bring you back into "On mode". 
+
+.B "Off mode"
+.br
+.B "--------"
+.br
+Holding down button <3> for about 3 seconds from any of the two
+modes described above, would turn the TV off.
+.in -5
+
+Right clicking once on the TV Screen would mute/unmute the audio.
+
+Double clicking LEFT mouse button on the TV Screen would launch your
+favorite TV application when specified with --exe <filename> option in
+the command line. If the external application is not set, It'll
+automatically switch to the build in full screen mode. Double clicking
+the MIDDLE mouse button on the TV Screen would bring you into the
+built in full screen mode.
+
+.SH "FULL SCREEN MODE"
+Single click on any mouse button will return to initial screen.
+
+.B Keyboard functions
+.br
+.B ------------------
+.br
+.in +2
+Up      -  Switch preset channels up.
+.br
+Down    -  Switch preset channels down.
+.br
+Right   -  Volume up.
+.br
+Left    -  Volume down.
+.br
+Escape  -  Return to initial screen.
+.br
+m       -  mute/unmute audio.
+.br
+.in -2
+
+.SH "CONFIGURATION FILE"
+This section describes on how to configure WMTV's configuration file.
+Your configuration file is located in your home directory as ".wmtvrc". 
+
+Excerpt from a sample config file:
+.in +5
+.br
+/*-----------------------
+.sp
+source = Television
+.br
+freqnorm = pal-australia
+.br
+maxpreset = 7
+.br
+mode = pal
+.br
+fullscreen = 640x480
+.br
+
+.sp
+[channel]
+.br
+2
+.br
+7
+.br
+9
+.br
+10
+.br
+32 (50)
+.br
+SE11
+.br
+S21
+.br
+-------------------------*/
+.br
+.in -5
+
+.B Settings
+.br
+.B --------
+.br
+source = {Television|CompositeX|S-Video} (X is an integer)
+.br
+.sp
+freqnorm = {ntsc-bcast|ntsc-cable|ntsc-cable-hrc|ntsc-bcast-jp|ntsc-cable-jp|pal
+-europe|pal-europe-east|pal-italy|pal-newzealand|pal-australia|pal-ireland}
+
+maxpreset = integer (maximum channel presets)
+
+mode = {pal|ntsc|secam}
+
+fullscreen = {widthxheight}
+
+[channel]
+choose a total of <maxpreset> from the below channels.
+separate it with a new line as in the sample config file above.
+.br
+{
+ E2|E3|E4|
+ S01|S02|S03|
+ R1|R2|R3|R4|R5|
+ SE1|SE2|SE3|SE4|SE5|SE6|SE7|SE8|SE9|SE10|
+ E5|E6|E7|E8|E9|E10|E11|E12|
+ R6|R7|R8|R9|R10|R11|R12|
+ SE11|SE12|SE13|SE14|SE15|SE16|SE17|SE18|SE19|SE20|
+ S21|S22|S23|S24|S25|S26|S27|S28|S29|S30|S31|S32|S33|S34|S35|S36|S37|S38|S39|S40
+|S41
+ T7|T8|T9|T10|T11|T12|T13|T14|
+ 1 - 125
+.br
+}
+.br
+finetune parameters could be added spaced after the channel name above
+in a bracket.
+.br
+.sp
+for example:
+  32 (50)                 # channel 32 plus 50
+  or
+  SE11 (-10)              # channel SE11 minus 10
+
+.SH "FILES"
+.TP
+.I /etc/wmtvrc
+System wide config file.
+.TP
+.I ~/.wmtvrc
+Users config file.
+
+.\".SH "SEE ALSO"
+.\"The programs are documented fully by
+.\".IR "The Rise and Fall of a Fooish Bar" ,
+.\"available via the Info system.
+.SH AUTHOR
+This manual page was written by Remi Lefebvre <remi at debian.org>,
+for the Debian GNU/Linux system (but may be used by others).
+
diff --git a/src/wmtv.c b/src/wmtv.c
index c552346..40a88ee 100644
--- a/src/wmtv.c
+++ b/src/wmtv.c
@@ -221,9 +221,11 @@ main(int argc, char *argv[])
 		{0, 0, 0, 0}
 	};
 
+	seteuid(getuid()); /* Temporarily drop privileges */
+
 	progname = strdup(argv[0]);
 
-	strncpy(cfile, (char *)getenv("HOME"), sizeof(char)*128);
+	strncpy(cfile, (char *)getenv("HOME"), sizeof(char)*(128-9));
 	strcat(cfile, "/.wmtvrc");
 
 	while (1) {
@@ -250,7 +252,7 @@ main(int argc, char *argv[])
 					break;
 				case 'e':
 					exe = strdup(optarg);
-					strcat(exe, " &");
+					/*strcat(exe, " &");*/
 					break;
 				case 'b':
 					fprintf(stderr, "wmtv: option not implemented yet\n");
@@ -440,7 +442,17 @@ main(int argc, char *argv[])
 													if (exe) {
 														ntfb_status = SETOFF;
 														TVOff();
-														system(exe);
+														/* system(exe); */
+														if (fork() == (pid_t) 0) {
+                                                                                                                    char *argv[4];
+                                                                                                                    setuid(getuid()); /* Drop the privileges */
+                                                                                                                    argv[0] = "sh";
+                                                                                                                    argv[1] = "-c";
+                                                                                                                    argv[2] = exe;
+                                                                                                                    argv[3] = NULL;
+                                                                                                                    execv("/bin/sh", argv);
+                                                                                                                    exit(-1);
+														}
 														/*
 														pid = fork();
 
@@ -1018,7 +1030,7 @@ ParseRCFile2(const char *filename)
 {
 	int  menu = FALSE;
 	char temp[128];
-	char tp[10];
+	char tp[40];
 	char *tokens = " \t\n()";
 	char *q, *p;
 	FILE *fp;
@@ -1055,10 +1067,8 @@ ParseRCFile2(const char *filename)
 				else {
 					ftune[i] = 0;
 				}
-				wcname[i] = (char *)malloc(sizeof(cname[i])+sizeof(p));
-				wcname[i] = strdup(cname[i]);
-				sprintf(tp, " (%d) ", ftune[i]);	
-				strcat(wcname[i], tp);
+				wcname[i] = (char *)malloc(strlen(cname[i])+41);
+				sprintf (wcname[i], "%s (%d) ", cname[i], ftune[i]);
 				i++;
 				tpst = i;
 			}
@@ -1095,9 +1105,11 @@ WriteRCFile(const char *filename)
 			if ((q = strchr(q, '[')) != NULL) {
 				for (i = 0; i <= maxpst; i++) {
 					// fprintf(stderr, "offset is %ld\n", offset);
+					/*
 					sprintf(tp, " (%ld) ", offset);
 					strtok(wcname[cchannel], tokens);
 					strcat(wcname[cchannel], tp);
+					*/
 					fputs(wcname[i], fp);
 					fputs("\n", fp);
 				}
@@ -1161,7 +1173,7 @@ InitConfig(void)
 	ParseRCFile(temp, wmtv_keys);
 	ParseRCFile2(temp);
 	
-	strncpy(temp, (char *)getenv("HOME"), (sizeof(char)*128));
+	strncpy(temp, (char *)getenv("HOME"), (sizeof(char)*(128-9)));
 	strcat(temp, "/.wmtvrc");
 	ParseRCFile(temp, wmtv_keys);
 	ParseRCFile2(temp);
@@ -1343,9 +1355,13 @@ GetFrameBuffer(void)
 	if (Winattr.depth == 15)
 		vfb.depth = 15;
 
+	seteuid(0); /* Regain privileges */
+
 	if (ioctl(tfd, VIDIOCSFBUF, &vfb) < 0) {
 		perror("ioctl VIDIOCSFBUF");
 	}
+
+	seteuid(getuid()); /* Temporarily drop privileges */
 }
 
 
diff --git a/wmtvrc.sample b/wmtvrc.sample
index ab1d582..1c83169 100644
--- a/wmtvrc.sample
+++ b/wmtvrc.sample
@@ -1,13 +1,16 @@
 source = Television
-freqnorm = pal-australia
-maxpreset = 7
-mode = pal
+freqnorm = ntsc-bcast 
+maxpreset = 10
+mode = ntsc 
 
 [channel]
-2
-7
-9
-10
-32
-S21
-SE11
+2 (0) 
+6 (0) 
+10 (0) 
+12 (0) 
+17 (0) 
+22 (0) 
+35 (0) 
+44 (3) 
+46 (-4) 
+57 (-2) 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmtv.git



More information about the Pkg-wmaker-commits mailing list