summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ef32b76)
Clean up: The MNT protocol has its own enum type defining error
status values. While the values can be the same as the NFSERR enum
type on some systems, it's not guaranteed to be true everywhere.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
/* Now authenticate the intruder... */
exp = auth_authenticate("mount", sap, p);
if (exp == NULL) {
/* Now authenticate the intruder... */
exp = auth_authenticate("mount", sap, p);
if (exp == NULL) {
+ *error = MNT3ERR_ACCES;
return NULL;
}
if (stat(p, &stb) < 0) {
xlog(L_WARNING, "can't stat exported dir %s: %s",
p, strerror(errno));
if (errno == ENOENT)
return NULL;
}
if (stat(p, &stb) < 0) {
xlog(L_WARNING, "can't stat exported dir %s: %s",
p, strerror(errno));
if (errno == ENOENT)
+ *error = MNT3ERR_NOENT;
+ *error = MNT3ERR_ACCES;
return NULL;
}
if (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) {
xlog(L_WARNING, "%s is not a directory or regular file", p);
return NULL;
}
if (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) {
xlog(L_WARNING, "%s is not a directory or regular file", p);
- *error = NFSERR_NOTDIR;
+ *error = MNT3ERR_NOTDIR;
return NULL;
}
if (stat(exp->m_export.e_path, &estb) < 0) {
xlog(L_WARNING, "can't stat export point %s: %s",
p, strerror(errno));
return NULL;
}
if (stat(exp->m_export.e_path, &estb) < 0) {
xlog(L_WARNING, "can't stat export point %s: %s",
p, strerror(errno));
+ *error = MNT3ERR_NOENT;
return NULL;
}
if (estb.st_dev != stb.st_dev
return NULL;
}
if (estb.st_dev != stb.st_dev
|| !(exp->m_export.e_flags & NFSEXP_CROSSMOUNT))) {
xlog(L_WARNING, "request to export directory %s below nearest filesystem %s",
p, exp->m_export.e_path);
|| !(exp->m_export.e_flags & NFSEXP_CROSSMOUNT))) {
xlog(L_WARNING, "request to export directory %s below nearest filesystem %s",
p, exp->m_export.e_path);
+ *error = MNT3ERR_ACCES;
return NULL;
}
if (exp->m_export.e_mountpoint &&
return NULL;
}
if (exp->m_export.e_mountpoint &&
exp->m_export.e_path)) {
xlog(L_WARNING, "request to export an unmounted filesystem: %s",
p);
exp->m_export.e_path)) {
xlog(L_WARNING, "request to export an unmounted filesystem: %s",
p);
+ *error = MNT3ERR_NOENT;
*/
if (cache_export(exp, p)) {
*/
if (cache_export(exp, p)) {
+ *error = MNT3ERR_ACCES;
return NULL;
}
fh = cache_get_filehandle(exp, v3?64:32, p);
if (fh == NULL) {
return NULL;
}
fh = cache_get_filehandle(exp, v3?64:32, p);
if (fh == NULL) {
+ *error = MNT3ERR_ACCES;
if (fh == NULL) {
xlog(L_WARNING, "getfh failed: %s", strerror(errno));
if (fh == NULL) {
xlog(L_WARNING, "getfh failed: %s", strerror(errno));
+ *error = MNT3ERR_ACCES;
mountlist_add(host_ntop(sap, buf, sizeof(buf)), p);
if (expret)
*expret = exp;
mountlist_add(host_ntop(sap, buf, sizeof(buf)), p);
if (expret)
*expret = exp;