initial commit of file from CVS for smeserver-tftp-server on Sat Sep 7 21:08:06 AEST 2024

This commit is contained in:
Trevor Batley 2024-09-07 21:08:06 +10:00
parent 2e9f176f5e
commit dd2326f8b1
27 changed files with 522 additions and 2 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.rpm
*.log
*spec-20*
*.tar.gz

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
# Makefile for source rpm: smeserver-tftp-server
# $Id: Makefile,v 1.1 2020/10/29 18:46:41 brianr Exp $
NAME := smeserver-tftp-server
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View File

@ -1,3 +1,15 @@
# smeserver-tftp-server # <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> smeserver-tftp-server
SMEServer Koozali developed git repo for smeserver-tftp-server smecontribs SMEServer Koozali developed git repo for smeserver-tftp-server smecontribs
## Wiki
<br />https://wiki.koozali.org/
## Bugzilla
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-tftp-server&product=SME%20Contribs&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
## Description
<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
*Once it has been checked, then this comment will be deleted*
<br />

1
contriborbase Normal file
View File

@ -0,0 +1 @@
contribs10

39
createlinks Executable file
View File

@ -0,0 +1,39 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
use esmith::Build::Backup qw(:all);
use File::Basename;
use File::Path;
# our event specific for updating with yum without reboot
$event = 'smeserver-tftp-server-update';
#add here the path to your templates needed to expand
#see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event
foreach my $file (qw(
/etc/systemd/system-preset/49-koozali.preset
/etc/hosts.allow
/usr/lib/systemd/system/tftp.service.d/50koozali.conf
/usr/lib/systemd/system/tftp.socket.d/50koozali.conf
))
{
templates2events( $file, $event );
}
#action needed in case we have a systemd unit
event_link('systemd-default', $event, '10');
event_link('systemd-reload', $event, '50');
#action specific to this package
#event_link('action', $event, '30');
#services we need to restart
safe_symlink('restart',"root/etc/e-smith/events/$event/services2adjust/tftp");
#and Server Manager panel link
#panel_link('somefunction', 'manager');
#safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/tftpd");
#safe_symlink("restart", "root/etc/e-smith/events/tftpd-conf/services2adjust/tftpd");
#safe_symlink("/var/service/tftpd", "root/service/tftpd");
#service_link_enhanced("tftpd", "S85", "7");
#service_link_enhanced("tftpd", "K25", "0");
# templates2events("/etc/hosts.allow", qw(tftpd-conf));
# add tftp root directory (/tftpboot) to backups
backup_includes("smeserver-tftp-server", qw(/tftpboot));

View File

@ -0,0 +1 @@
69

View File

@ -0,0 +1 @@
private

View File

@ -0,0 +1 @@
/tftpboot

View File

@ -0,0 +1 @@
normal

View File

@ -0,0 +1 @@
ro

View File

@ -0,0 +1 @@
disabled

View File

@ -0,0 +1 @@
default

View File

@ -0,0 +1 @@
service

View File

@ -0,0 +1 @@
nobody

View File

@ -0,0 +1,7 @@
{
my $tftpd = $DB->get('tftpd') or return;
if ( $tftpd->prop('privilege') eq "r" )
{
$tftpd->set_prop('privilege' => "ro");
}
}

View File

@ -0,0 +1,7 @@
{
my $tftpd = $DB->get('tftpd') or return;
if ( $tftpd->prop('timeout') eq "normal" )
{
$tftpd->set_prop('timeout' => "default");
}
}

View File

@ -0,0 +1,7 @@
{
my $tftpd = $DB->get('tftpd') or return;
if ( $tftpd->prop('user') eq "root" )
{
$tftpd->set_prop('user' => "nobody");
}
}

View File

@ -0,0 +1,10 @@
{
my $tftpd = $DB->get("tftpd") or return;
my $tftp = $DB->get("tftp") ||
$DB->new_record("tftp", { type => "service" });
$tftp->merge_props($tftpd->props);
$tftpd->delete;
}

View File

@ -0,0 +1,3 @@
{
$DB->hosts_allow_spec('tftp', 'in.tftpd');
}

View File

@ -0,0 +1,7 @@
[Unit]
Description=Tftp Server
Requires=tftp.socket
Documentation=man:in.tftpd
After=network-online.target
Wants=network-online.target

View File

@ -0,0 +1,50 @@
{
my $blocksize = $tftp{blocksize} || "1468";
my $verbosity = "-v";
my $log = $tftp{log};
my $refuse = $tftp{refuse};
my $privilege = $tftp{privilege} || "";
my $user = $tftp{user} || "";
# Now only relevant if you run under xinetd
my $timeout = $tftp{timeout} || "";
if ( $log eq "verbose" ) {
$verbosity = "-vv";
}
elsif ( $log eq "disabled" ) {
$verbosity = "";
}
if ( $refuse ne "" ) {
$refuse = "-r $refuse";
}
if ( $blocksize <= "512" ) {
$blocksize = "512";
}
elsif ( $blocksize >= "65464" ) {
$blocksize = "65464";
}
if ( $privilege eq "rw" ) {
$privilege = "-c";
} elsif ($privilege = "ro" ) {
$privilege = "";
}
if ( $user ne "" ) {
$user = "-u $user";
}
$OUT .= "\n";
$OUT .= "[Service]\n";
$OUT .= "# Options: man in.tftpd\n";
$OUT .= "# ExecStartPre=/bin/sleep 10\n";
$OUT .= " \n";
$OUT .= "ExecStart=\n";
$OUT .= "ExecStart=/usr/sbin/in.tftpd -s /tftpboot $verbosity -B $blocksize $user $refuse $privilege\n";
$OUT .= " \n";
$OUT .= "StandardInput=socket\n";
}

View File

@ -0,0 +1,4 @@
[Install]
WantedBy=sme-server.target
Also=tftp.socket

View File

@ -0,0 +1,21 @@
{
my $interfaceIP = "127.0.0.1";
my $localIP = ${LocalIP};
my $port = $tftp{UDPPort};
my $access = $tftp{access};
if ( $access eq "public" ) {
$interfaceIP = "0.0.0.0";
}
elsif ( $access eq "private" ) {
$interfaceIP = $localIP;
}
$OUT .= "[Socket]\n";
$OUT .= "ListenDatagram=\n";
$OUT .= "ListenDatagram=$interfaceIP:$port\n";
$OUT .= "FreeBind=True\n";
}

0
root/tftpboot/.gitignore vendored Normal file
View File

View File

@ -0,0 +1,21 @@
[Unit]
Description=Tftp Server
Requires=tftp.socket
Documentation=man:in.tftpd
After=network-online.target
Wants=network-online.target
[Service]
Options: man in.tftpd
#ExecStartPre=/bin/sleep 10
ExecStart=
ExecStart=/usr/sbin/in.tftpd -s /tftpboot -v -B 1464 -u nobody
StandardInput=socket
[Install]
WantedBy= sme-server.target
Also=tftp.socket

View File

@ -0,0 +1,4 @@
[Socket]
ListenDatagram=
ListenDatagram=127.0.0.1:69
FreeBin=true

293
smeserver-tftp-server.spec Normal file
View File

@ -0,0 +1,293 @@
# $Id: smeserver-tftp-server.spec,v 1.9 2024/03/22 04:55:33 trevorb Exp $
# Authority: nocvs
# Name: Trevor Batley
%define name smeserver-tftp-server
%define version 1.2
%define release 14
Summary: Wrapper for tftp-server for the Trivial File Transfer Protocol (TFTP).
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
License: GPL
Group: Network
Source: %{name}-%{version}.tar.xz
Requires: smeserver-release >= 10.0
Requires: tftp-server >= 5.0
BuildRequires: e-smith-devtools >= 1.13.1-03
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildArch: noarch
%description
smeserver wrapper for tftp-server
The Trivial File Transfer Protocol (TFTP) is normally used only for
booting diskless workstations. The tftp package provides the user
interface for TFTP, which allows users to transfer files to and from a
remote machine. This program and TFTP provide very little security,
and should not be enabled unless it is expressly needed.
%prep
%setup -q -n %{name}-%{version}
%build
perl createlinks
%install
/bin/rm -rf $RPM_BUILD_ROOT
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
/bin/rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist
%post
#systemctl enable tftp
#systemctl start tftp
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%changelog
* Sat Sep 07 2024 cvs2git.sh aka Brian Read <brianr@koozali.org> 1.2-14.sme
- Roll up patches and move to git repo [SME: 12338]
* Sat Sep 07 2024 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday.
* Fri Mar 22 2024 Trevor Batley <trevor@batley.id.au> 1.2-13.sme
- Remove superfluous Provides: ipsvd [SME: 12517]
* Mon Jun 27 2022 Trevor Batley <trevor@batley.id.au> 1.2-12.sme
- Add tftp root directory (/tftpboot) to backups [SME: 12025]
* Thu Apr 14 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 1.2-11.sme
- Fix missing systemd directories [SME: 11927]
- Add default 50koozali.conf files
* Mon Apr 11 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 1.2-10.sme
- Update systemd unit files [SME: 11927]
- Migrate db from tftpd to tftp [SME: 11928]
* Wed Nov 10 2021 Brian Read <brianr@bjsystems.co.uk> 1.2-9.sme
- Expand-hosts-allow-in-update-event [SME: 11074 ]
* Tue Nov 09 2021 Brian Read <brianr@bjsystems.co.uk> 1.2-8.sme
- Add -update event and systemd files [SME: 11074]
* Thu Oct 29 2020 Brian Read <brianr@bjsystems.co.uk> 1.2-7.sme
- Initial import to SME10 tree [SME: 11074]
* Mon Nov 12 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 1.2-6
- Add a blksize check [SME:10646]
* Thu Mar 29 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 1.2-5
- fix refuse setting when no key is set [10549]
- add blksize option
* Thu Mar 31 2016 Trevor Batley <trevorbatley@users.sourceforge.net> 1.2-4
- added whitespace before line in /etc/hosts.allow fragment [9417]
* Sun Mar 20 2016 Trevor Batley <trevorbatley@users.sourceforge.net> 1.2-3
- Added migrate fragments for the fixed default values in 9043 [SME 9351]
- Added -r (--refuse) option [SME 9248]
- Fixed -u option on updsvd (missing space after -u) [SME 9316]
- Added disabled option on logging [SME 9317]
* Thu Mar 10 2016 Trevor Batley <trevorbatley@users.sourceforge.net> 1.2-2
- Fixed default values [SME 9043]
* Fri Sep 04 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 1.2-1.sme
- Initial release to contribs9
* Sun Apr 29 2007 Shad L. Lords <slords@mail.com>
- Clean up spec so package can be built by koji/plague
* Sat Apr 28 2007 Trevor Batley <trevorbatley@users.sourceforge.net> 1.0-1
- Fixed incorrect createlinks for /etc/rc.d/init.d/supervise/tftpd to daemontools
- Removed symlink from /service/tftpd to /var/service/tftpd and used createlinks instead
- Changed %preun from config to /sbin/e-smith/db config and /etc/init.d to /etc/rc.d/init.d
- Removed %BuildPreReq as this applied when it included tftp-server
- Added %BuildArch: noarch as this wrapper does NOT require any specific architecture
* Wed Apr 25 2007 Trevor Batley <trevorbatley@users.sourceforge.net> 1.0-1
- Updated Release tag to new smeserver standard
- Changed contrib to just contain the wrapper code and require tftp-server from centos
- As it's a wrapper, changed verion number to it's own (rather that that of tftp-server)
* Sun Dec 17 2006 Charlie Brady <charlieb@e-smith.com>
- Replace deprecated Copyright header with License.
* Tue Apr 4 2006 Trevor Batley <trevorbatley@users.sourceforge.net>
- Set tftpd to disabled and stop as part of pre-uninstall script
- Set default user to root
* Mon Mar 20 2006 Trevor Batley <trevorbatley@users.sourceforge.net>
- Repackage for smeserver v7.x
- Based on repackaging already done by Daniel Warnet <daniel@tw.co.nz>
* Mon Sep 13 2004 Elliot Lee <sopwith@redhat.com> 0.39-1
- Update to new version makes tftp work, says upstream.
- Remove malta patch
* Mon Sep 13 2004 Elliot Lee <sopwith@redhat.com> 0.38-1
- Update to new version fixes #131736
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Thu Jun 03 2004 Elliot Lee <sopwith@redhat.com> 0.36-1
- Update version
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Fri Apr 11 2003 Elliot Lee <sopwith@redhat.com>
- 0.33
- Add /tftpboot directory (#88204)
* Mon Feb 24 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Sun Feb 23 2003 Tim Powers <timp@redhat.com>
- add BuildPreReq on tcp_wrappers
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt
* Mon Nov 11 2002 Elliot Lee <sopwith@redhat.com> 0.32-1
- Update to 0.32
* Wed Oct 23 2002 Elliot Lee <sopwith@redhat.com> 0.30-1
- Fix #55789
- Update to 0.30
* Thu Jun 27 2002 Elliot Lee <sopwith@redhat.com>
- Try applying HJ's patch from #65476
* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Mon Jun 17 2002 Elliot Lee <sopwith@redhat.com>
- Update to 0.29
* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Tue Dec 18 2001 Elliot Lee <sopwith@redhat.com> 0.17-15
- Update to tftp-hpa-0.28 (bug #56131)
- Remove include/arpa/tftp.h to fix #57259
- Add resource limits in tftp-xinetd (#56722)
* Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
- Bump release + rebuild.
* Tue Jun 12 2001 Helge Deller <hdeller@redhat.de> (0.17-13)
- updated tftp-hpa source to tftp-hpa-0.17
- tweaked specfile with different defines for tftp-netkit and tftp-hpa version
- use hpa's tftpd.8 man page instead of the netkits one
* Mon May 07 2001 Helge Deller <hdeller@redhat.de>
- rebuilt in 7.1.x
* Wed Apr 18 2001 Helge Deller <hdeller@redhat.de>
- fix tftp client's put problems (#29529)
- update to tftp-hpa-0.16
* Wed Apr 4 2001 Jakub Jelinek <jakub@redhat.com>
- don't let configure to guess compiler, it can pick up egcs
* Thu Feb 08 2001 Helge Deller <hdeller@redhat.de>
- changed "wait" in xinetd file to "yes" (hpa-tftpd forks and exits) (#26467)
- fixed hpa-tftpd to handle files greater than 32MB (#23725)
- added "-l" flag to hpa-tftpd for file-logging (#26467)
- added description for "-l" to the man-page
* Thu Feb 08 2001 Helge Deller <hdeller@redhat.de>
- updated tftp client to 0.17 stable (#19640),
- drop dependency on xinetd for tftp client (#25051),
* Wed Jan 17 2001 Jeff Johnson <jbj@redhat.com>
- xinetd shouldn't wait on tftp (which forks) (#23923).
* Sat Jan 6 2001 Jeff Johnson <jbj@redhat.com>
- fix to permit tftp put's (#18128).
- startup as root with chroot to /tftpboot with early reversion to nobody
is preferable to starting as nobody w/o ability to chroot.
- %%post is needed by server, not client. Add %%postun for erasure as well.
* Wed Aug 23 2000 Nalin Dahyabhai <nalin@redhat.com>
- default to being disabled
* Thu Aug 17 2000 Jeff Johnson <jbj@redhat.com>
- correct group.
* Tue Jul 25 2000 Nalin Dahyabhai <nalin@redhat.com>
- change user from root to nobody
* Sat Jul 22 2000 Jeff Johnson <jbj@redhat.com>
- update to tftp-hpa-0.14 (#14003).
- add server_args (#14003).
- remove -D_BSD_SOURCE (#14003).
* Fri Jul 21 2000 Nalin Dahyabhai <nalin@redhat.com>
- cook up an xinetd config file for tftpd
* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild
* Sun Jun 18 2000 Jeff Johnson <jbj@redhat.com>
- FHS packaging.
- update to 0.17.
* Fri May 5 2000 Matt Wilson <msw@redhat.com>
- use _BSD_SOURCE for hpa's tftpd so we get BSD signal semantics.
* Fri Feb 11 2000 Bill Nottingham <notting@redhat.com>
- fix description
* Wed Feb 9 2000 Jeff Johnson <jbj@redhat.com>
- compress man pages (again).
* Wed Feb 02 2000 Cristian Gafton <gafton@redhat.com>
- man pages are compressed
- fix description and summary
* Tue Jan 4 2000 Bill Nottingham <notting@redhat.com>
- split client and server
* Tue Dec 21 1999 Jeff Johnson <jbj@redhat.com>
- update to 0.16.
* Sat Aug 28 1999 Jeff Johnson <jbj@redhat.com>
- update to 0.15.
* Wed Apr 7 1999 Jeff Johnson <jbj@redhat.com>
- tftpd should truncate file when overwriting (#412)
* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
- auto rebuild in the new build environment (release 22)
* Mon Mar 15 1999 Jeff Johnson <jbj@redhat.com>
- compile for 6.0.
* Fri Aug 7 1998 Jeff Johnson <jbj@redhat.com>
- build root
* Mon Apr 27 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr
* Mon Sep 22 1997 Erik Troan <ewt@redhat.com>
- added check for getpwnam() failure
* Tue Jul 15 1997 Erik Troan <ewt@redhat.com>
- initial build