Various NFS-related bug fixes (mostly related to using variable_get()

instead of variable_cmp() to test boolean rc.conf variables).

Submitted by:	hmp
This commit is contained in:
Dag-Erling Smørgrav 2003-10-19 13:37:12 +00:00
parent 5834974f39
commit 79ef1f32da
6 changed files with 19 additions and 3 deletions

View File

@ -1167,6 +1167,8 @@ installVarDefaults(dialogMenuItem *self)
variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/links", 0);
variable_set2(VAR_FTP_STATE, "passive", 0);
variable_set2(VAR_NFS_SECURE, "NO", -1);
variable_set2(VAR_NFS_TCP, "NO", -1);
variable_set2(VAR_NFS_V3, "YES", -1);
if (OnVTY)
variable_set2(VAR_FIXIT_TTY, "standard", 0);
else

View File

@ -160,6 +160,8 @@
#define VAR_NEWFS_ARGS "newfsArgs"
#define VAR_NFS_PATH "nfs"
#define VAR_NFS_HOST "nfsHost"
#define VAR_NFS_V3 "nfs_use_v3"
#define VAR_NFS_TCP "nfs_use_tcp"
#define VAR_NFS_SECURE "nfs_reserved_port_only"
#define VAR_NFS_SERVER "nfs_server_enable"
#define VAR_NO_CONFIRM "noConfirm"

View File

@ -1167,6 +1167,8 @@ installVarDefaults(dialogMenuItem *self)
variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/links", 0);
variable_set2(VAR_FTP_STATE, "passive", 0);
variable_set2(VAR_NFS_SECURE, "NO", -1);
variable_set2(VAR_NFS_TCP, "NO", -1);
variable_set2(VAR_NFS_V3, "YES", -1);
if (OnVTY)
variable_set2(VAR_FIXIT_TTY, "standard", 0);
else

View File

@ -61,9 +61,13 @@ mediaInitNFS(Device *dev)
return FALSE;
msgNotify("Mounting %s over NFS on %s", dev->name, mountpoint);
if (vsystem("mount_nfs %s %s %s %s",
variable_get(VAR_SLOW_ETHER) ? "-r 1024 -w 1024" : "",
variable_get(VAR_NFS_SECURE) ? "-P" : "", dev->name, mountpoint)) {
if (vsystem("mount_nfs %s %s %s %s %s %s",
!variable_cmp(VAR_NFS_TCP, "YES") ? "-T" : "",
!variable_cmp(VAR_NFS_V3, "YES") ? "-3" : "",
!variable_cmp(VAR_SLOW_ETHER, "YES") ?
"-r 1024 -w 1024" : "-r 4096 -w 4096",
!variable_cmp(VAR_NFS_SECURE, "YES") ? "-P" : "",
dev->name, mountpoint)) {
msgConfirm("Error mounting %s on %s: %s.", dev->name, mountpoint, strerror(errno));
if (netDevice)
DEVICE_SHUTDOWN(netDevice);

View File

@ -112,6 +112,10 @@ static Option Options[] = {
OPT_IS_VAR, NULL, VAR_NFS_SECURE, varCheck },
{ "NFS Slow", "User is using a slow PC or ethernet card",
OPT_IS_VAR, NULL, VAR_SLOW_ETHER, varCheck },
{ "NFS TCP", "Use TCP protocol for NFS",
OPT_IS_VAR, NULL, VAR_NFS_TCP, varCheck },
{ "NFS version 3", "Use NFS version 3",
OPT_IS_VAR, NULL, VAR_NFS_V3, varCheck },
{ "Debugging", "Emit extra debugging output on VTY2 (ALT-F2)",
OPT_IS_VAR, NULL, VAR_DEBUG, varCheck },
{ "No Warnings", "Don't Warn the user when a setting seems incorrect",

View File

@ -160,6 +160,8 @@
#define VAR_NEWFS_ARGS "newfsArgs"
#define VAR_NFS_PATH "nfs"
#define VAR_NFS_HOST "nfsHost"
#define VAR_NFS_V3 "nfs_use_v3"
#define VAR_NFS_TCP "nfs_use_tcp"
#define VAR_NFS_SECURE "nfs_reserved_port_only"
#define VAR_NFS_SERVER "nfs_server_enable"
#define VAR_NO_CONFIRM "noConfirm"