debian/0000755000000000000000000000000011767745006007203 5ustar debian/changelog0000644000000000000000000001654211767745006011065 0ustar sysnews (0.9-17) unstable; urgency=low * Update my email address * Move to a new git repository at collab-maint * Add README to package, thanks to Willi Mannfor the bug report (Closes: #631104) * Use debian source format 3.0 quilt - Remove quilt dependency as it is handled by dpkg * Add new build-{arch,indep} targets to debian/rules * Use dpkg-buildflags for hardening * Update Standards-Version to 3.9.3 -- Ryan Niebur Mon, 18 Jun 2012 17:38:30 -0700 sysnews (0.9-16) unstable; urgency=low * New maintainer (Closes: #483250) - Change Vcs-* headers * use quilt * switch to dh7 * split up patches - upstream's Makefile already regenerates the man page with the NEWSDIR set correctly, so just use the regenerated version rather than patching - stop patching the Makefile when the changes can happen in debian/rules - organize the remaining changes * fix permissions on executable * stop supporting upgrades from potato :p * upgrade to latest policy (3.8.0) - add README.source * leave the debian/dirs, as it is actually needed * redo copyright file to be more clear * remove unneeded build dependency on dpkg-dev * add lintian override for non-standard-dir-perm * remove the default WELCOME. There was no easy way to make it comply with Debian Policy, and imho it's kinda useless, since most people probably remove/change it anyway. -- Ryan Niebur Tue, 24 Feb 2009 17:08:35 -0800 sysnews (0.9-15) unstable; urgency=low * Orphaned the package. -- Joey Hess Tue, 27 May 2008 18:49:13 -0400 sysnews (0.9-14) unstable; urgency=low * Support nostrip builds. Closes: #438082 -- Joey Hess Wed, 15 Aug 2007 13:35:43 -0400 sysnews (0.9-13) unstable; urgency=low * Update to current standards version. -- Joey Hess Sat, 23 Jul 2005 19:44:15 -0400 sysnews (0.9-12) unstable; urgency=low * Ignore directories in /var/lib/sysnews to allow for keeping it in cvs/rcs. Closes: #182135 -- Joey Hess Sun, 23 Feb 2003 19:10:20 -0500 sysnews (0.9-11) unstable; urgency=low * Use /usr/bin/pager as fallback pager, not /usr/bin/more. -- Joey Hess Tue, 3 Sep 2002 13:46:30 -0400 sysnews (0.9-10) unstable; urgency=low * Detect old potato version of WELCOME file and clobber it with the new version. Closes: #159054 -- Joey Hess Tue, 3 Sep 2002 13:42:11 -0400 sysnews (0.9-9) unstable; urgency=low * Debhelper v4. * Support DEB_BUILD_OPTIONS -- Joey Hess Sat, 1 Jun 2002 19:18:22 -0400 sysnews (0.9-8) unstable; urgency=low * Move the news directory from /var/news to /var/lib/sysnews, for better FHS compliance (sadly, /var/lib/news was taken already). Updated everything to reference the new location, and any directory contents are transferred automatically on upgrade, and the old directory removed. * Remove any news items on purge. I hope this is not going too far. * Make /var/lib/news owned by root.staff, and group writable, this is intended to let other non-root staff to post news, and closly parrallels the permissions used in /usr/local/. * Changed references to "Debian Linux" to just "Debian" in WELCOME, so I don't have to add the "GNU", and because of the Hurd, of course. Also changed the quotes, and shortened the section about info. It's still longer than 25 lines; I still need to cut it down somehow. -- Joey Hess Fri, 7 Dec 2001 01:04:10 -0500 sysnews (0.9-7) unstable; urgency=low * Whoops; the cron job was accidentually renamed from cron.daily/news to cron.daily/sysnewsnews, leaving the old file around. I'm not going to move it back, but the preinst now renames the old file to sysnews.dpkg-old if it exists, so normal dpkg conffile handling takes over. Closes: #83389 * Made the cron job notice if he package is not installed and terminate sanely. -- Joey Hess Wed, 24 Jan 2001 13:51:04 -0800 sysnews (0.9-6) unstable; urgency=low * Yes, optional is the right priority. -- Joey Hess Fri, 19 Jan 2001 15:57:32 -0800 sysnews (0.9-5) unstable; urgency=low * New maintainer, Closes: #82450 * Added build depends. * Use debhelper. * A few other minor changes. * Retry with non-broken dpkg-dev. -- Joey Hess Wed, 17 Jan 2001 12:05:00 -0800 sysnews (0.9-4) unstable; urgency=low * news.c: ignore files with names ending ~ (#35244) -- Mark Baker Wed, 7 Jul 1999 01:20:29 +0100 sysnews (0.9-3) unstable; urgency=low * debian/rules: clean rule deletes debian/files (#25206) and *~ -- Mark Baker Mon, 5 Jul 1999 22:58:13 +0100 sysnews (0.9-2) unstable; urgency=low * Updated standards-version to 2.4.0.0 (no changes) -- Mark Baker Wed, 11 Feb 1997 21:27:12 +0000 sysnews (0.9-1) unstable; urgency=low * New upstream version * Signifcantly tidied up rules file -- Mark Baker Mon, 27 Oct 1997 22:59:55 +0000 sysnews (0.8-9) unstable; urgency=low * Do a dpkg-shlibdeps, instead of having hard coded values (#12494) -- Mark Baker Sat, 06 Sep 1997 22:59:59 +0100 sysnews (0.8-8) unstable; urgency=low * Really a new maintainer (I didn't change the control file before) -- Mark Baker Sun, 13 Jul 1997 21:53:37 +0100 sysnews (0.8-7) unstable; urgency=low * New maintainer * Compiled with libc6 -- Mark Baker Fri, 11 Jul 1997 20:47:01 +0100 sysnews (0.8-6) unstable; urgency=low * Changed maintainer address to . * Recompiled against latest libraries in preparation for Debian 1.3 -- Dominik Kubla Sat, 1 Mar 1997 20:55:05 +0100 sysnews (0.8-5) unstable; urgency=low * Reupload because one file was corrupted in the previous version. Bumped version number to keep the install script on master happy. -- Dominik Kubla Sat, 9 Nov 1996 17:17:26 +0100 sysnews (0.8-4) unstable; urgency=low * Fixed bug: using of uninitialized malloc'ed memory. Thanks to Marek Michalkiewicz for reporting it and providing an initial fix. * Some code cleanups. -- Dominik Kubla Thu, 31 Oct 1996 20:19:05 +0100 sysnews (0.8-3) unstable; urgency=low * manual pages are now installed in 'gzip -9' format as per "Debian Policy Manual", Section 3.2.1 * minor bugfixes in debian/rules file. Should now comply with "Debian Programmers Manual", Section 3.2.1 -- Dominik Kubla Mon, 30 Sep 1996 19:06:22 +0200 sysnews (0.8-3) unstable; urgency=low * Added "Replaces: news" to control file * copyright file is now installed in /usr/doc/sysnews as per "Debian Policy Manual", section 3.2.5 * changelog file is now installedin /usr/doc/sysnews as per "Debian Policy Manual", section 3.2.6 * package is now build with CFLAGS set to '-O2 -g -Wall' as per "Debian Policy Manual", section 4.1 -- Dominik Kubla Sun, 29 Sep 1996 17:00:52 +0200 sysnews (0.8-2) unstable; urgency=low * Converted to new packaing standards. * Added "Conflicts: news" to control file. -- Dominik Kubla Thu, 12 Sep 1996 09:44:45 +0200 debian/dirs0000644000000000000000000000003011767743130010054 0ustar var/lib/sysnews usr/bin debian/cron.daily0000644000000000000000000000053211767743120011163 0ustar #!/bin/sh -e # CRON script to purge files in /var/lib/sysnews after 30 days. # Exclude files named WELCOME/POLICY/NEWUSERS, since they are intended to # stay for new users. The files POLICY/NEWUSERS are not supplied by the # Debian package because they are site-specific. if [ -x /usr/bin/news ]; then news -e 30 -x WELCOME,POLICY,NEWUSERS fi debian/control0000644000000000000000000000136311767744212010607 0ustar Source: sysnews Section: admin Priority: optional Build-Depends: debhelper (>= 7) Maintainer: Ryan Niebur Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/git/collab-maint/sysnews.git Vcs-Browser: http://git.debian.org/?p=collab-maint/sysnews.git;a=summary Package: sysnews Architecture: any Conflicts: news Replaces: news Depends: ${shlibs:Depends}, ${misc:Depends} Description: program to display system news The news command keeps you informed of news concerning the system. Each news item is contained in a separate file in the /var/lib/sysnews directory. Anyone having write permission to this directory can create a news file. . NOTE: This command has nothing to do with USENET news. It's more like an enhanced motd. debian/sysnews.lintian-overrides0000644000000000000000000000003711767743130014272 0ustar sysnews: non-standard-dir-perm debian/patches/0000755000000000000000000000000011767743130010626 5ustar debian/patches/header-changes0000644000000000000000000000233311767743130013410 0ustar changes to the comments at the beginning --- a/news.c +++ b/news.c @@ -1,13 +1,20 @@ -/* news.c - display system news +/* news.c - display system news + * Copyright (C) 1993-6 Charles (int@link.xs4all.nl) + * Copyright (C) 1996 Dominik Kubla, * - * (C) 1993-96 Charles (int@link.xs4all.nl) + * This program 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; either version 2 of the License, or + * (at your option) any later version. * - * GPL - */ - -/* $Source: /project/master/sysnews/news.c,v $ - * $Revision: 1.12 $ - * $Date: 1997/01/10 17:09:19 $ + * This program 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 program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ static char rcsid[] = "$Id: news.c,v 1.12 1997/01/10 17:09:19 int Exp $"; debian/patches/define-defaults0000644000000000000000000000077311767743130013617 0ustar define default values, if they aren't already defined --- a/news.h +++ b/news.h @@ -10,7 +10,17 @@ * $Date: 1995/07/06 08:40:45 $ */ -#define DEF_PAGER "more" +#define VERSION "0.9" + +#ifndef NEWSDIR + #define NEWSDIR "/var/lib/sysnews" +#endif +#ifndef NEWSTIME + #define NEWSTIME ".news_time" +#endif +#ifndef DEF_PAGER + #define DEF_PAGER "pager" +#endif #define NOEXPFILE ".noexpire" #define DATEFORMAT "(%b %d %Y)" #define ERRMSG strerror(errno) debian/patches/minor-cleanup0000644000000000000000000001173611767743130013332 0ustar minor coding style/properness changes (checking return value, using EXIT_SUCCESS variables, etc) --- a/news.c +++ b/news.c @@ -17,31 +17,34 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef lint static char rcsid[] = "$Id: news.c,v 1.12 1997/01/10 17:09:19 int Exp $"; +#endif +#include +#include +#include +#include +#include +#include #include #include -#include -#include #include -#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include +#include #include "getopt.h" #include "news.h" char *progname; -char *newsdir = NEWSDIR; -char *dformat = DATEFORMAT; +const char *newsdir = NEWSDIR; +const char *dformat = DATEFORMAT; char **exclude_list = 0; int nr_exclude = 0; @@ -67,7 +70,7 @@ /* * MAIN */ -void main(int argc, char **argv) +int main(int argc, char **argv) { int ac = 0, n, i; char *av[32], **nav, *env; @@ -95,7 +98,7 @@ else read_sysnews(argc, argv); - exit(0); + exit(EXIT_SUCCESS); } @@ -168,13 +171,13 @@ break; case 'V': printf("news version %s\n", VERSION); - exit(0); + exit(EXIT_SUCCESS); case 'h': /* hm. what could this be? */ print_usage(); - exit(0); + exit(EXIT_SUCCESS); default: fprintf(stderr, "Type `%s --help' for more information.\n", progname); - exit(1); + exit(EXIT_FAILURE); break; } @@ -192,14 +195,17 @@ char tmp[512]; char *newsnames; int art_cnt = 0, avc; - int cols = 80; + unsigned short cols = 80; int ret; + /* Clearout temporary data space. */ + (void) memset(tmp, 0, 512); + home = getenv("HOME"); if(!home) { fprintf(stderr, "%s: error: you are homeless!\n", progname); - exit(1); + exit(EXIT_FAILURE); } sprintf(line, "%s/%s", home, NEWSTIME); @@ -207,7 +213,7 @@ if(ret < 0) { if(errno != ENOENT) - exit(1); + exit(EXIT_FAILURE); if(!f.all && !f.items && !f.names && !argv[optind]) { ret = creat(line, 0600); @@ -226,8 +232,14 @@ cols = win.ws_col; } #endif - newsnames = malloc(cols); - newsnames[0] = 0; + errno = 0; + newsnames = malloc((size_t)cols); + if (newsnames == NULL) + { + perror("news: "); + exit(EXIT_FAILURE); + } + memset(newsnames, 0, cols); if(!f.all && !f.items && !f.names && !argv[optind]) @@ -243,7 +255,7 @@ if(!dfp) { fprintf(stderr, "%s: opendir(%s): %s\n", progname, newsdir, ERRMSG); - exit(1); + exit(EXIT_FAILURE); } @@ -281,7 +293,7 @@ { pfp = open_pager(); if(!pfp) - exit(1); + exit(EXIT_FAILURE); } pw = getpwuid(st.st_uid); @@ -379,7 +391,7 @@ FILE *open_pager() { FILE *pfp; - char *pager; + const char *pager; if(!(pager = f.pager) && !(pager = getenv("PAGER"))) pager = DEF_PAGER; @@ -426,7 +438,7 @@ if(!dfp) { fprintf(stderr, "Error opening newsdir (%s): %s\n", newsdir, ERRMSG); - exit(1); + exit(EXIT_FAILURE); } chdir(newsdir); @@ -447,9 +459,12 @@ for(i = 0; i < nr_exclude; i++) if(!strcmp(exclude_list[i], dir->d_name)) - continue; + break; + if(id_name, &st); + if(stat(dir->d_name, &st)) + continue; if(st.st_mtime < exp_t) { ret = unlink(dir->d_name); @@ -507,11 +522,16 @@ lineidx = 0; st = 0; + errno = 0; if(!nr_exclude) exclude_list = (char **)malloc(sizeof(char *)); else exclude_list = (char **)realloc(exclude_list, sizeof(char *) * (nr_exclude + 1)); + if (exclude_list == NULL) { + perror("news: "); + exit(EXIT_FAILURE); + } exclude_list[nr_exclude++] = strdup(line); } if(!*str) @@ -523,7 +543,7 @@ if(lineidx >= NAME_MAX) { fprintf(stderr, "add_exclude: filename too long (%d)\n", lineidx); - exit(1); + exit(EXIT_FAILURE); } break; } --- a/news.h +++ b/news.h @@ -32,13 +32,13 @@ struct { - int all:1; - int items:1; - int names:1; - int page:1; - int oneperline:1; - int datestamp:1; - int verbose:1; + int all; + int items; + int names; + int page; + int oneperline; + int datestamp; + int verbose; int expire; char *pager; } f; @@ -53,7 +53,7 @@ /* news.c */ -void main __PROTO((int argc , char **argv )); +int main __PROTO((int argc , char **argv )); int implode __PROTO((char *str , char *av [], int max )); void parse_args __PROTO((int argc , char **argv )); void read_sysnews __PROTO((int argc , char **argv )); debian/patches/ignore-dirs-and-temp-files0000644000000000000000000000117111767743130015576 0ustar ignore files ending in ~ and directories (so that cvs, rcs, etc work) --- a/news.c +++ b/news.c @@ -251,6 +251,8 @@ { if(dir->d_name[0] == '.') /* skip all names starting with '.' */ continue; + if(dir->d_name[ strlen(dir->d_name) - 1 ] == '~') + continue; /* skip all names ending with '~' */ if(argv[optind]) { avc = optind; @@ -269,6 +271,8 @@ fprintf(stderr, "%s: (%s) %s\n", progname, line, ERRMSG); continue; } + if (S_ISDIR(st.st_mode)) /* Ignore directories */ + continue; if(news_time < st.st_mtime || f.all || argv[optind]) { if(!f.names && !f.items) debian/patches/series0000644000000000000000000000014311767743130012041 0ustar define-defaults install-with-correct-perms header-changes ignore-dirs-and-temp-files minor-cleanup debian/patches/install-with-correct-perms0000644000000000000000000000073711767743130015762 0ustar install the binary with correct permissions, and don't bother installing the man page, dh_installman will handle that. --- a/Makefile +++ b/Makefile @@ -33,8 +33,8 @@ -e s,.news_time,$(NEWSTIME),g < news.man > news.1 install: all - install -o bin -g bin -m 555 news $(PREFIX)/bin - install -m 444 news.1 $(PREFIX)/man/man1 + install -o bin -g bin -m 755 news $(PREFIX)/bin +# install -m 444 news.1 $(PREFIX)/man/man1 release: tar -cvzf news-$(VERSION).tgz \ debian/rules0000755000000000000000000000173411767744360010272 0ustar #!/usr/bin/make -f NEWSDIR=/var/lib/sysnews CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: dh --before dh_auto_build build dh_auto_build -- NEWSDIR=$(NEWSDIR) LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS) $(CPPFLAGS)" dh --after dh_auto_build build touch $@ clean: dh $@ install: install-stamp install-stamp: build-stamp dh --before dh_auto_install install dh_auto_install -- PREFIX=debian/sysnews/usr NEWSDIR=$(NEWSDIR) dh --before dh_fixperms --after dh_auto_install install chown root.staff debian/sysnews/var/lib/sysnews chmod g+ws debian/sysnews/var/lib/sysnews dh --after dh_fixperms install touch $@ binary-indep: build install binary-arch: build install dh $@ binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install build-arch build-indep debian/README.Debian0000644000000000000000000000110111767743130011231 0ustar As described in the README, this program should be added to the shell rc files of users who want to see news (or added globally). This is not done automatically by this package; you should do it manually. This package installs a cron job that deletes news articles after 30 days. It never deletes files named WELCOME, POLICY, or NEWUSERS. Past users of this package should note that you should put news items in the shiny new, FHS-compliant directory, /var/lib/sysnews/, instead of the old directory, /var/news/. If you find this annoying, I suggest a symlink. -- Joey Hess debian/compat0000644000000000000000000000000211767743130010375 0ustar 7 debian/README.source0000644000000000000000000000017511767743130011361 0ustar This package uses quilt to manage changes to the upstream code. See /usr/share/doc/quilt/README.source for more information. debian/manpages0000644000000000000000000000000711767743130010712 0ustar news.1 debian/docs0000644000000000000000000000000611767743412010051 0ustar READMEdebian/source/0000755000000000000000000000000011767743520010502 5ustar debian/source/format0000644000000000000000000000001411767743520011710 0ustar 3.0 (quilt) debian/postrm0000644000000000000000000000023111767743130010442 0ustar #!/bin/sh set -e #DEBHELPER# # Remove news items and directory on purge. if [ "$1" = purge -a -d /var/lib/sysnews ]; then rm -rf /var/lib/sysnews fi debian/copyright0000644000000000000000000000255411767743130011140 0ustar sysnews was written by Charles, , and was downloaded from http://www.ibiblio.org/pub/Linux/system/admin/login/ debian packaging and modifications: Copyright (C) 1996 Dominik Kubla, Copyright (C) 1997-1999 Mark Baker Copyright (C) 2001-2008 Joey Hess Copyright (C) 2008-2009 Ryan Niebur The Debian modifications are released under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. sysnews: Copyright (C) 1993-6 Charles (int@link.xs4all.nl) This program 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; either version 2 of the License, or (at your option) any later version. getopt.c: Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. This program 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; either version 2, or (at your option) any later version. On Debian systems, you can find the full text of the GPL version 2 in '/usr/share/common-licenses/GPL-2' debian/watch0000644000000000000000000000011511767743120010224 0ustar version=2 http://www.ibiblio.org/pub/Linux/system/admin/login/ news-(.*).tgz