オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /trunk/1.5.x/ccs-patch/fs/sakura_mount.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 708 by kumaneko, Mon Nov 19 08:44:45 2007 UTC revision 722 by kumaneko, Thu Nov 22 04:09:54 2007 UTC
# Line 51  extern const char *ccs_log_level; Line 51  extern const char *ccs_log_level;
51  /***** The structure for mount restrictions. *****/  /***** The structure for mount restrictions. *****/
52    
53  struct mount_entry {  struct mount_entry {
54          struct list_head list;          struct list1_head list;
55          const struct path_info *dev_name;          const struct path_info *dev_name;
56          const struct path_info *dir_name;          const struct path_info *dir_name;
57          const struct path_info *fs_type;          const struct path_info *fs_type;
# Line 68  static void put_filesystem(struct file_s Line 68  static void put_filesystem(struct file_s
68  }  }
69  #endif  #endif
70    
71  static LIST_HEAD(mount_list);  static LIST1_HEAD(mount_list);
72    
73  static int AddMountACL(const char *dev_name, const char *dir_name, const char *fs_type, const unsigned long flags, const bool is_delete)  static int AddMountACL(const char *dev_name, const char *dir_name, const char *fs_type, const unsigned long flags, const bool is_delete)
74  {  {
# Line 86  static int AddMountACL(const char *dev_n Line 86  static int AddMountACL(const char *dev_n
86          if (!IsCorrectPath(dev_name, 0, 0, 0, __FUNCTION__) || !IsCorrectPath(dir_name, 1, 0, 1, __FUNCTION__)) return -EINVAL;          if (!IsCorrectPath(dev_name, 0, 0, 0, __FUNCTION__) || !IsCorrectPath(dir_name, 1, 0, 1, __FUNCTION__)) return -EINVAL;
87          if ((dev = SaveName(dev_name)) == NULL || (dir = SaveName(dir_name)) == NULL) return -ENOMEM;          if ((dev = SaveName(dev_name)) == NULL || (dir = SaveName(dir_name)) == NULL) return -ENOMEM;
88          mutex_lock(&lock);          mutex_lock(&lock);
89          list_for_each_entry(ptr, &mount_list, list) {          list1_for_each_entry(ptr, &mount_list, list) {
90                  if (ptr->flags != flags || pathcmp(ptr->dev_name, dev) || pathcmp(ptr->dir_name, dir) || pathcmp(ptr->fs_type, fs)) continue;                  if (ptr->flags != flags || pathcmp(ptr->dev_name, dev) || pathcmp(ptr->dir_name, dir) || pathcmp(ptr->fs_type, fs)) continue;
91                  error = 0;                  error = 0;
92                  if (is_delete) {                  if (is_delete) {
# Line 109  static int AddMountACL(const char *dev_n Line 109  static int AddMountACL(const char *dev_n
109          new_entry->dir_name = dir;          new_entry->dir_name = dir;
110          new_entry->fs_type = fs;          new_entry->fs_type = fs;
111          new_entry->flags = flags;          new_entry->flags = flags;
112          list_add_tail_mb(&new_entry->list, &mount_list);          list1_add_tail_mb(&new_entry->list, &mount_list);
113          error = 0;          error = 0;
114          ptr = new_entry;          ptr = new_entry;
115   update:   update:
# Line 230  static int CheckMountPermission2(char *d Line 230  static int CheckMountPermission2(char *d
230                          error = -ENODEV;                          error = -ENODEV;
231                          goto cleanup;                          goto cleanup;
232                  }                  }
233                  list_for_each_entry(ptr, &mount_list, list) {                  list1_for_each_entry(ptr, &mount_list, list) {
234                          if (ptr->is_deleted) continue;                          if (ptr->is_deleted) continue;
235                                                    
236                          /* Compare options */                          /* Compare options */
# Line 320  int AddMountPolicy(char *data, const boo Line 320  int AddMountPolicy(char *data, const boo
320    
321  int ReadMountPolicy(struct io_buffer *head)  int ReadMountPolicy(struct io_buffer *head)
322  {  {
323          struct list_head *pos;          struct list1_head *pos;
324          list_for_each_cookie(pos, head->read_var2, &mount_list) {          list1_for_each_cookie(pos, head->read_var2, &mount_list) {
325                  struct mount_entry *ptr;                  struct mount_entry *ptr;
326                  ptr = list_entry(pos, struct mount_entry, list);                  ptr = list1_entry(pos, struct mount_entry, list);
327                  if (ptr->is_deleted) continue;                  if (ptr->is_deleted) continue;
328                  if (io_printf(head, KEYWORD_ALLOW_MOUNT "%s %s %s 0x%lX\n", ptr->dev_name->name, ptr->dir_name->name, ptr->fs_type->name, ptr->flags)) return -ENOMEM;                  if (io_printf(head, KEYWORD_ALLOW_MOUNT "%s %s %s 0x%lX\n", ptr->dev_name->name, ptr->dir_name->name, ptr->fs_type->name, ptr->flags)) return -ENOMEM;
329          }          }

Legend:
Removed from v.708  
changed lines
  Added in v.722

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26