commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 13/25: libdiskfs: Fix short-circuiting translators.


From: Samuel Thibault
Subject: [hurd] 13/25: libdiskfs: Fix short-circuiting translators.
Date: Mon, 24 Oct 2016 00:16:45 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 63cfc3cdfd817d8f794c83bc39f86ab8b910fe71
Author: Justus Winter <address@hidden>
Date:   Mon Oct 3 15:19:08 2016 +0200

    libdiskfs: Fix short-circuiting translators.
    
    * libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): When
    setting a short-circuited translator, clear the translator record
    first.  Improve error handling.
    
    This notably fixes a crash in ext2fs when setting a symlink on a node
    with an existing translator record.
---
 libdiskfs/file-set-trans.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/libdiskfs/file-set-trans.c b/libdiskfs/file-set-trans.c
index 6e1a61d..3238037 100644
--- a/libdiskfs/file-set-trans.c
+++ b/libdiskfs/file-set-trans.c
@@ -168,7 +168,20 @@ diskfs_S_file_set_translator (struct protid *cred,
                  np->dn_stat.st_rdev = makedev (major, minor);
                }
 
-             diskfs_truncate (np, 0);
+             err = diskfs_truncate (np, 0);
+             if (err)
+               {
+                 pthread_mutex_unlock (&np->lock);
+                 return err;
+               }
+
+             err = diskfs_set_translator (np, NULL, 0, cred);
+             if (err)
+               {
+                 pthread_mutex_unlock (&np->lock);
+                 return err;
+               }
+
              if (newmode == S_IFLNK)
                {
                  char *arg = passive + strlen (passive) + 1;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]