[Pkg-wmaker-commits] [wmfrog] 29/145: Imported Upstream version 0.2.0
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Sun Aug 23 05:46:16 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmfrog.
commit 382b2db6973d49955e375588146db887d5480f22
Author: Jari Aalto <jari.aalto at cante.net>
Date: Fri Nov 7 11:08:55 2008 +0200
Imported Upstream version 0.2.0
---
CHANGES | 1 +
INSTALL | 26 ++++++++++++++++++----
Src/.xvpics/frog.xbm | Bin 3670 -> 0 bytes
Src/.xvpics/frog.xpm | Bin 2110 -> 0 bytes
Src/.xvpics/wmWeather_mask.xbm | Bin 3670 -> 0 bytes
Src/.xvpics/wmWeather_master.gif | Bin 3312 -> 0 bytes
Src/.xvpics/wmWeather_master.xpm | Bin 3309 -> 0 bytes
Src/weather.pl | 6 ++++--
Src/wmFrog.c | 39 ++++++++++++++++++++++-----------
Src/wmfrog.1 | 45 ---------------------------------------
wmfrog-0.1.6.ebuild | 23 --------------------
11 files changed, 53 insertions(+), 87 deletions(-)
diff --git a/CHANGES b/CHANGES
index 75b9ebb..3645139 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
Version Description
-------------------------------------------------------------------------
+0.2.0 Fixed potentail security risk, by storing temp data in ~/.wmapps/ rather than /tmp
0.1.6 *** Application name changed to wmfrog instead of wmFrog ***
Man page added by Marc Brockschmidt
Change where made to the data fetching script, so that no more eroneous temperatures should be reported (visibility as fractions problems)
diff --git a/INSTALL b/INSTALL
index 806b7f1..c6f70e5 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,5 +1,8 @@
Installation instructions for wmFrog.
+Thibaut Colar
+http://www.colar.net/wmapps/
+
Requirements
-------------------------------------------------------------------------------
wmFrog requires the Xpm library (which should be available on most machines
@@ -11,21 +14,36 @@ You also need to have Perl installed.
On FreeBSD systems you may need to use gmake instead of make.
+To compile it from sources, you will need: make, gcc, libc6, libxpm-dev, libx11-dev, libxext-dev.
+ie: apt-get install libxpm-dev, libx11-dev, libxext-dev
+To run it you will need: perl, wget, libx11-6, libxext6 and libxpm4.
+
Installation
-------------------------------------------------------------------------------
If you have a copy of wmFrog already running you should sut it down before re-installing.
-1) gunzip wmFrog-x.x.x.tar.gz
-1) tar -xvf wmFrog-x.x.x.tar
-2) cd wmFrog/Src/
+1) gunzip wmfrog-x.x.x.tar.gz
+1) tar -xvf wmfrog-x.x.x.tar
+2) cd wmfrog/Src/
3) make clean
4) make
5) make install (as root).
6) wmfrog -h & (or 'wmfrog -h' for help)
7) You need to set the location of perl correctly in /usr/lib/wmfrog if your perl
- is located in a place other than /usr/bin/
+ is not located in /usr/bin/
+
+
+Use
+--------------------------------------------------------------------------------
+Find your METAR station name here:
+http://www.nws.noaa.gov/tg/siteloc.shtml
+For example Reno, NV is KRNO
+Also you will want to set your Time offset from UTC(GMT), for example Pacific time is GMT+8, so offset is 8
+Start wmfrog, for example
+wmfrog -s KRNO -o 8
+See wmfrog -h for many more options.
diff --git a/Src/.xvpics/frog.xbm b/Src/.xvpics/frog.xbm
deleted file mode 100644
index f10301a..0000000
Binary files a/Src/.xvpics/frog.xbm and /dev/null differ
diff --git a/Src/.xvpics/frog.xpm b/Src/.xvpics/frog.xpm
deleted file mode 100644
index 17d9f57..0000000
Binary files a/Src/.xvpics/frog.xpm and /dev/null differ
diff --git a/Src/.xvpics/wmWeather_mask.xbm b/Src/.xvpics/wmWeather_mask.xbm
deleted file mode 100644
index 8f77224..0000000
Binary files a/Src/.xvpics/wmWeather_mask.xbm and /dev/null differ
diff --git a/Src/.xvpics/wmWeather_master.gif b/Src/.xvpics/wmWeather_master.gif
deleted file mode 100644
index d9fb18b..0000000
Binary files a/Src/.xvpics/wmWeather_master.gif and /dev/null differ
diff --git a/Src/.xvpics/wmWeather_master.xpm b/Src/.xvpics/wmWeather_master.xpm
deleted file mode 100644
index ad53dd7..0000000
Binary files a/Src/.xvpics/wmWeather_master.xpm and /dev/null differ
diff --git a/Src/weather.pl b/Src/weather.pl
index 6849279..27a4f88 100755
--- a/Src/weather.pl
+++ b/Src/weather.pl
@@ -2,8 +2,8 @@
#Thibaut Colar: http://www.colar.net/
#2002/05
-#The Weather data can be retrived through http of ftp.
-#Http is faster, however this might get broken if NOAA change theyr webpage layout
+#The Weather data can be retrieved through http of ftp.
+#Http is faster, however this might get broken if NOAA change their webpage layout
#in wich case you should choose ftp.
$mode="http"; # html || ftp
@@ -13,6 +13,8 @@ $mode="http"; # html || ftp
########################################
($station,$tmpfolder)=@ARGV;
+mkdir($tmpfolder);
+
$html="http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=${station}";
$ftp="ftp://weather.noaa.gov/data/observations/metar/stations/${station}.TXT";
$url=$html;
diff --git a/Src/wmFrog.c b/Src/wmFrog.c
index d89cced..e2d82af 100644
--- a/Src/wmFrog.c
+++ b/Src/wmFrog.c
@@ -3,7 +3,7 @@
This is a dockapp wich shows you the weather at a specific location
from it's METAR code.
If this program blew up your computer it isn't my fault :-)
- This slightly use some code from the wmWeather application.
+ This use a bit of code borrowed from the wmWeather application.
*/
@@ -15,9 +15,9 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
-#include <string.h>
#include <ctype.h>
#include <time.h>
+#include <pwd.h>
#include <X11/X.h>
#include <X11/xpm.h>
#include "xutils.h"
@@ -37,13 +37,13 @@
#define MAX_WIND 50
#define TIME_OFFSET 0
#define METRIC 0
-#define TMP "/tmp/"
void ParseCMDLine(int argc, char *argv[]);
void ButtonPressEvent(XButtonEvent *);
void KeyPressEvent(XKeyEvent *);
char *StringToUpper(char *);
char *mystrsep(char **stringp, char *delim);
+char *GetTempDir(char *suffix);
char StationID[10];
char Label[20];
@@ -53,12 +53,12 @@ int ForceUpdate = 1;
int ForceDownload = 1;
int maxWind=MAX_WIND;
int timeOffset=TIME_OFFSET;
-char tmp[256]=TMP;
long UpdateDelay;
int GotFirstClick1, GotDoubleClick1;
int GotFirstClick2, GotDoubleClick2;
int GotFirstClick3, GotDoubleClick3;
int DblClkDelay;
+char* folder;
/*
* main
@@ -93,7 +93,10 @@ FILE *fp;
int hour=0;
int dir=-1;
int q;
-
+
+ folder=GetTempDir(".wmapps");
+ //fprintf(stderr,"User dir: %s\n",folder);
+
/*
* Parse any command line arguments.
*/
@@ -210,7 +213,8 @@ FILE *fp;
dt2 = 0;
- sprintf(FileName, "/tmp/%s", StationID);
+ sprintf(FileName, "%s/%s", folder, StationID);
+ fprintf(stderr,"%s\n\n",FileName);
if ((fp = fopen(FileName, "r")) != NULL){
fscanf(fp, "Hour:%d", &hour);
fgets(Line, 512, fp);//h
@@ -567,7 +571,7 @@ UpToDate = 0;
/*
* Execute Perl script to grab the Latest METAR Report
*/
- sprintf(command, "/usr/lib/wmfrog/weather.pl %s %s &", StationID, tmp);
+ sprintf(command, "/usr/lib/wmfrog/weather.pl %s %s &", StationID, folder);
//printf("Retrieveing data\n");
system(command);
ForceDownload = 0;
@@ -639,7 +643,7 @@ void ParseCMDLine(int argc, char *argv[]) {
print_usage();
exit(-1);
}
- strcpy(tmp, argv[++i]);
+ strcpy(folder, argv[++i]);
} else if ((!strcmp(argv[i], "-station"))||(!strcmp(argv[i], "-s"))){
@@ -712,13 +716,14 @@ void ParseCMDLine(int argc, char *argv[]) {
printf("\t-w\t\t\t\tSet the maximum wind in KNOTS (for percentage of max / scaling.)\n");
printf("\t\t\t\t\tdefault is %d minutes). (Times are approximate.)\n\n", MAX_WIND);
printf("\t-o\t\t\t\tTime offset of location from UTC (7 for calif in summer) \n\n");
- printf("\t-tmp\t\t\t\tSet the temporary folder (default is: %s) \n\n",tmp);
+ printf("\t-tmp\t\t\t\tSet the temporary folder (default is: %s) \n\n",folder);
printf("\t-l\t\t\t\tSet a label to replace the station ID \n\n");
printf("\n\nTo find out more about the METAR/TAF system, look at:\n");
printf(" http://www.nws.noaa.gov/oso/oso1/oso12/metar.htm \n\n");
printf("To find your city Metar code go to NOAA's ""Meteorological Station Information\nLookup"" page at:\n\n");
printf(" http://www.nws.noaa.gov/oso/siteloc.shtml\n\n");
+ printf("\n Thibaut Colar http://www.colar.net/wmapps/\n\n");
}
@@ -835,6 +840,18 @@ void KeyPressEvent(XKeyEvent *xev){
}
+char *GetTempDir(char *suffix)
+{
+ uid_t id;
+ struct passwd *userEntry;
+ char * userHome;
+
+ id=getuid();
+ userEntry=getpwuid(id);
+ userHome=userEntry->pw_dir;
+ sprintf(userHome,"%s/%s",userHome,suffix);
+ return userHome;
+}
char *StringToUpper(char *String) {
@@ -867,7 +884,3 @@ char *mystrsep(char **stringp, char *delim)
}
-
-
-
-
diff --git a/Src/wmfrog.1 b/Src/wmfrog.1
deleted file mode 100644
index 36dc740..0000000
--- a/Src/wmfrog.1
+++ /dev/null
@@ -1,45 +0,0 @@
-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.33.
-.TH WMFROG "1" "October 2003" "wmfrog " "User Commands"
-.SH NAME
-wmfrog \- wmfrog
-.SH SYNOPSIS
-wmrog \fB\-s\fR <StationID> [-h] [-w <max wind>] [-t <time offset>] [-tmp <temp folder>] [-l <label>] [-m] [-delay <Time in Minutes>]
-.SH DESCRIPTION
-\fB\-station\fR \fB\-s\fR <METAR StationID>
-.IP
-The 4-character METAR Station ID.
-.HP
-\fB\-metric\fR \fB\-m\fR
-.IP
-Display Temperature in metric unit: (Celcius)
-.TP
-\fB\-delay\fR <Time in Minutes>
-.IP
-Override time (in minutes) between updates default is 15 minutes.
-.TP
-\fB\-w\fR <KNOTS>
-.IP
-Set the maximum wind in KNOTS (for percentage of max / scaling.) default is 50 Knots).
-.TP
-\fB\-o\fR <OFFSET>
-.IP
-Time offset of location from GMT (-8 for california, -1 for France etc...)
-.TP
-\fB\-tmp\fR <PATH>
-.IP
-Set the temporary folder where the data files are downloaded (default is: /tmp/)
-.TP
-\fB\-l\fR <LABEL>
-.IP
-Set a label (4 characters max) to replace the station ID (ie: 'NYORK' instead of KJFK)
-.PP
-To find out more about the METAR/TAF system, see:
-.IP
-http://www.nws.noaa.gov/oso/oso1/oso12/metar.htm
-.PP
-To find your city Metar code go to NOAA's Meteorological Station Information Lookup page at:
-.IP
-http://www.nws.noaa.gov/oso/siteloc.shtml
-.SH AUTHOR
-This application was (poorly) written by tcolar <tcolar at qarbon.com>. This manpage was created by Marc Brockschmidt <marc at dch-faq.de> for the Debian GNU/Linux distribution.
-
diff --git a/wmfrog-0.1.6.ebuild b/wmfrog-0.1.6.ebuild
deleted file mode 100644
index e6a5035..0000000
--- a/wmfrog-0.1.6.ebuild
+++ /dev/null
@@ -1,23 +0,0 @@
-# $Header: /home/cvsroot/gentoo-x86/x11-plugins/wmfrog/wmfrog-0.1.6.ebuild
-
-DESCRIPTION="Dockable graphical weather application for Windowmaker/Fluxbox, etc ..."
-SRC_URI="http://www.colar.net/wmapps/${P}.tgz"
-HOMEPAGE="http://www.colar.net/wmapps/"
-
-DEPEND="virtual/x11
- dev-lang/perl"
-
-SLOT="0"
-LICENSE="GPL-2"
-KEYWORDS="x86 sparc amd64"
-
-src_compile() {
- cd ${S}/Src
- emake || die
-}
-
-src_install () {
- dodoc CHANGES COPYING README
- cd ${S}/Src
- make DESTDIR=${D} install || die
-}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmfrog.git
More information about the Pkg-wmaker-commits
mailing list