Mageia Bugzilla – Attachment 6982 Details for
Bug 14550
Drakfirewall fails to open mountd ports for NFS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Patch to use correct config file for NFS
nfs.pm.patch (text/plain), 4.18 KB, created by
Derek Jennings
on 2015-08-30 15:53:36 CEST
(
hide
)
Description:
Patch to use correct config file for NFS
Filename:
MIME Type:
Creator:
Derek Jennings
Created:
2015-08-30 15:53:36 CEST
Size:
4.18 KB
patch
obsolete
>--- /usr/lib/libDrakX/network/nfs.pm 2015-06-03 17:12:24.000000000 +0100 >+++ nfs.pm 2015-08-30 13:51:46.000000000 +0100 >@@ -11,18 +11,18 @@ > my $lockd_udp_port = 4002; > my $rpc_mountd_port = 4003; > my $rpc_rquotad_port = 4004; >- if (-f "$::prefix/etc/sysconfig/nfs-common") { >- foreach (cat_("$::prefix/etc/sysconfig/nfs-common")) { >- /^STATD_OPTIONS=.*(--port|-p) (\d+)/ and $statd_port = $2; >- /^STATD_OPTIONS=.*(--outgoing-port|-o) (\d+)/ and $statd_outgoing_port = $2; >+ if (-f "$::prefix/etc/sysconfig/nfs") { >+ foreach (cat_("$::prefix/etc/sysconfig/nfs")) { >+ /^STATDARGS=.*(--port|-p) (\d+)/ and $statd_port = $2; >+ /^STATDARGS=.*(--outgoing-port|-o) (\d+)/ and $statd_outgoing_port = $2; > /^LOCKD_TCPPORT=(\d+)/ and $lockd_tcp_port = $1; > /^LOCKD_UDPPORT=(\d+)/ and $lockd_udp_port = $1; > } > } >- if (-f "$::prefix/etc/sysconfig/nfs-server") { >- foreach (cat_("$::prefix/etc/sysconfig/nfs-server")) { >- /^RPCMOUNTD_OPTIONS=.*(--port|-p) (\d+)/ and $rpc_mountd_port = $2; >- /^RPCRQUOTAD_OPTIONS=.*(--port|-p) (\d+)/ and $rpc_rquotad_port = $2; >+ if (-f "$::prefix/etc/sysconfig/nfs") { >+ foreach (cat_("$::prefix/etc/sysconfig/nfs")) { >+ /^RPCMOUNTDARGS=.*(--port|-p) (\d+)/ and $rpc_mountd_port = $2; >+ /^RPCRQUOTADARGS=.*(--port|-p) (\d+)/ and $rpc_rquotad_port = $2; > } > } > >@@ -56,14 +56,13 @@ > sub write_nfs_ports { > my ($ports) = @_; > # enabling fixed ports for NFS services >- # nfs-common > my $lockd_options=""; > substInFile { > if ($ports->{statd_port}) { > my $port = $ports->{statd_port}; >- s/^(STATD_OPTIONS)=$/$1="--port $port"/; >- s/^(STATD_OPTIONS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; >- s/^(STATD_OPTIONS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; >+ s/^(STATDARGS)=""$/$1="--port $port"/; >+ s/^(STATDARGS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; >+ s/^(STATDARGS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; > } > if ($ports->{lockd_tcp_port}) { > my $port = $ports->{lockd_tcp_port}; >@@ -72,29 +71,26 @@ > if ($ports->{lockd_udp_port}) { > my $port = $ports->{lockd_udp_port}; > s/^LOCKD_UDPPORT=.*/LOCKD_UDPPORT=$port/; >+ } >+ if ($ports->{rpc_mountd_port}) { >+ my $port = $ports->{rpc_mountd_port}; >+ s/^(RPCMOUNTDARGS)=""$/$1="--port $port"/; >+ s/^(RPCMOUNTDARGS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; >+ s/^(RPCMOUNTDARGS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; >+ } >+ if ($ports->{rpc_rquotad_port}) { >+ my $port = $ports->{rpc_rquotad_port}; >+ s/^(RPCRQUOTADARGS)=""$/$1="--port $port"/; >+ s/^(RPCRQUOTADARGS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; >+ s/^(RPCRQUOTADARGS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; > } >- } "$::prefix/etc/sysconfig/nfs-common"; >+ } "$::prefix/etc/sysconfig/nfs"; > # kernel-side configuration of nlockmgr > $lockd_options .= " nlm_tcpport=$ports->{lockd_tcp_port}" if $ports->{lockd_tcp_port}; > $lockd_options .= " nlm_udpport=$ports->{lockd_udp_port}" if $ports->{lockd_udp_port}; > if ($lockd_options ne "") { > output("$::prefix/etc/modprobe.d/lockd.drakx.conf", "options lockd $lockd_options\n"); > } >- # nfs-server >- substInFile { >- if ($ports->{rpc_mountd_port}) { >- my $port = $ports->{rpc_mountd_port}; >- s/^(RPCMOUNTD_OPTIONS)=$/$1="--port $port"/; >- s/^(RPCMOUNTD_OPTIONS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; >- s/^(RPCMOUNTD_OPTIONS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; >- } >- if ($ports->{rpc_rquotad_port}) { >- my $port = $ports->{rpc_rquotad_port}; >- s/^(RPCRQUOTAD_OPTIONS)=$/$1="--port $port"/; >- s/^(RPCRQUOTAD_OPTIONS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; >- s/^(RPCRQUOTAD_OPTIONS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; >- } >- } "$::prefix/etc/sysconfig/nfs-server"; > } > > 1;
--- /usr/lib/libDrakX/network/nfs.pm 2015-06-03 17:12:24.000000000 +0100 +++ nfs.pm 2015-08-30 13:51:46.000000000 +0100 @@ -11,18 +11,18 @@ my $lockd_udp_port = 4002; my $rpc_mountd_port = 4003; my $rpc_rquotad_port = 4004; - if (-f "$::prefix/etc/sysconfig/nfs-common") { - foreach (cat_("$::prefix/etc/sysconfig/nfs-common")) { - /^STATD_OPTIONS=.*(--port|-p) (\d+)/ and $statd_port = $2; - /^STATD_OPTIONS=.*(--outgoing-port|-o) (\d+)/ and $statd_outgoing_port = $2; + if (-f "$::prefix/etc/sysconfig/nfs") { + foreach (cat_("$::prefix/etc/sysconfig/nfs")) { + /^STATDARGS=.*(--port|-p) (\d+)/ and $statd_port = $2; + /^STATDARGS=.*(--outgoing-port|-o) (\d+)/ and $statd_outgoing_port = $2; /^LOCKD_TCPPORT=(\d+)/ and $lockd_tcp_port = $1; /^LOCKD_UDPPORT=(\d+)/ and $lockd_udp_port = $1; } } - if (-f "$::prefix/etc/sysconfig/nfs-server") { - foreach (cat_("$::prefix/etc/sysconfig/nfs-server")) { - /^RPCMOUNTD_OPTIONS=.*(--port|-p) (\d+)/ and $rpc_mountd_port = $2; - /^RPCRQUOTAD_OPTIONS=.*(--port|-p) (\d+)/ and $rpc_rquotad_port = $2; + if (-f "$::prefix/etc/sysconfig/nfs") { + foreach (cat_("$::prefix/etc/sysconfig/nfs")) { + /^RPCMOUNTDARGS=.*(--port|-p) (\d+)/ and $rpc_mountd_port = $2; + /^RPCRQUOTADARGS=.*(--port|-p) (\d+)/ and $rpc_rquotad_port = $2; } } @@ -56,14 +56,13 @@ sub write_nfs_ports { my ($ports) = @_; # enabling fixed ports for NFS services - # nfs-common my $lockd_options=""; substInFile { if ($ports->{statd_port}) { my $port = $ports->{statd_port}; - s/^(STATD_OPTIONS)=$/$1="--port $port"/; - s/^(STATD_OPTIONS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; - s/^(STATD_OPTIONS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; + s/^(STATDARGS)=""$/$1="--port $port"/; + s/^(STATDARGS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; + s/^(STATDARGS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; } if ($ports->{lockd_tcp_port}) { my $port = $ports->{lockd_tcp_port}; @@ -72,29 +71,26 @@ if ($ports->{lockd_udp_port}) { my $port = $ports->{lockd_udp_port}; s/^LOCKD_UDPPORT=.*/LOCKD_UDPPORT=$port/; + } + if ($ports->{rpc_mountd_port}) { + my $port = $ports->{rpc_mountd_port}; + s/^(RPCMOUNTDARGS)=""$/$1="--port $port"/; + s/^(RPCMOUNTDARGS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; + s/^(RPCMOUNTDARGS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; + } + if ($ports->{rpc_rquotad_port}) { + my $port = $ports->{rpc_rquotad_port}; + s/^(RPCRQUOTADARGS)=""$/$1="--port $port"/; + s/^(RPCRQUOTADARGS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; + s/^(RPCRQUOTADARGS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; } - } "$::prefix/etc/sysconfig/nfs-common"; + } "$::prefix/etc/sysconfig/nfs"; # kernel-side configuration of nlockmgr $lockd_options .= " nlm_tcpport=$ports->{lockd_tcp_port}" if $ports->{lockd_tcp_port}; $lockd_options .= " nlm_udpport=$ports->{lockd_udp_port}" if $ports->{lockd_udp_port}; if ($lockd_options ne "") { output("$::prefix/etc/modprobe.d/lockd.drakx.conf", "options lockd $lockd_options\n"); } - # nfs-server - substInFile { - if ($ports->{rpc_mountd_port}) { - my $port = $ports->{rpc_mountd_port}; - s/^(RPCMOUNTD_OPTIONS)=$/$1="--port $port"/; - s/^(RPCMOUNTD_OPTIONS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; - s/^(RPCMOUNTD_OPTIONS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; - } - if ($ports->{rpc_rquotad_port}) { - my $port = $ports->{rpc_rquotad_port}; - s/^(RPCRQUOTAD_OPTIONS)=$/$1="--port $port"/; - s/^(RPCRQUOTAD_OPTIONS)="(.*)(--port \d+)(.*)"$/$1="$2--port $port$4"/; - s/^(RPCRQUOTAD_OPTIONS)="(.*)(-p \d+)(.*)"$/$1="$2--port $port$4"/; - } - } "$::prefix/etc/sysconfig/nfs-server"; } 1;
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 14550
: 6982