xfsdump/fix-open-O_CREAT-perms.patch
Eric Sandeen c4f4944e39 - Update license tag
- Fix up O_CREAT opens with no mode
- Add gawk to buildrequires
2007-08-25 00:04:28 +00:00

121 lines
4.2 KiB
Diff

Index: xfsdump/inventory/inv_fstab.c
===================================================================
RCS file: /cvs/xfs-cmds/xfsdump/inventory/inv_fstab.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- xfsdump/inventory/inv_fstab.c 24 May 2006 06:08:55 -0000 1.8
+++ xfsdump/inventory/inv_fstab.c 24 Aug 2007 19:36:15 -0000 1.9
@@ -96,7 +96,7 @@
if ( errno != ENOENT ) {
return -1;
}
- if ((fd = open( INV_FSTAB, INV_OFLAG(forwhat) | O_CREAT ))
+ if ((fd = open( INV_FSTAB, INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR ))
< 0 ) {
INV_PERROR ( INV_FSTAB );
return -1;
Index: xfsdump/inventory/inv_idx.c
===================================================================
RCS file: /cvs/xfs-cmds/xfsdump/inventory/inv_idx.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- xfsdump/inventory/inv_idx.c 24 May 2006 06:08:55 -0000 1.8
+++ xfsdump/inventory/inv_idx.c 24 Aug 2007 19:36:15 -0000 1.9
@@ -257,7 +257,7 @@
the db for SEARCH_ONLY. */
ASSERT( forwhat != INV_SEARCH_ONLY );
- if ((fd = open ( fname , INV_OFLAG(forwhat) | O_CREAT ) ) < 0 ) {
+ if ((fd = open ( fname , INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR ) ) < 0 ) {
INV_PERROR ( fname );
return INV_TOKEN_NULL;
}
Index: xfsdump/inventory/inv_mgr.c
===================================================================
RCS file: /cvs/xfs-cmds/xfsdump/inventory/inv_mgr.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- xfsdump/inventory/inv_mgr.c 24 May 2006 06:08:55 -0000 1.10
+++ xfsdump/inventory/inv_mgr.c 24 Aug 2007 19:36:15 -0000 1.11
@@ -692,7 +692,7 @@
{
if ( invlock_fd == -1 ) {
if (( invlock_fd = open( INV_LOCKFILE,
- O_RDONLY | O_CREAT )) < 0 ) {
+ O_RDONLY | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
INV_PERROR( INV_LOCKFILE );
return BOOL_FALSE;
}
Index: xfsdump/inventory/inv_oref.c
===================================================================
RCS file: /cvs/xfs-cmds/xfsdump/inventory/inv_oref.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- xfsdump/inventory/inv_oref.c 24 May 2006 06:08:55 -0000 1.8
+++ xfsdump/inventory/inv_oref.c 24 Aug 2007 19:36:15 -0000 1.9
@@ -429,7 +429,7 @@
int stobjfd, fd;
inv_idbtoken_t tok;
- if ((fd = open ( fname , O_RDWR | O_CREAT ) ) < 0 ) {
+ if ((fd = open ( fname , O_RDWR | O_CREAT, S_IRUSR|S_IWUSR ) ) < 0 ) {
INV_PERROR ( fname );
return INV_ERR;
}
Index: xfsdump/inventory/inv_stobj.c
===================================================================
RCS file: /cvs/xfs-cmds/xfsdump/inventory/inv_stobj.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- xfsdump/inventory/inv_stobj.c 24 May 2006 06:08:55 -0000 1.12
+++ xfsdump/inventory/inv_stobj.c 24 Aug 2007 19:36:15 -0000 1.13
@@ -527,7 +527,7 @@
#endif
/* create the new storage object */
- if (( fd = open( fname, INV_OFLAG(forwhat) | O_EXCL | O_CREAT )) < 0 ) {
+ if (( fd = open( fname, INV_OFLAG(forwhat) | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
INV_PERROR ( fname );
memset( fname, 0, INV_STRLEN );
return -1;
@@ -1083,7 +1083,7 @@
#ifdef INVT_DELETION
{
- int tmpfd = open( "moids", O_RDWR | O_CREAT );
+ int tmpfd = open( "moids", O_RDWR | O_CREAT, S_IRUSR|S_IWUSR );
u_int j;
invt_mediafile_t *mmf = s->mfiles;
for (i=0; i< s->ses->s_cur_nstreams; i++ ) {
Index: xfsdump/invutil/invidx.c
===================================================================
RCS file: /cvs/xfs-cmds/xfsdump/invutil/invidx.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- xfsdump/invutil/invidx.c 24 May 2006 06:08:55 -0000 1.7
+++ xfsdump/invutil/invidx.c 24 Aug 2007 19:36:15 -0000 1.8
@@ -275,7 +275,7 @@
return 0;
}
- new_fd = open(dst_idxfile, O_CREAT|O_RDWR);
+ new_fd = open(dst_idxfile, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR);
if(new_fd < 0) {
put_error("Error: unable to open inventory index file");
return 0;
@@ -616,7 +616,7 @@
invt_sescounter_t sescnt;
/* create the new storage object */
- if (( fd = open( fname, O_RDWR | O_EXCL | O_CREAT )) < 0 ) {
+ if (( fd = open( fname, O_RDWR | O_EXCL | O_CREAT, S_IRUSR|S_IWUSR )) < 0 ) {
return -1;
}