ext2fs_is_fast_symlink@Base 1.44.0~rc1
ext2fs_journal_sb_start@Base 1.42.12
ext2fs_link@Base 1.37
- ext2fs_list_backups@Base 1.47.1~rc1
+ Ext2fs_list_backups@Base 1.47.1~rc1
ext2fs_llseek@Base 1.37
ext2fs_lookup@Base 1.37
ext2fs_make_generic_bitmap@Base 1.41.0
ext2fs_rewrite_to_io@Base 1.37
ext2fs_rw_bitmaps@Base 1.46.0
ext2fs_set_alloc_block_callback@Base 1.41.0
+ ext2fs_safe_getenv@Base 1.47.1~rc1
ext2fs_set_bit64@Base 1.42
ext2fs_set_bit@Base 1.37
ext2fs_set_bitmap_padding@Base 1.37
gen_bitmap64.o \
get_num_dirs.o \
get_pathname.o \
+ getenv.o \
getsize.o \
getsectsize.o \
hashmap.o \
$(srcdir)/gen_bitmap64.c \
$(srcdir)/get_num_dirs.c \
$(srcdir)/get_pathname.c \
+ $(srcdir)/getenv.c \
$(srcdir)/getsize.c \
$(srcdir)/getsectsize.c \
$(srcdir)/hashmap.c \
$(srcdir)/ext2_fs.h $(srcdir)/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \
$(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(srcdir)/ext2_ext_attr.h $(srcdir)/hashmap.h $(srcdir)/bitops.h
+getenv.o: $(srcdir)/getenv.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/ext2fs.h \
+ $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/ext2_fs.h \
+ $(srcdir)/ext3_extents.h $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/ext2_ext_attr.h \
+ $(srcdir)/hashmap.h $(srcdir)/bitops.h
getsize.o: $(srcdir)/getsize.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/ext2_fs.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/ext2fs.h \
$(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(srcdir)/ext2_ext_attr.h $(srcdir)/hashmap.h $(srcdir)/bitops.h \
$(srcdir)/e2image.h
+orphan.o: $(srcdir)/orphan.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/ext2_fs.h \
+ $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/ext2fsP.h \
+ $(srcdir)/ext2fs.h $(srcdir)/ext2_fs.h $(srcdir)/ext3_extents.h \
+ $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/ext2_ext_attr.h \
+ $(srcdir)/hashmap.h $(srcdir)/bitops.h
progress.o: $(srcdir)/progress.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/ext2fs.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/ext2_fs.h \
$(top_srcdir)/lib/support/dqblk_v2.h \
$(top_srcdir)/lib/support/quotaio_tree.h
create_inode.o: $(top_srcdir)/misc/create_inode.c \
- $(top_srcdir)/misc/create_inode_libarchive.c \
$(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
$(srcdir)/ext2fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(srcdir)/ext2_fs.h $(srcdir)/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \
$(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(srcdir)/ext2_ext_attr.h $(srcdir)/hashmap.h $(srcdir)/bitops.h \
$(srcdir)/fiemap.h $(top_srcdir)/misc/create_inode.h \
- $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/nls-enable.h
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/nls-enable.h \
+ $(top_srcdir)/misc/create_inode_libarchive.h
create_inode_libarchive.o: $(top_srcdir)/misc/create_inode_libarchive.c \
- $(top_srcdir)/misc/create_inode_libarchive.c \
$(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
- $(srcdir)/ext2fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
- $(srcdir)/ext2_fs.h $(srcdir)/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/misc/create_inode.h \
+ $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/e2p/e2p.h \
+ $(srcdir)/ext2_fs.h $(srcdir)/ext2fs.h $(srcdir)/ext3_extents.h \
$(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(srcdir)/ext2_ext_attr.h $(srcdir)/hashmap.h $(srcdir)/bitops.h \
- $(srcdir)/fiemap.h $(top_srcdir)/misc/create_inode.h \
- $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/nls-enable.h
+ $(top_srcdir)/misc/create_inode_libarchive.h \
+ $(top_srcdir)/lib/support/nls-enable.h
journal.o: $(top_srcdir)/debugfs/journal.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/debugfs/journal.h \
$(srcdir)/../../e2fsck/jfs_user.h $(srcdir)/ext2_fs.h \
extern unsigned int ext2fs_list_backups(ext2_filsys fs, unsigned int *three,
unsigned int *five, unsigned int *seven);
+/* getenv.c */
+extern char *ext2fs_safe_getenv(const char *arg);
+
/* get_num_dirs.c */
extern errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ext2_ino_t *ret_num_dirs);
return;
#ifdef ENABLE_BMAP_STATS
- if (getenv("E2FSPROGS_BITMAP_STATS")) {
+ if (ext2fs_safe_getenv("E2FSPROGS_BITMAP_STATS")) {
ext2fs_print_bmap_statistics(bmap);
bmap->bitmap_ops->print_stats(bmap);
}
fs->flags |= EXT2_FLAG_SWAP_BYTES;
#endif
- time_env = getenv("E2FSPROGS_FAKE_TIME");
+ time_env = ext2fs_safe_getenv("E2FSPROGS_FAKE_TIME");
if (time_env)
fs->now = strtoul(time_env, NULL, 0);
if ((f = setmntent (mtab_file, "r")) == NULL) {
if (errno == ENOENT) {
- if (getenv("EXT2FS_NO_MTAB_OK"))
+ if (ext2fs_safe_getenv("EXT2FS_NO_MTAB_OK"))
return 0;
else
return EXT2_ET_NO_MTAB_FILE;
errcode_t retval = 0;
int busy = 0;
- if (getenv("EXT2FS_PRETEND_RO_MOUNT")) {
+ if (ext2fs_safe_getenv("EXT2FS_PRETEND_RO_MOUNT")) {
*mount_flags = EXT2_MF_MOUNTED | EXT2_MF_READONLY;
- if (getenv("EXT2FS_PRETEND_ROOTFS"))
+ if (ext2fs_safe_getenv("EXT2FS_PRETEND_ROOTFS"))
*mount_flags = EXT2_MF_ISROOT;
return 0;
}
- if (getenv("EXT2FS_PRETEND_RW_MOUNT")) {
+ if (ext2fs_safe_getenv("EXT2FS_PRETEND_RW_MOUNT")) {
*mount_flags = EXT2_MF_MOUNTED;
- if (getenv("EXT2FS_PRETEND_ROOTFS"))
+ if (ext2fs_safe_getenv("EXT2FS_PRETEND_ROOTFS"))
*mount_flags = EXT2_MF_ISROOT;
return 0;
}
fs->flags |= EXT2_FLAG_MASTER_SB_ONLY;
fs->umask = 022;
- time_env = getenv("E2FSPROGS_FAKE_TIME");
+ time_env = ext2fs_safe_getenv("E2FSPROGS_FAKE_TIME");
if (time_env)
fs->now = strtoul(time_env, NULL, 0);
backspaces[sizeof(backspaces)-1] = 0;
memset(progress, 0, sizeof(*progress));
- if (getenv("E2FSPROGS_SKIP_PROGRESS"))
+ if (ext2fs_safe_getenv("E2FSPROGS_SKIP_PROGRESS"))
progress->skip_progress++;
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef HAVE_SYS_PRCTL_H
-#include <sys/prctl.h>
-#else
-#define PR_GET_DUMPABLE 3
-#endif
-#if (!defined(HAVE_PRCTL) && defined(linux))
-#include <sys/syscall.h>
-#endif
#include "ext2_fs.h"
#include "ext2fs.h"
abort();
}
-static char *safe_getenv(const char *arg)
-{
-#if !defined(_WIN32)
- if ((getuid() != geteuid()) || (getgid() != getegid()))
- return NULL;
-#endif
-#if HAVE_PRCTL
- if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 0)
- return NULL;
-#else
-#if (defined(linux) && defined(SYS_prctl))
- if (syscall(SYS_prctl, PR_GET_DUMPABLE, 0, 0, 0, 0) == 0)
- return NULL;
-#endif
-#endif
-
-#if defined(HAVE_SECURE_GETENV)
- return secure_getenv(arg);
-#elif defined(HAVE___SECURE_GETENV)
- return __secure_getenv(arg);
-#else
- return getenv(arg);
-#endif
-}
-
static errcode_t test_open(const char *name, int flags, io_channel *channel)
{
io_channel io = NULL;
data->write_blk64 = test_io_cb_write_blk64;
data->outfile = NULL;
- if ((value = safe_getenv("TEST_IO_LOGFILE")) != NULL)
+ if ((value = ext2fs_safe_getenv("TEST_IO_LOGFILE")) != NULL)
data->outfile = fopen(value, "w");
if (!data->outfile)
data->outfile = stderr;
data->flags = 0;
- if ((value = safe_getenv("TEST_IO_FLAGS")) != NULL)
+ if ((value = ext2fs_safe_getenv("TEST_IO_FLAGS")) != NULL)
data->flags = strtoul(value, NULL, 0);
data->block = 0;
- if ((value = safe_getenv("TEST_IO_BLOCK")) != NULL)
+ if ((value = ext2fs_safe_getenv("TEST_IO_BLOCK")) != NULL)
data->block = strtoul(value, NULL, 0);
data->read_abort_count = 0;
- if ((value = safe_getenv("TEST_IO_READ_ABORT")) != NULL)
+ if ((value = ext2fs_safe_getenv("TEST_IO_READ_ABORT")) != NULL)
data->read_abort_count = strtoul(value, NULL, 0);
data->write_abort_count = 0;
- if ((value = safe_getenv("TEST_IO_WRITE_ABORT")) != NULL)
+ if ((value = ext2fs_safe_getenv("TEST_IO_WRITE_ABORT")) != NULL)
data->write_abort_count = strtoul(value, NULL, 0);
if (data->real) {
if (--channel->refcount > 0)
return 0;
/* Before closing write the file system identity */
- if (!getenv("UNDO_IO_SIMULATE_UNFINISHED"))
+ if (!ext2fs_safe_getenv("UNDO_IO_SIMULATE_UNFINISHED"))
data->hdr.state = ext2fs_cpu_to_le32(E2UNDO_STATE_FINISHED);
err = write_undo_indexes(data, 1);
ext2fs_remove_exit_fn(undo_atexit, data);
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
-#ifdef HAVE_SYS_PRCTL_H
-#include <sys/prctl.h>
-#else
-#define PR_GET_DUMPABLE 3
-#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
return retval;
}
-static char *safe_getenv(const char *arg)
-{
- if ((getuid() != geteuid()) || (getgid() != getegid()))
- return NULL;
-#ifdef HAVE_PRCTL
- if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 0)
- return NULL;
-#else
-#if (defined(linux) && defined(SYS_prctl))
- if (syscall(SYS_prctl, PR_GET_DUMPABLE, 0, 0, 0, 0) == 0)
- return NULL;
-#endif
-#endif
-
-#if defined(HAVE_SECURE_GETENV)
- return secure_getenv(arg);
-#elif defined(HAVE___SECURE_GETENV)
- return __secure_getenv(arg);
-#else
- return getenv(arg);
-#endif
-}
-
/*
* Here are the raw I/O functions
*/
struct utsname ut;
#endif
- if (safe_getenv("UNIX_IO_FORCE_BOUNCE"))
+ if (ext2fs_safe_getenv("UNIX_IO_FORCE_BOUNCE"))
flags |= IO_FLAG_FORCE_BOUNCE;
#ifdef __linux__
io->refcount = 1;
io->flags = 0;
- if (safe_getenv("UNIX_IO_NOZEROOUT"))
+ if (ext2fs_safe_getenv("UNIX_IO_NOZEROOUT"))
io->flags |= CHANNEL_FLAGS_NOZEROOUT;
memset(data, 0, sizeof(struct unix_private_data));