[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 61/64: Fix mode of nodes created with mkfile
From: |
Samuel Thibault |
Subject: |
[hurd] 61/64: Fix mode of nodes created with mkfile |
Date: |
Wed, 10 Dec 2014 15:17:08 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 7f68a98c5cad19350f53b00203465c72641b8f58
Author: Samuel Thibault <address@hidden>
Date: Tue Dec 9 01:36:34 2014 +0100
Fix mode of nodes created with mkfile
Their faked field was not initialized.
Thanks a lot to Svante Signell for the investigation
* trans/fakeroot.c (new_node): Initialize faked field of nn to 0.
(netfs_attempt_mkfile): Call set_default_attributes on newly-allocated node,
and if the real mode is not the same as the requested mode, fake the mode.
---
trans/fakeroot.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 12173bd..2275981 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -103,6 +103,7 @@ new_node (file_t file, mach_port_t idport, int locked, int
openmodes,
return err;
}
}
+ nn->faked = 0;
if (!locked)
pthread_mutex_lock (&idport_ihash_lock);
@@ -679,13 +680,22 @@ netfs_attempt_mkfile (struct iouser *user, struct node
*dir,
mode_t mode, struct node **np)
{
file_t newfile;
+ mode_t real_mode = real_from_fake_mode (mode);
error_t err = dir_mkfile (netfs_node_netnode (dir)->file, O_RDWR|O_EXEC,
- real_from_fake_mode (mode), &newfile);
+ real_mode, &newfile);
pthread_mutex_unlock (&dir->lock);
if (err == 0)
err = new_node (newfile, MACH_PORT_NULL, 0, O_RDWR|O_EXEC, np);
if (err == 0)
- pthread_mutex_unlock (&(*np)->lock);
+ {
+ pthread_mutex_unlock (&(*np)->lock);
+ set_default_attributes (*np);
+ if (real_mode != mode)
+ {
+ set_faked_attribute (*np, FAKE_MODE);
+ (*np)->nn_stat.st_mode = mode;
+ }
+ }
return err;
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 24/64: boot: drop bootstrap compat code, (continued)
- [hurd] 24/64: boot: drop bootstrap compat code, Samuel Thibault, 2014/12/10
- [hurd] 52/64: startup: disable default payload to port mapping, Samuel Thibault, 2014/12/10
- [hurd] 55/64: trans/ifsock: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 27/64: boot: support ds_device_get_status with flavor DEV_GET_RECORDS, Samuel Thibault, 2014/12/10
- [hurd] 35/64: libshouldbeinlibc: move the reference counting primitives here, Samuel Thibault, 2014/12/10
- [hurd] 56/64: trans/password: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 36/64: Fix coding style, Samuel Thibault, 2014/12/10
- [hurd] 38/64: libports: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 58/64: trans/symlink: disable default payload to port mapping, Samuel Thibault, 2014/12/10
- [hurd] 34/64: Revert "random: fix a receiver lookup", Samuel Thibault, 2014/12/10
- [hurd] 61/64: Fix mode of nodes created with mkfile,
Samuel Thibault <=
- [hurd] 62/64: include: don't install nonexistent refcount.h, Samuel Thibault, 2014/12/10
- [hurd] 37/64: libports: add `ports_lookup_payload' and `ports_payload_get_name', Samuel Thibault, 2014/12/10
- [hurd] 44/64: auth: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 45/64: console: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 30/64: libpager: make the request queue more memory-efficient, Samuel Thibault, 2014/12/10
- [hurd] 63/64: fakeroot: Fix initializing default faked field of nodes, Samuel Thibault, 2014/12/10
- [hurd] 60/64: hurd: add intranpayload functions to all hurd types, Samuel Thibault, 2014/12/10
- [hurd] 33/64: Add atomicity support to fshelp_acquire_lock, Samuel Thibault, 2014/12/10
- [hurd] 59/64: utils/rpctrace: make `trace_and_forward' payload-aware, Samuel Thibault, 2014/12/10
- [hurd] 53/64: term: add a payload-aware intrans function, Samuel Thibault, 2014/12/10