summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-05-23 12:57:45 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-05-23 12:57:45 +0000
commit1c43be51a4c2c60bd43c7f3302f1d9fb66521176 (patch)
tree451fe676d97d4bf32ee9b0c20ae50008ecd276e6
parent70ecf644d552152d6a73f63421a5b7c5ea5f32ba (diff)
2002-05-23 Marcus Brinkmann <marcus@gnu.org>
* fakeroot.c (check_openmodes): Remove spurious if clause. (netfs_attempt_mksymlink): Don't evaluate stat information to get the length of the name, but use the string length of NAME and store it in the new variable NAMELEN. (netfs_S_dir_lookup): Don't always add O_NOLINK to FLAGS, but add it to the mask instead.
-rw-r--r--trans/ChangeLog9
-rw-r--r--trans/fakeroot.c9
2 files changed, 13 insertions, 5 deletions
diff --git a/trans/ChangeLog b/trans/ChangeLog
index 591cd4b8..00dc23c9 100644
--- a/trans/ChangeLog
+++ b/trans/ChangeLog
@@ -1,3 +1,12 @@
+2002-05-23 Marcus Brinkmann <marcus@gnu.org>
+
+ * fakeroot.c (check_openmodes): Remove spurious if clause.
+ (netfs_attempt_mksymlink): Don't evaluate stat information to get
+ the length of the name, but use the string length of NAME and
+ store it in the new variable NAMELEN.
+ (netfs_S_dir_lookup): Don't always add O_NOLINK to FLAGS, but add
+ it to the mask instead.
+
2002-05-18 Roland McGrath <roland@frob.com>
* fakeroot.c (netfs_S_file_exec): Call check_openmodes and extract a
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index b688ce77..ee7b3a64 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -179,7 +179,6 @@ check_openmodes (struct netnode *nn, int newmodes, file_t file)
{
enum retry_type bad_retry;
char bad_retryname[1024]; /* XXX */
- if (file != MACH_PORT_NULL)
err = dir_lookup (nn->file, "", nn->openmodes | newmodes, 0,
&bad_retry, bad_retryname, &file);
if (!err && (bad_retry != FS_RETRY_NORMAL
@@ -235,8 +234,7 @@ netfs_S_dir_lookup (struct protid *diruser,
dnp = diruser->po->np;
err = dir_lookup (dnp->nn->file, filename,
- O_NOLINK | (flags
- & (O_RDWR|O_EXEC|O_CREAT|O_EXCL|O_NONBLOCK)),
+ flags & (O_NOLINK|O_RDWR|O_EXEC|O_CREAT|O_EXCL|O_NONBLOCK),
mode, do_retry, retry_name, &file);
if (err)
return err;
@@ -458,9 +456,10 @@ netfs_attempt_chmod (struct iouser *cred, struct node *np, mode_t mode)
error_t
netfs_attempt_mksymlink (struct iouser *cred, struct node *np, char *name)
{
- char trans[sizeof _HURD_SYMLINK + np->nn_stat.st_size + 1];
+ int namelen = strlen (name) + 1;
+ char trans[sizeof _HURD_SYMLINK + namelen];
memcpy (trans, _HURD_SYMLINK, sizeof _HURD_SYMLINK);
- memcpy (&trans[sizeof _HURD_SYMLINK], name, np->nn_stat.st_size + 1);
+ memcpy (&trans[sizeof _HURD_SYMLINK], name, namelen);
return file_set_translator (np->nn->file,
FS_TRANS_EXCL|FS_TRANS_SET,
FS_TRANS_EXCL|FS_TRANS_SET, 0,