summaryrefslogtreecommitdiff
path: root/contrib/cygwin
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-11-03 18:59:29 +1100
committerDarren Tucker <dtucker@zip.com.au>2003-11-03 18:59:29 +1100
commit7c582db74b46f841f8efba7f5353ca16bf357ec2 (patch)
tree31e27c6733fe0b76e2a23281fe9c210a10793cad /contrib/cygwin
parent2bdacad70cb754f47fced50301c0ea535d98aa71 (diff)
- (dtucker) [contrib/cygwin/ssh-host-config] Ensure entries in /etc/services
are created correctly with CRLF line terminations. Patch from vinschen at redhat.com.
Diffstat (limited to 'contrib/cygwin')
-rw-r--r--contrib/cygwin/ssh-host-config33
1 files changed, 17 insertions, 16 deletions
diff --git a/contrib/cygwin/ssh-host-config b/contrib/cygwin/ssh-host-config
index e9c56aea9..c69cfd88b 100644
--- a/contrib/cygwin/ssh-host-config
+++ b/contrib/cygwin/ssh-host-config
@@ -468,19 +468,21 @@ then
468fi 468fi
469 469
470# Care for services file 470# Care for services file
471_my_etcdir="/ssh-host-config.$$"
471if [ $_nt -gt 0 ] 472if [ $_nt -gt 0 ]
472then 473then
473 _wservices="${SYSTEMROOT}\\system32\\drivers\\etc\\services" 474 _win_etcdir="${SYSTEMROOT}\\system32\\drivers\\etc"
474 _wserv_tmp="${SYSTEMROOT}\\system32\\drivers\\etc\\srv.out.$$" 475 _services="${_my_etcdir}/services"
475else 476else
476 _wservices="${WINDIR}\\SERVICES" 477 _win_etcdir="${WINDIR}"
477 _wserv_tmp="${WINDIR}\\SERV.$$" 478 _services="${_my_etcdir}/SERVICES"
478fi 479fi
479_services=`cygpath -u "${_wservices}"` 480_serv_tmp="${_my_etcdir}/srv.out.$$"
480_serv_tmp=`cygpath -u "${_wserv_tmp}"`
481 481
482mount -t -f "${_wservices}" "${_services}" 482mount -t -f "${_win_etcdir}" "${_my_etcdir}"
483mount -t -f "${_wserv_tmp}" "${_serv_tmp}" 483
484# Depends on the above mount
485_wservices=`cygpath -w "${_services}"`
484 486
485# Remove sshd 22/port from services 487# Remove sshd 22/port from services
486if [ `grep -q 'sshd[ \t][ \t]*22' "${_services}"; echo $?` -eq 0 ] 488if [ `grep -q 'sshd[ \t][ \t]*22' "${_services}"; echo $?` -eq 0 ]
@@ -490,13 +492,13 @@ then
490 then 492 then
491 if mv "${_serv_tmp}" "${_services}" 493 if mv "${_serv_tmp}" "${_services}"
492 then 494 then
493 echo "Removing sshd from ${_services}" 495 echo "Removing sshd from ${_wservices}"
494 else 496 else
495 echo "Removing sshd from ${_services} failed\!" 497 echo "Removing sshd from ${_wservices} failed\!"
496 fi 498 fi
497 rm -f "${_serv_tmp}" 499 rm -f "${_serv_tmp}"
498 else 500 else
499 echo "Removing sshd from ${_services} failed\!" 501 echo "Removing sshd from ${_wservices} failed\!"
500 fi 502 fi
501fi 503fi
502 504
@@ -508,18 +510,17 @@ then
508 then 510 then
509 if mv "${_serv_tmp}" "${_services}" 511 if mv "${_serv_tmp}" "${_services}"
510 then 512 then
511 echo "Added ssh to ${_services}" 513 echo "Added ssh to ${_wservices}"
512 else 514 else
513 echo "Adding ssh to ${_services} failed\!" 515 echo "Adding ssh to ${_wservices} failed\!"
514 fi 516 fi
515 rm -f "${_serv_tmp}" 517 rm -f "${_serv_tmp}"
516 else 518 else
517 echo "Adding ssh to ${_services} failed\!" 519 echo "Adding ssh to ${_wservices} failed\!"
518 fi 520 fi
519fi 521fi
520 522
521umount "${_services}" 523umount "${_my_etcdir}"
522umount "${_serv_tmp}"
523 524
524# Care for inetd.conf file 525# Care for inetd.conf file
525_inetcnf="${SYSCONFDIR}/inetd.conf" 526_inetcnf="${SYSCONFDIR}/inetd.conf"