Skip to contentSkip to conversation

common/rc: accept "localdomain" to mean YP/NIS disabled

PATCH New Eric Biggers 1 participant 1 message Mar 1, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/rc: accept "localdomain" to mean YP/NIS disabled

From: Eric Biggers <[email protected]>

When asked to 'cat' the passwd or group files, currently xfstests runs the 'domainname' program to get what the kernel thinks the domainname is. It seems that traditionally this has been "(none)" if YP/NIS is not in use. However, Android devices use a different convention which is to set the domainname to "localdomain". Therefore, this patch updates xfstests to accept both conventions to indicate YP/NIS disabled. This stops a number of tests from failing when run on Android.

---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index 8f233346..aa78d4b2 100644
@@ -1792,7 +1792,7 @@ _yp_active()
 {
 	local dn
 	dn=$(domainname 2>/dev/null)
-	test -n "${dn}" -a "${dn}" != "(none)"
+	test -n "${dn}" -a "${dn}" != "(none)" -a "${dn}" != "localdomain"
 	echo $?
 }
 
Signature · 1 line
2.11.0.483.g087da7b7c-goog