pam_mount/pam_mount-0.47-convert-add-logout.dif

45 lines
1.2 KiB
Plaintext

--- orig/pam_mount-0.47/scripts/convert_pam_mount_conf.pl 2008-09-05 05:28:34.000000000 +0200
+++ pam_mount-0.47/scripts/convert_pam_mount_conf.pl 2009-01-10 18:07:15.000000000 +0100
@@ -26,6 +26,7 @@
my %callbacks = (
"debug" => \&callback_debug,
+ "logout" => \&callback_logout,
"mkmountpoint" => \&callback_mkmountpoint,
"fsckloop" => \&callback_fsckloop,
"luserconf" => \&callback_luserconf,
@@ -67,6 +68,14 @@
$writer->emptyTag("debug", "enable" => $fields[1]);
}
+sub callback_logout
+{
+ my @fields = @_;
+
+ # we create a default entry here, fields are not evaluated
+ $writer->emptyTag("logout", "wait" => "2000", "hup" => "0", "term" => "1", "kill" => "1");
+}
+
sub callback_mkmountpoint
{
my @fields = @_;
@@ -401,6 +415,18 @@
"-" x 40, "\n";
return 1;
}
+
+ # insert new <logout> field after debug
+
+ if( $fields[0] eq "debug" )
+ {
+ if ($debug) {
+ print STDERR "callback_logout called: (default)\n";
+ }
+
+ $callbacks{"logout"}->();
+ $writer->raw("\n\n");
+ }
}
return 0;