diff options
author | Branan Purvine-Riley <branan@puppetlabs.com> | 2012-08-20 11:14:32 -0700 |
---|---|---|
committer | Branan Purvine-Riley <branan@puppetlabs.com> | 2012-08-20 11:14:32 -0700 |
commit | ec311ad9f2f7117e11cb98f30b3a83fcbf4f160d (patch) | |
tree | 6e62e1f060f18203fbe58d4b2beef1ec297efa07 | |
parent | 7accc6e0d6d675baaf9a1d8ec0cae7f6ff7265d0 (diff) | |
parent | 5e4aa75d208e998f04da9fcc5210addebbad5e2e (diff) | |
download | puppet-tftp-ec311ad9f2f7117e11cb98f30b3a83fcbf4f160d.tar.gz puppet-tftp-ec311ad9f2f7117e11cb98f30b3a83fcbf4f160d.tar.bz2 |
Merge pull request #18 from nanliu/tb/xinetd
Fix xinetd user/group permission.
-rw-r--r-- | manifests/init.pp | 3 | ||||
-rw-r--r-- | spec/classes/tftp_spec.rb | 39 |
2 files changed, 18 insertions, 24 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 4fe22be..300824d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -58,9 +58,8 @@ class tftp ( xinetd::service { 'tftp': port => $port, protocol => 'udp', - server_args => "${options} ${directory}", + server_args => "${options} -u ${username} ${directory}", server => $binary, - user => $username, bind => $address, socket_type => 'dgram', cps => '100 2', diff --git a/spec/classes/tftp_spec.rb b/spec/classes/tftp_spec.rb index 872a82d..12fefa9 100644 --- a/spec/classes/tftp_spec.rb +++ b/spec/classes/tftp_spec.rb @@ -10,10 +10,10 @@ describe 'tftp', :type => :class do should contain_file('/etc/default/tftpd-hpa') should contain_package('tftpd-hpa') should contain_service('tftpd-hpa').with({ - 'ensure' => 'running', - 'enable' => true, - 'hasstatus' => false, - 'provider' => nil, + 'ensure' => 'running', + 'enable' => true, + 'hasstatus' => false, + 'provider' => nil, }) } end @@ -28,9 +28,9 @@ describe 'tftp', :type => :class do should contain_file('/etc/default/tftpd-hpa') should contain_service('tftpd-hpa').with({ 'ensure' => 'running', - 'enable' => true, - 'hasstatus' => true, - 'provider' => 'upstart', + 'enable' => true, + 'hasstatus' => true, + 'provider' => 'upstart', }) } end @@ -45,11 +45,11 @@ describe 'tftp', :type => :class do }) should contain_service('tftpd-hpa').with({ - 'ensure' => 'running', - 'enable' => 'true', - 'hasstatus' => false, - 'provider' => 'base', - 'start' => '/usr/sbin/in.tftpd -l -a 0.0.0.0:69 -u nobody --secure /var/lib/tftpboot', + 'ensure' => 'running', + 'enable' => 'true', + 'hasstatus' => false, + 'provider' => 'base', + 'start' => '/usr/sbin/in.tftpd -l -a 0.0.0.0:69 -u nobody --secure /var/lib/tftpboot', }) } end @@ -91,9 +91,8 @@ describe 'tftp', :type => :class do should contain_xinetd__service('tftp').with({ 'port' => '69', 'protocol' => 'udp', - 'server_args' => '--secure /var/lib/tftpboot', + 'server_args' => '--secure -u nobody /var/lib/tftpboot', 'server' => '/usr/sbin/in.tftpd', - 'user' => 'nobody', 'socket_type' => 'dgram', 'cps' => '100 2', 'flags' => 'IPv4', @@ -116,9 +115,8 @@ describe 'tftp', :type => :class do should contain_xinetd__service('tftp').with({ 'port' => '69', 'protocol' => 'udp', - 'server_args' => '--secure /var/lib/tftpboot', + 'server_args' => '--secure -u tftp /var/lib/tftpboot', 'server' => '/usr/sbin/in.tftpd', - 'user' => 'tftp', 'socket_type' => 'dgram', 'cps' => '100 2', 'flags' => 'IPv4', @@ -137,9 +135,8 @@ describe 'tftp', :type => :class do should contain_xinetd__service('tftp').with({ 'port' => '69', 'protocol' => 'udp', - 'server_args' => '--secure /srv/tftp', + 'server_args' => '--secure -u tftp /srv/tftp', 'server' => '/usr/sbin/in.tftpd', - 'user' => 'tftp', 'socket_type' => 'dgram', 'cps' => '100 2', 'flags' => 'IPv4', @@ -160,9 +157,8 @@ describe 'tftp', :type => :class do should contain_xinetd__service('tftp').with({ 'port' => '69', 'protocol' => 'udp', - 'server_args' => '--secure --timeout 50 /srv/tftp', + 'server_args' => '--secure --timeout 50 -u tftp /srv/tftp', 'server' => '/usr/sbin/in.tftpd', - 'user' => 'tftp', 'socket_type' => 'dgram', 'cps' => '100 2', 'flags' => 'IPv4', @@ -186,9 +182,8 @@ describe 'tftp', :type => :class do should contain_xinetd__service('tftp').with({ 'port' => '1069', 'protocol' => 'udp', - 'server_args' => '--secure /tftpboot', + 'server_args' => '--secure -u root /tftpboot', 'server' => '/usr/sbin/in.tftpd', - 'user' => 'root', 'socket_type' => 'dgram', 'cps' => '100 2', 'flags' => 'IPv4', |