[iscsi-initiator-utils: 17/109] add static getpwuid workaround for iscsistart

Chris Leech cleech at fedoraproject.org
Tue Dec 10 21:20:47 UTC 2013


commit b8f42f24391cbf08b8d0c1d429eac851fe6b4c8e
Author: mchristi <mchristi at redhat.com>
Date:   Wed Jun 21 17:43:58 2006 +0000

    add static getpwuid workaround for iscsistart

 iscsi-initiator-utils.spec |    5 ++++-
 iscsistart-static.patch    |   36 ++++++++++++++++++++++++++++++++----
 2 files changed, 36 insertions(+), 5 deletions(-)
---
diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec
index f88fead..48fd2db 100644
--- a/iscsi-initiator-utils.spec
+++ b/iscsi-initiator-utils.spec
@@ -1,7 +1,7 @@
 Summary: iSCSI daemon and utility programs
 Name: iscsi-initiator-utils
 Version: 6.0.5.595
-Release: 1
+Release: 2
 Source0: http://people.redhat.com/mchristi/iscsi/FC6/open-iscsi/rpm/open-iscsi-%{version}.tar.bz2
 Source1: iscsi.init
 Patch0: open-iscsi-5.0.5.595-update-initscripts-and-docs.patch
@@ -76,6 +76,9 @@ fi
 %{_mandir}/*/*
 
 %changelog
+* Wed Jun 21 2006 Mike Christie <mchristi at redhat.com> - 6.0.5.595-2
+- add PatM's statics.c file. This is needed for boot since 
+  there is no getpwuid static available at that time.
 * Tue Jun 20 2006 Jeremy Katz <katzj at redhat.com> - 6.0.5.595-1
 - ensure that we respect %%{optflags}
 - cleaned up initscript to make use of standard functions, return right 
diff --git a/iscsistart-static.patch b/iscsistart-static.patch
index a9e1eed..96e1b7b 100644
--- a/iscsistart-static.patch
+++ b/iscsistart-static.patch
@@ -1,11 +1,39 @@
---- open-iscsi-6.0.5.595/usr/Makefile.static	2006-06-20 23:21:15.000000000 -0400
-+++ open-iscsi-6.0.5.595/usr/Makefile	2006-06-20 23:22:59.000000000 -0400
-@@ -51,7 +51,7 @@
+diff -Naurp open-iscsi-6.0.5.595/usr/Makefile open-iscsi-6.0.5.610.work/usr/Makefile
+--- open-iscsi-6.0.5.595/usr/Makefile	2006-06-21 12:32:51.000000000 -0500
++++ open-iscsi-6.0.5.610.work/usr/Makefile	2006-06-21 12:33:55.000000000 -0500
+@@ -50,8 +50,9 @@ iscsid: $(COMMON_SRCS) $(IPC_OBJ) $(INIT
+ iscsiadm: $(COMMON_SRCS) strings.o discovery.o iscsiadm.o
  	$(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@
  
- iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) iscsistart.o
+-iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) iscsistart.o
 -	$(CC) $(CFLAGS) $^ -o $@
++iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) iscsistart.o \
++		statics.o
 +	$(CC) -static $(CFLAGS) $^ -o $@
  
  clean:
  	rm -f *.o $(PROGRAMS)
+diff -Naurp open-iscsi-6.0.5.595/usr/statics.c open-iscsi-6.0.5.610.work/usr/statics.c
+--- open-iscsi-6.0.5.595/usr/statics.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-6.0.5.610.work/usr/statics.c	2006-06-21 12:30:05.000000000 -0500
+@@ -0,0 +1,20 @@
++#include <unistd.h>
++#include <pwd.h>
++#include <sys/errno.h>
++#include <sys/types.h>
++
++static struct passwd root_pw = {
++	.pw_name = "root",
++};
++
++struct passwd*
++getpwuid(uid_t uid)
++{
++	if (uid == 0)
++		return &root_pw;
++	else {
++		errno = ENOENT;
++		return 0;
++	}
++}
++


More information about the scm-commits mailing list