57 lines
2.0 KiB
Diff
57 lines
2.0 KiB
Diff
diff -urp cpio-2.9.90-orig/src/extern.h cpio-2.9.90/src/extern.h
|
||
--- cpio-2.9.90-orig/src/extern.h 2008-08-25 16:42:48.000000000 +0200
|
||
+++ cpio-2.9.90/src/extern.h 2009-02-10 16:29:34.000000000 +0100
|
||
@@ -96,6 +96,7 @@ extern char input_is_special;
|
||
extern char output_is_special;
|
||
extern char input_is_seekable;
|
||
extern char output_is_seekable;
|
||
+extern mode_t sys_umask;
|
||
extern int (*xstat) ();
|
||
extern void (*copy_function) ();
|
||
|
||
diff -urp cpio-2.9.90-orig/src/global.c cpio-2.9.90/src/global.c
|
||
--- cpio-2.9.90-orig/src/global.c 2007-06-28 12:54:11.000000000 +0200
|
||
+++ cpio-2.9.90/src/global.c 2009-02-10 16:34:41.000000000 +0100
|
||
@@ -187,6 +187,9 @@ bool to_stdout_option = false;
|
||
/* The name this program was run with. */
|
||
char *program_name;
|
||
|
||
+/* Make the -d option honor the umask. */
|
||
+mode_t sys_umask;
|
||
+
|
||
/* A pointer to either lstat or stat, depending on whether
|
||
dereferencing of symlinks is done for input files. */
|
||
int (*xstat) ();
|
||
diff -urp cpio-2.9.90-orig/src/main.c cpio-2.9.90/src/main.c
|
||
--- cpio-2.9.90-orig/src/main.c 2008-08-25 16:42:48.000000000 +0200
|
||
+++ cpio-2.9.90/src/main.c 2009-02-10 17:44:47.000000000 +0100
|
||
@@ -790,6 +790,7 @@ main (int argc, char *argv[])
|
||
set_program_name (argv[0]);
|
||
argp_version_setup ("cpio", program_authors);
|
||
process_args (argc, argv);
|
||
+ sys_umask = umask(0);
|
||
|
||
initialize_buffers ();
|
||
|
||
diff -urp cpio-2.9.90-orig/src/util.c cpio-2.9.90/src/util.c
|
||
--- cpio-2.9.90-orig/src/util.c 2008-08-25 16:42:48.000000000 +0200
|
||
+++ cpio-2.9.90/src/util.c 2009-02-10 17:46:35.000000000 +0100
|
||
@@ -605,7 +605,7 @@ create_all_directories (char *name)
|
||
#endif
|
||
|
||
dir = dir_name (name);
|
||
- mode = 0700;
|
||
+ mode = 0777 & ~ (sys_umask);
|
||
#ifdef HPUX_CDF
|
||
cdf = islastparentcdf (name);
|
||
if (cdf)
|
||
@@ -620,7 +620,7 @@ create_all_directories (char *name)
|
||
error (2, 0, _("virtual memory exhausted"));
|
||
|
||
if (dir[0] != '.' || dir[1] != '\0')
|
||
- make_path (dir, mode, 0700, -1, -1, (char *) NULL);
|
||
+ make_path (dir, mode, 0777 & ~(sys_umask), -1, -1, (char *) NULL);
|
||
|
||
free (dir);
|
||
}
|