[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/4] Set an appropriate st_mode on symlinks.
From: |
Jeremie Koenig |
Subject: |
[PATCH 3/4] Set an appropriate st_mode on symlinks. |
Date: |
Fri, 13 Aug 2010 19:05:14 +0200 |
---
procfs_pid_files.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/procfs_pid_files.c b/procfs_pid_files.c
index 3008145..548497c 100644
--- a/procfs_pid_files.c
+++ b/procfs_pid_files.c
@@ -49,7 +49,16 @@ update_pid_entries (struct procfs_dir *dir, const char *name,
struct stat stat;
memset (&stat, 0, sizeof stat);
- stat->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH;
+ if (symlink_target)
+ {
+ stat.st_size = strlen (symlink_target) : 0;
+ stat.st_mode = S_IFLNK | 0777;
+ }
+ else
+ {
+ stat.st_size = 0;
+ stat.st_mode = S_IFREG | 0444;
+ }
return update_entries_list (dir, name, &stat, timestamp, symlink_target);
}
--
1.7.1
- [PATCH 1/2] Fix /proc/*/cmdline., Jeremie Koenig, 2010/08/13
- [PATCH 2/2] Implement some (global) symlinks., Jeremie Koenig, 2010/08/13
- Re: [PATCH 1/2] Fix /proc/*/cmdline., olafBuddenhagen, 2010/08/13
- [PATCH 2/4] update_pid_entries(): fix awkwardly indented uninitialized memory leak, Jeremie Koenig, 2010/08/13
- [PATCH 3/4] Set an appropriate st_mode on symlinks.,
Jeremie Koenig <=
- Re: [PATCH 3/4] Set an appropriate st_mode on symlinks., olafBuddenhagen, 2010/08/15
- Re: [PATCH 3/4] Set an appropriate st_mode on symlinks., Jeremie Koenig, 2010/08/15
- [PATCH 4/4] Implement /proc/cmdline and /proc/mounts as symlinks., Jeremie Koenig, 2010/08/13
- Re: [PATCH 4/4] Implement /proc/cmdline and /proc/mounts as symlinks., olafBuddenhagen, 2010/08/15
- Re: [PATCH 1/2] Fix /proc/*/cmdline., olafBuddenhagen, 2010/08/15
Updated procfs series, Jeremie Koenig, 2010/08/16
[PATCH 1/5] Fix /proc/*/cmdline, Jeremie Koenig, 2010/08/16
[PATCH 4/5] Implement /proc/cmdline as a symlinks to 2/cmdline, Jeremie Koenig, 2010/08/16