add static getpwuid workaround for iscsistart

This commit is contained in:
mchristi 2006-06-21 17:43:58 +00:00
parent ae8f3d08fe
commit b8f42f2439
2 changed files with 36 additions and 5 deletions

View File

@ -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@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@redhat.com> - 6.0.5.595-1
- ensure that we respect %%{optflags}
- cleaned up initscript to make use of standard functions, return right

View File

@ -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;
+ }
+}
+