Репозитории ALT
S: | 0.2.2-alt11 |
5.1: | 0.2.2-alt2 |
4.1: | 0.2.2-alt1 |
4.0: | 0.2.0-alt6.1 |
3.0: | 0.2.0-alt6 |
Группа :: Работа с файлами
Пакет: e2fsimage
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: e2fsimage-0.2.0-directory-permissions.patch
Скачать
Скачать
diff -ur e2fsimage-0.2.0/src/copy.c e2fsimage-0.2.0.perms/src/copy.c
--- e2fsimage-0.2.0/src/copy.c 2004-03-12 17:20:17 +0300
+++ e2fsimage-0.2.0.perms/src/copy.c 2004-11-23 16:46:59 +0300
@@ -116,7 +116,7 @@
/* if this sizes differ its an inconsistency in the base filesystem */
if (s.st_size != size) {
- fprintf(stderr, "Error 'size matters' Inode:%ld, File:%ld\n", s.st_size, size);
+ fprintf(stderr, "Error 'size matters' for %s Inode:%ld, File:%ld\n",e2c->curr_path, s.st_size, size);
return -1;
}
diff -ur e2fsimage-0.2.0/src/mkdir.c e2fsimage-0.2.0.perms/src/mkdir.c
--- e2fsimage-0.2.0/src/mkdir.c 2004-03-12 17:20:17 +0300
+++ e2fsimage-0.2.0.perms/src/mkdir.c 2004-12-02 17:34:46 +0300
@@ -54,6 +54,7 @@
struct stat s;
const char *dname;
ext2_ino_t nd;
+ struct ext2_inode inode;
ret = lstat(e2c->curr_path, &s);
ERRNO_ERR(ret,"Could not 'stat': ", e2c->curr_path);
@@ -84,7 +85,17 @@
/* lookup the inode of the new directory if requested */
ret = ext2fs_lookup(e2c->fs, e2c->curr_e2dir, dname, strlen(dname), 0, &nd);
E2_ERR(ret, "Could not Ext2-lookup: ", dname);
-
+ // fix permissions
+ ret = ext2fs_read_inode(e2c->fs, nd, &inode);
+ E2_ERR(ret, "Ext2 read Inode Error", "");
+
+ inode.i_uid = s.st_uid;
+ inode.i_gid = s.st_gid;
+ inode.i_mode = s.st_mode;
+ ret = ext2fs_write_inode(e2c->fs, nd, &inode);
+ E2_ERR(ret, "Ext2 write Inode Error", "");
+
+
modinode(e2c, dname, nd);
if (newdir) {