From 965d591c452b87d01c58dd2271f5f4f928cff86e Mon Sep 17 00:00:00 2001 From: des Date: Sat, 12 Jan 2002 13:50:08 +0000 Subject: Preserve FreeBSD version strings in target files. --- etc/pam.d/convert.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'etc/pam.d') diff --git a/etc/pam.d/convert.pl b/etc/pam.d/convert.pl index 02d4103..6627378 100644 --- a/etc/pam.d/convert.pl +++ b/etc/pam.d/convert.pl @@ -42,6 +42,7 @@ use vars qw(%SERVICES); MAIN:{ my $line; my $service; + my $version; my $type; local *FILE; @@ -56,10 +57,19 @@ MAIN:{ } foreach $service (keys(%SERVICES)) { + $version = '$FreeBSD$'; + if (sysopen(FILE, $service, O_RDONLY)) { + while () { + next unless (m/(\$FreeBSD$]+\$)/); + $version = $1; + last; + } + close(FILE); + } sysopen(FILE, $service, O_RDWR|O_CREAT|O_TRUNC) or die("$service: $!\n"); print(FILE "#\n"); - print(FILE "# \$FreeBSD\$\n"); + print(FILE "# $version\n"); print(FILE "#\n"); print(FILE "# PAM configuration for the \"$service\" service\n"); print(FILE "#\n"); -- cgit v1.1