diff options
author | des <des@FreeBSD.org> | 2002-01-12 13:50:08 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-01-12 13:50:08 +0000 |
commit | 965d591c452b87d01c58dd2271f5f4f928cff86e (patch) | |
tree | 68302d9ed59aa4ad9dd86a36f2e16471e9eadba0 /etc | |
parent | c4ee8d8a7b5152ba60b076bd1a3853ce27a921be (diff) | |
download | FreeBSD-src-965d591c452b87d01c58dd2271f5f4f928cff86e.zip FreeBSD-src-965d591c452b87d01c58dd2271f5f4f928cff86e.tar.gz |
Preserve FreeBSD version strings in target files.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/pam.d/convert.pl | 12 |
1 files changed, 11 insertions, 1 deletions
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 (<FILE>) { + 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"); |