Skip to contentSkip to conversation

rpc.mountd: Remove duplicate and invalid secinfo setting

PATCH In review Kinglong Mee 3 participants 4 messages Apr 16, 2015 – May 7, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpc.mountd: Remove duplicate and invalid secinfo setting

NFSD return reply of client's SECINFO_NO_NAME request with four security information number as, 1 1 0 0

It's caused by commit 4a1ad4aa30,
"mountd: Enable all auth flavors on pseudofs exports"

This patch removes duplicate secinfo and invalid secinfo (zero).

---
 support/nfs/exports.c | 2 +-
 utils/mountd/v4root.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
support/nfs/exports.c +1 -1
index 761a046..0aea6f1 100644
@@ -408,7 +408,7 @@ int secinfo_addflavor(struct flav_info *flav, struct exportent *ep)
 	struct sec_entry *p;
 
 	for (p=ep->e_secinfo; p->flav; p++) {
-		if (p->flav == flav)
+		if (p->flav == flav || p->flav->fnum == flav->fnum)
 			return p - ep->e_secinfo;
 	}
 	if (p - ep->e_secinfo >= SECFLAVOR_COUNT) {
utils/mountd/v4root.c +3 -0
index 429ebb8..d521725 100644
@@ -69,6 +69,9 @@ set_pseudofs_security(struct exportent *pseudo, int flags)
 	for (flav = flav_map; flav < flav_map + flav_map_size; flav++) {
 		struct sec_entry *new;
 
+		if (!flav->fnum)
+			continue;
+
 		i = secinfo_addflavor(flav, pseudo);
 		new = &pseudo->e_secinfo[i];
 
Signature · 1 line
2.3.5
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Kinglong Mee

NFSD return reply of client's SECINFO_NO_NAME request with four security information number as, 1 1 0 0

It's caused by commit 4a1ad4aa30,
"mountd: Enable all auth flavors on pseudofs exports"

This patch removes duplicate secinfo and invalid secinfo (zero).

This is because flav_map has both AUTH_UNIX/AUTH_SYS and AUTH_NULL/AUTH_NONE. I had discussed it with Steve, but since I didn't observe any problems caused by it in my testing I just left them in.

Quoted 35 lines
---
 support/nfs/exports.c | 2 +-
 utils/mountd/v4root.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
support/nfs/exports.c +1 -1
index 761a046..0aea6f1 100644
@@ -408,7 +408,7 @@ int secinfo_addflavor(struct flav_info *flav, struct exportent *ep)
 	struct sec_entry *p;
 
 	for (p=ep->e_secinfo; p->flav; p++) {
-		if (p->flav == flav)
+		if (p->flav == flav || p->flav->fnum == flav->fnum)
 			return p - ep->e_secinfo;
 	}
 	if (p - ep->e_secinfo >= SECFLAVOR_COUNT) {
utils/mountd/v4root.c +3 -0
index 429ebb8..d521725 100644
@@ -69,6 +69,9 @@ set_pseudofs_security(struct exportent *pseudo, int flags)
 	for (flav = flav_map; flav < flav_map + flav_map_size; flav++) {
 		struct sec_entry *new;
 
+		if (!flav->fnum)
+			continue;
+
 		i = secinfo_addflavor(flav, pseudo);
 		new = &pseudo->e_secinfo[i];
 
Signature · 1 line
2.3.5
#2 lore raw
Quoted 10 lines · Scott Mayhew
Quoted 8 lines · Kinglong Mee

NFSD return reply of client's SECINFO_NO_NAME request with four security information number as, 1 1 0 0

It's caused by commit 4a1ad4aa30,
"mountd: Enable all auth flavors on pseudofs exports"

This patch removes duplicate secinfo and invalid secinfo (zero).

Quoted 7 lines
Quoted 1 line

This is because flav_map has both AUTH_UNIX/AUTH_SYS and AUTH_NULL/AUTH_NONE. I had discussed it with Steve, but since I didn't observe any problems caused by it in my testing I just left them in.

Also, this one?

thanks,
Kinglong Mee

Quoted 38 lines
Quoted 36 lines
---
 support/nfs/exports.c | 2 +-
 utils/mountd/v4root.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
support/nfs/exports.c +1 -1
index 761a046..0aea6f1 100644
@@ -408,7 +408,7 @@ int secinfo_addflavor(struct flav_info *flav, struct exportent *ep)
 	struct sec_entry *p;
 
 	for (p=ep->e_secinfo; p->flav; p++) {
-		if (p->flav == flav)
+		if (p->flav == flav || p->flav->fnum == flav->fnum)
 			return p - ep->e_secinfo;
 	}
 	if (p - ep->e_secinfo >= SECFLAVOR_COUNT) {
utils/mountd/v4root.c +3 -0
index 429ebb8..d521725 100644
@@ -69,6 +69,9 @@ set_pseudofs_security(struct exportent *pseudo, int flags)
 	for (flav = flav_map; flav < flav_map + flav_map_size; flav++) {
 		struct sec_entry *new;
 
+		if (!flav->fnum)
+			continue;
+
 		i = secinfo_addflavor(flav, pseudo);
 		new = &pseudo->e_secinfo[i];
 
Signature · 1 line
2.3.5
#3 lore raw
In reply to Kinglong Mee
Quoted 6 lines · Kinglong Mee

NFSD return reply of client's SECINFO_NO_NAME request with four security information number as, 1 1 0 0

It's caused by commit 4a1ad4aa30,
"mountd: Enable all auth flavors on pseudofs exports"

Quoted 7 lines

This patch removes duplicate secinfo and invalid secinfo (zero).

---
 support/nfs/exports.c | 2 +-
 utils/mountd/v4root.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

Committed...

steved.

Quoted 29 lines
support/nfs/exports.c +1 -1
index 761a046..0aea6f1 100644
@@ -408,7 +408,7 @@ int secinfo_addflavor(struct flav_info *flav, struct exportent *ep)
 	struct sec_entry *p;
 
 	for (p=ep->e_secinfo; p->flav; p++) {
-		if (p->flav == flav)
+		if (p->flav == flav || p->flav->fnum == flav->fnum)
 			return p - ep->e_secinfo;
 	}
 	if (p - ep->e_secinfo >= SECFLAVOR_COUNT) {
utils/mountd/v4root.c +3 -0
index 429ebb8..d521725 100644
@@ -69,6 +69,9 @@ set_pseudofs_security(struct exportent *pseudo, int flags)
 	for (flav = flav_map; flav < flav_map + flav_map_size; flav++) {
 		struct sec_entry *new;
 
+		if (!flav->fnum)
+			continue;
+
 		i = secinfo_addflavor(flav, pseudo);
 		new = &pseudo->e_secinfo[i];