aboutsummaryrefslogtreecommitdiff
path: root/etc/pam.d
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2002-01-12 13:50:08 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2002-01-12 13:50:08 +0000
commit1c6246992a205edd77f994523ac1633712a26a2d (patch)
tree68302d9ed59aa4ad9dd86a36f2e16471e9eadba0 /etc/pam.d
parenta61a203e62775333d55d3171af67f50cc478c967 (diff)
downloadsrc-1c6246992a205edd77f994523ac1633712a26a2d.tar.gz
src-1c6246992a205edd77f994523ac1633712a26a2d.zip
Preserve FreeBSD version strings in target files.
Notes
Notes: svn path=/head/; revision=89285
Diffstat (limited to 'etc/pam.d')
-rw-r--r--etc/pam.d/convert.pl12
1 files changed, 11 insertions, 1 deletions
diff --git a/etc/pam.d/convert.pl b/etc/pam.d/convert.pl
index 02d410372663..66273784f8f4 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");