From c4f4944e39f84ae0c4936a24e20337ab2ca6157c Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Sat, 25 Aug 2007 00:04:28 +0000 Subject: [PATCH] - Update license tag - Fix up O_CREAT opens with no mode - Add gawk to buildrequires --- fix-open-O_CREAT-perms.patch | 120 +++++++++++++++++++++++++++++++++++ xfsdump.spec | 8 ++- 2 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 fix-open-O_CREAT-perms.patch diff --git a/fix-open-O_CREAT-perms.patch b/fix-open-O_CREAT-perms.patch new file mode 100644 index 0000000..4133ee3 --- /dev/null +++ b/fix-open-O_CREAT-perms.patch @@ -0,0 +1,120 @@ +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; + } + diff --git a/xfsdump.spec b/xfsdump.spec index 58f52ec..888adbf 100644 --- a/xfsdump.spec +++ b/xfsdump.spec @@ -9,10 +9,11 @@ Group: System Environment/Base URL: http://oss.sgi.com/projects/xfs/ Source0: ftp://oss.sgi.com/projects/xfs/download/cmd_tars/%{name}_%{version}-1.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: autoconf, libtool, gettext +BuildRequires: autoconf, libtool, gettext, gawk BuildRequires: xfsprogs-devel, e2fsprogs-devel, libattr-devel ncurses-devel Requires: xfsprogs >= 2.6.30, attr >= 2.0.0 +Patch1: fix-open-O_CREAT-perms.patch %description The xfsdump package contains xfsdump, xfsrestore and a number of @@ -33,6 +34,7 @@ subtrees may be restored from full or partial backups. %prep %setup -q +%patch1 -p1 %build autoconf @@ -62,8 +64,10 @@ rm -rf $RPM_BUILD_ROOT /sbin/* %changelog -* Thu Aug 16 2007 Eric Sandeen - 2.2.45-3 +* Fri Aug 24 2007 Eric Sandeen - 2.2.45-3 - Update license tag +- Fix up O_CREAT opens with no mode +- Add gawk to buildrequires * Tue Jun 19 2007 Eric Sandeen - 2.2.45-2 - Remove readline-devel & libtermcap-devel BuildRequires