stat.c (b29e2679d0da91c60d3ac190d9c3bd65ac2f68c5) | stat.c (a7c1938e22c02b008655524c766d185ae99d9d53) |
---|---|
1/* 2 * linux/fs/stat.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 */ 6 7#include <linux/export.h> 8#include <linux/mm.h> --- 123 unchanged lines hidden (view full) --- 132 tmp.st_dev = old_encode_dev(stat->dev); 133 tmp.st_ino = stat->ino; 134 if (sizeof(tmp.st_ino) < sizeof(stat->ino) && tmp.st_ino != stat->ino) 135 return -EOVERFLOW; 136 tmp.st_mode = stat->mode; 137 tmp.st_nlink = stat->nlink; 138 if (tmp.st_nlink != stat->nlink) 139 return -EOVERFLOW; | 1/* 2 * linux/fs/stat.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 */ 6 7#include <linux/export.h> 8#include <linux/mm.h> --- 123 unchanged lines hidden (view full) --- 132 tmp.st_dev = old_encode_dev(stat->dev); 133 tmp.st_ino = stat->ino; 134 if (sizeof(tmp.st_ino) < sizeof(stat->ino) && tmp.st_ino != stat->ino) 135 return -EOVERFLOW; 136 tmp.st_mode = stat->mode; 137 tmp.st_nlink = stat->nlink; 138 if (tmp.st_nlink != stat->nlink) 139 return -EOVERFLOW; |
140 SET_UID(tmp.st_uid, stat->uid); 141 SET_GID(tmp.st_gid, stat->gid); | 140 SET_UID(tmp.st_uid, from_kuid_munged(current_user_ns(), stat->uid)); 141 SET_GID(tmp.st_gid, from_kgid_munged(current_user_ns(), stat->gid)); |
142 tmp.st_rdev = old_encode_dev(stat->rdev); 143#if BITS_PER_LONG == 32 144 if (stat->size > MAX_NON_LFS) 145 return -EOVERFLOW; 146#endif 147 tmp.st_size = stat->size; 148 tmp.st_atime = stat->atime.tv_sec; 149 tmp.st_mtime = stat->mtime.tv_sec; --- 60 unchanged lines hidden (view full) --- 210#endif 211 tmp.st_ino = stat->ino; 212 if (sizeof(tmp.st_ino) < sizeof(stat->ino) && tmp.st_ino != stat->ino) 213 return -EOVERFLOW; 214 tmp.st_mode = stat->mode; 215 tmp.st_nlink = stat->nlink; 216 if (tmp.st_nlink != stat->nlink) 217 return -EOVERFLOW; | 142 tmp.st_rdev = old_encode_dev(stat->rdev); 143#if BITS_PER_LONG == 32 144 if (stat->size > MAX_NON_LFS) 145 return -EOVERFLOW; 146#endif 147 tmp.st_size = stat->size; 148 tmp.st_atime = stat->atime.tv_sec; 149 tmp.st_mtime = stat->mtime.tv_sec; --- 60 unchanged lines hidden (view full) --- 210#endif 211 tmp.st_ino = stat->ino; 212 if (sizeof(tmp.st_ino) < sizeof(stat->ino) && tmp.st_ino != stat->ino) 213 return -EOVERFLOW; 214 tmp.st_mode = stat->mode; 215 tmp.st_nlink = stat->nlink; 216 if (tmp.st_nlink != stat->nlink) 217 return -EOVERFLOW; |
218 SET_UID(tmp.st_uid, stat->uid); 219 SET_GID(tmp.st_gid, stat->gid); | 218 SET_UID(tmp.st_uid, from_kuid_munged(current_user_ns(), stat->uid)); 219 SET_GID(tmp.st_gid, from_kgid_munged(current_user_ns(), stat->gid)); |
220#if BITS_PER_LONG == 32 221 tmp.st_rdev = old_encode_dev(stat->rdev); 222#else 223 tmp.st_rdev = new_encode_dev(stat->rdev); 224#endif 225#if BITS_PER_LONG == 32 226 if (stat->size > MAX_NON_LFS) 227 return -EOVERFLOW; --- 117 unchanged lines hidden (view full) --- 345 tmp.st_ino = stat->ino; 346 if (sizeof(tmp.st_ino) < sizeof(stat->ino) && tmp.st_ino != stat->ino) 347 return -EOVERFLOW; 348#ifdef STAT64_HAS_BROKEN_ST_INO 349 tmp.__st_ino = stat->ino; 350#endif 351 tmp.st_mode = stat->mode; 352 tmp.st_nlink = stat->nlink; | 220#if BITS_PER_LONG == 32 221 tmp.st_rdev = old_encode_dev(stat->rdev); 222#else 223 tmp.st_rdev = new_encode_dev(stat->rdev); 224#endif 225#if BITS_PER_LONG == 32 226 if (stat->size > MAX_NON_LFS) 227 return -EOVERFLOW; --- 117 unchanged lines hidden (view full) --- 345 tmp.st_ino = stat->ino; 346 if (sizeof(tmp.st_ino) < sizeof(stat->ino) && tmp.st_ino != stat->ino) 347 return -EOVERFLOW; 348#ifdef STAT64_HAS_BROKEN_ST_INO 349 tmp.__st_ino = stat->ino; 350#endif 351 tmp.st_mode = stat->mode; 352 tmp.st_nlink = stat->nlink; |
353 tmp.st_uid = stat->uid; 354 tmp.st_gid = stat->gid; | 353 tmp.st_uid = from_kuid_munged(current_user_ns(), stat->uid); 354 tmp.st_gid = from_kgid_munged(current_user_ns(), stat->gid); |
355 tmp.st_atime = stat->atime.tv_sec; 356 tmp.st_atime_nsec = stat->atime.tv_nsec; 357 tmp.st_mtime = stat->mtime.tv_sec; 358 tmp.st_mtime_nsec = stat->mtime.tv_nsec; 359 tmp.st_ctime = stat->ctime.tv_sec; 360 tmp.st_ctime_nsec = stat->ctime.tv_nsec; 361 tmp.st_size = stat->size; 362 tmp.st_blocks = stat->blocks; --- 109 unchanged lines hidden --- | 355 tmp.st_atime = stat->atime.tv_sec; 356 tmp.st_atime_nsec = stat->atime.tv_nsec; 357 tmp.st_mtime = stat->mtime.tv_sec; 358 tmp.st_mtime_nsec = stat->mtime.tv_nsec; 359 tmp.st_ctime = stat->ctime.tv_sec; 360 tmp.st_ctime_nsec = stat->ctime.tv_nsec; 361 tmp.st_size = stat->size; 362 tmp.st_blocks = stat->blocks; --- 109 unchanged lines hidden --- |