Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136292568
D8491.id22125.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
877 B
Referenced Files
None
Subscribers
None
D8491.id22125.diff
View Options
Index: lib/libstand/nfs.c
===================================================================
--- lib/libstand/nfs.c
+++ lib/libstand/nfs.c
@@ -223,6 +223,7 @@
nfs_getrootfh(struct iodesc *d, char *path, u_char *fhp)
{
int len;
+ char *env, *end;
struct args {
n_long len;
char path[FNAME_SIZE];
@@ -272,8 +273,14 @@
/*
* Improve boot performance over NFS
*/
- if (getenv("nfs.read_size") != NULL)
- nfs_read_size = strtol(getenv("nfs.read_size"), NULL, 0);
+ if ((env = getenv("nfs.read_size")) != NULL) {
+ nfs_read_size = strtol(env, &end, 0);
+ if (*env != '\0' || *end != '\0') {
+ printf("%s: bad value: \"%s\", defaulting to %d\n",
+ "nfs.read_size", env, NFSREAD_MIN_SIZE);
+ nfs_read_size = NFSREAD_MIN_SIZE;
+ }
+ }
if (nfs_read_size < NFSREAD_MIN_SIZE)
nfs_read_size = NFSREAD_MIN_SIZE;
if (nfs_read_size > NFSREAD_MAX_SIZE)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 18, 1:48 AM (14 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25469552
Default Alt Text
D8491.id22125.diff (877 B)
Attached To
Mode
D8491: libstand: verify value provided by nfs.read_size
Attached
Detach File
Event Timeline
Log In to Comment