diff mbox series

[2/2] Temporary fix for build issue for mount util.

Message ID 012724c4-12ee-4648-b5cc-b9f8e8322139@hyub.org (mailing list archive)
State New
Headers show
Series nfsd symlink vulnerability patch | expand

Commit Message

Christopher Bii Dec. 5, 2024, 2:04 a.m. UTC
---
  support/include/exportfs.h | 1 -
  support/nfs/exports.c      | 8 +++++++-
  2 files changed, 7 insertions(+), 2 deletions(-)

   	/* resolve symlinks */
  	if (nfsd_realpath(ee.e_path, rpath) == NULL) {
-                xlog(L_ERROR, "realpath(): Unable to resolve path at 
%s", ee.e_path);
+                xlog(L_ERROR, "nfsd_realpath(): to resolve path at %s", 
ee.e_path);
                  goto out;
          };
  -- 2.47.1
diff mbox series

Patch

diff --git a/support/include/exportfs.h b/support/include/exportfs.h
index c65e2a1c..9edf0d04 100644
--- a/support/include/exportfs.h
+++ b/support/include/exportfs.h
@@ -173,7 +173,6 @@  struct export_features {
   struct export_features *get_export_features(void);
  void fix_pseudoflavor_flags(struct exportent *ep);
-void exportent_free_realpath(struct exportent*);
  char *exportent_realpath(struct exportent *eep);
  int export_test(struct exportent *eep, int with_fsid);
  diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index c8ce8566..ec361486 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -67,6 +67,12 @@  static void	freesquash(void);
  static void	syntaxerr(char *msg);
  static struct flav_info *find_flavor(char *name);
  +static void
+exportent_free_realpath(struct exportent* eep){
+        if (eep->e_realpath && eep->e_realpath != eep->e_path)
+                free(eep->e_realpath);
+};
+
  void
  setexportent(char *fname, char *type)
  {
@@ -191,7 +197,7 @@  getexportent(int fromkernel)