From 9398ccacf6df7ada571e3cac8ab3eaf3c3496713 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Fri, 27 Jun 2008 22:44:23 -0700 Subject: [PATCH] Stop using quilt to manage patches Remove the remaining patches that are managed through branches. Drop the build-dependency on quilt and don't run it during the build. Don't remove the afs-up man page in the clean target since it's done with Git now (although this will be reverted in a moment). --- debian/changelog | 2 + debian/control | 2 +- debian/patches/compiler-flags | 140 ------- debian/patches/find-core-files | 70 ---- debian/patches/ktc-prototypes | 24 -- debian/patches/module-name | 66 --- debian/patches/multiple-local-realms | 578 --------------------------- debian/patches/pam-build | 88 ---- debian/patches/ucontext-everywhere | 59 --- debian/rules | 10 +- 10 files changed, 6 insertions(+), 1033 deletions(-) delete mode 100644 debian/patches/compiler-flags delete mode 100644 debian/patches/find-core-files delete mode 100644 debian/patches/ktc-prototypes delete mode 100644 debian/patches/module-name delete mode 100644 debian/patches/multiple-local-realms delete mode 100644 debian/patches/pam-build delete mode 100644 debian/patches/ucontext-everywhere diff --git a/debian/changelog b/debian/changelog index 6aff5bbe5..2a6dce4de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,7 @@ openafs (1.4.7.dfsg1-3) UNRELEASED; urgency=low + * Stop using quilt to manage patches and pre-apply them to the source + package now that the package is maintained with Git. * Translation updates: - Galician, thanks Jacobo Tarrio. (Closes: #481675) diff --git a/debian/control b/debian/control index 890ae265c..a764eb4fe 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Sam Hartman Uploaders: Russ Allbery Build-Depends: debhelper (>= 5), libncurses5-dev, libpam0g-dev, bison, - flex, perl, comerr-dev, libkrb5-dev, autoconf, automake, quilt (>= 0.40) + flex, perl, comerr-dev, libkrb5-dev, autoconf, automake Standards-Version: 3.7.3 Homepage: http://www.openafs.org/ diff --git a/debian/patches/compiler-flags b/debian/patches/compiler-flags deleted file mode 100644 index 2adad334b..000000000 --- a/debian/patches/compiler-flags +++ /dev/null @@ -1,140 +0,0 @@ -Use $CC for the compiler instead of forcing cc or gcc and add -fPIC in -a few more places. The latter should be committed upstream. The former -is waiting for upstream work to separate the kernel compiler from the -userspace compiler, since $CC should only be used for the latter on other -platforms. - -Also combines the sparc sysnames together, which is suitable upstream. - ---- openafs.orig/src/cf/osconf.m4 -+++ openafs/src/cf/osconf.m4 -@@ -4,9 +4,8 @@ - dnl defaults, override in case below as needed - XCFLAGS='${DBG} ${OPTMZ}' - SHLIB_SUFFIX="so" --CC="cc" --CCOBJ="cc" --MT_CC="cc" -+CCOBJ=$CC -+MT_CC=$CC - XLIBS="${LIB_AFSDB}" - - dnl debugging and optimization flag defaults -@@ -318,8 +317,8 @@ - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' - MT_LIBS="-lpthread" - PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" -- SHLIB_LDFLAGS="-shared -Xlinker -x" - SHLIB_CFLAGS="-fPIC" -+ SHLIB_LDFLAGS="-shared -Xlinker -x" - TXLIBS="-lncurses" - XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE -fPIC" - YACC="bison -y" -@@ -327,9 +326,8 @@ - ;; - - i386_umlinux22) -- CC="gcc -pipe" -- CCOBJ="gcc -pipe" -- MT_CC="gcc -pipe" -+ CCOBJ="${CC} -pipe" -+ MT_CC="${CC} -pipe" - KERN_OPTMZ=-O2 - LEX="flex -l" - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' -@@ -344,9 +342,8 @@ - ;; - - i386_linux*) -- CC="gcc -pipe" -- CCOBJ="gcc -pipe" -- MT_CC="gcc -pipe" -+ CCOBJ="${CC} -pipe" -+ MT_CC="${CC} -pipe" - KERN_OPTMZ=-O2 - LEX="flex -l" - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' -@@ -365,9 +362,8 @@ - ;; - - i386_umlinux24) -- CC="gcc -pipe" -- CCOBJ="gcc -pipe" -- MT_CC="gcc -pipe" -+ CCOBJ="${CC} -pipe" -+ MT_CC="${CC} -pipe" - KERN_OPTMZ=-O2 - LEX="flex -l" - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' -@@ -386,9 +382,8 @@ - ;; - - i386_umlinux26) -- CC="gcc -pipe" -- CCOBJ="gcc -pipe" -- MT_CC="gcc -pipe" -+ CCOBJ="${CC} -pipe" -+ MT_CC="${CC} -pipe" - KERN_OPTMZ=-O2 - LEX="flex -l" - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' -@@ -601,8 +596,7 @@ - ;; - - s390_linux22) -- CC="gcc" -- CCOBJ="gcc" -+ CCOBJ="$CC" - LD="ld" - KERN_OPTMZ=-O2 - LEX="flex -l" -@@ -619,8 +613,7 @@ - ;; - - s390_linux24|s390_linux26) -- CC="gcc" -- CCOBJ="gcc" -+ CCOBJ="$CC" - LD="ld" - KERN_OPTMZ=-O2 - LEX="flex -l" -@@ -637,8 +630,7 @@ - ;; - - s390x_linux24|s390x_linux26) -- CC="gcc" -- CCOBJ="gcc -fPIC" -+ CCOBJ="$CC" - LD="ld" - KERN_OPTMZ=-O2 - LEX="flex -l" -@@ -716,7 +708,7 @@ - SHLIB_LINKER="${CC} -shared" - ;; - -- sparc64_linux*) -+ sparc*_linux*) - KERN_OPTMZ=-O2 - LEX="flex -l" - MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' -@@ -732,20 +724,6 @@ - SHLIB_LINKER="${MT_CC} -shared" - ;; - -- sparc_linux22) -- KERN_OPTMZ=-O2 -- LEX="flex -l" -- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' -- MT_LIBS="-lpthread" -- PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" -- SHLIB_CFLAGS="-fPIC" -- SHLIB_LDFLAGS="-shared -Xlinker -x" -- TXLIBS="-lncurses" -- XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" -- YACC="bison -y" -- SHLIB_LINKER="${MT_CC} -shared" -- ;; -- - sun4_413) - CCXPG2="/usr/xpg2bin/cc" - CC="gcc" diff --git a/debian/patches/find-core-files b/debian/patches/find-core-files deleted file mode 100644 index 0e0882317..000000000 --- a/debian/patches/find-core-files +++ /dev/null @@ -1,70 +0,0 @@ ---- openafs.orig/src/bozo/bnode.c -+++ openafs/src/bozo/bnode.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - #include - #include - #ifdef AFS_NT40_ENV -@@ -99,13 +100,45 @@ - char tbuffer[256]; - struct stat tstat; - register afs_int32 code; -+ char *corefile = NULL; - #ifdef BOZO_SAVE_CORES - struct timeval Start; - struct tm *TimeFields; - char FileName[256]; - #endif - -+ /* Linux always appends the PID to core dumps from threaded processes, so -+ * we have to scan the directory to find core files under another name. */ - code = stat(AFSDIR_SERVER_CORELOG_FILEPATH, &tstat); -+ if (code) { -+ DIR *logdir; -+ struct dirent *file; -+ char *p; -+ size_t length; -+ unsigned long pid; -+ -+ logdir = opendir(AFSDIR_LOGS_DIR); -+ if (logdir == NULL) -+ return; -+ while ((file = readdir(logdir)) != NULL) { -+ if (strncmp(file->d_name, "core.", 5) != 0) -+ continue; -+ pid = atol(file->d_name + 5); -+ if (pid == aproc->pid) { -+ length = strlen(AFSDIR_LOGS_DIR) + strlen(file->d_name) + 2; -+ corefile = malloc(length); -+ if (corefile == NULL) { -+ closedir(logdir); -+ return; -+ } -+ snprintf(corefile, length, "%s/%s", AFSDIR_LOGS_DIR, -+ file->d_name); -+ code = 0; -+ break; -+ } -+ } -+ closedir(logdir); -+ } - if (code) - return; - -@@ -118,7 +151,12 @@ - TimeFields->tm_hour, TimeFields->tm_min, TimeFields->tm_sec); - strcpy(tbuffer, FileName); - #endif -- code = renamefile(AFSDIR_SERVER_CORELOG_FILEPATH, tbuffer); -+ if (corefile == NULL) -+ code = renamefile(AFSDIR_SERVER_CORELOG_FILEPATH, tbuffer); -+ else { -+ code = renamefile(corefile, tbuffer); -+ free(corefile); -+ } - } - - int diff --git a/debian/patches/ktc-prototypes b/debian/patches/ktc-prototypes deleted file mode 100644 index 5e59a4534..000000000 --- a/debian/patches/ktc-prototypes +++ /dev/null @@ -1,24 +0,0 @@ -Expose prototypes for the ktc_* functions on platforms other than Windows. -Fixed upstream in a different way, but only on the 1.5 branch. - -Debian Bug#449432 - ---- openafs.orig/src/auth/auth.p.h -+++ openafs/src/auth/auth.p.h -@@ -24,7 +24,6 @@ - char ticket[MAXKTCTICKETLEN]; - }; - --#ifdef AFS_NT40_ENV - extern int ktc_SetToken(struct ktc_principal *server, struct ktc_token *token, - struct ktc_principal *client, afs_int32 flags); - -@@ -38,6 +37,8 @@ - - extern int ktc_ForgetAllTokens(void); - -+#ifdef AFS_NT40_ENV -+ - /* Flags for the flag word sent along with a token */ - #define PIOCTL_LOGON 0x1 /* invoked from integrated logon */ - diff --git a/debian/patches/module-name b/debian/patches/module-name deleted file mode 100644 index 8f13bcb96..000000000 --- a/debian/patches/module-name +++ /dev/null @@ -1,66 +0,0 @@ -Build the kernel module as openafs.ko instead of libafs.ko. This should -really be done upstream as well, but it poses backwards compatibility -problems and it's always been called libafs on other platforms, so it's -controversial. - ---- openafs.orig/src/config/linux-version -+++ openafs/src/config/linux-version -@@ -38,7 +38,7 @@ - CAN_BUILD="" - - for VERS in $LINUX_VERS ; do -- dir=$LINUX_SRCDIR$VERS -+ dir=$LINUX_SRCDIR - if [ ! -d $dir ] ; then - dir=$LINUX_SRCDIR - if [ ! -d $dir ] ; then -@@ -47,7 +47,7 @@ - continue - fi - fi -- header=$LINUX_SRCDIR$VERS/include/linux/version.h -+ header=$LINUX_SRCDIR/include/linux/version.h - if [ ! -f $header ] ; then - header=$LINUX_SRCDIR/include/linux/version.h - if [ ! -f $header ] ; then ---- openafs.orig/src/libafs/MakefileProto.LINUX.in -+++ openafs/src/libafs/MakefileProto.LINUX.in -@@ -222,8 +222,8 @@ - - # Below this line are targets when in the COMMON directory: - # For Linux there is no kernel NFS server. --LIBAFS = libafs-${CLIENT}.${LINUX_MODULE_EXT} --LIBAFS_MP = libafs-${CLIENT}.mp.${LINUX_MODULE_EXT} -+LIBAFS = openafs.${LINUX_MODULE_EXT} -+LIBAFS_MP = openafs.${LINUX_MODULE_EXT} - LIBAFS_EP = libafs-${CLIENT}.ep.${LINUX_MODULE_EXT} - LIBAFS_BM = libafs-${CLIENT}.bm.${LINUX_MODULE_EXT} - -@@ -232,10 +232,8 @@ - INST_LIBAFS_EP = ${DESTDIR}${afskerneldir}/${LIBAFS_EP} - INST_LIBAFS_BM = ${DESTDIR}${afskerneldir}/${LIBAFS_BM} - --DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS} --DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_MP} --DEST_LIBAFS_EP = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_EP} --DEST_LIBAFS_BM = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS_BM} -+DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/openafs.o -+DEST_LIBAFS_MP = ${DEST}/root.client/usr/vice/etc/modload/openafs.mp.o - - - libafs: $(LIBAFS) -@@ -251,11 +249,11 @@ - echo BM Build Complete - - --${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: libafs.ko -- cp libafs.ko $@ -+${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: openafs.ko -+ cp openafs.ko $@ - - .FORCE: --libafs.ko: .FORCE -+openafs.ko: .FORCE - env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common - env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_PATH} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules - diff --git a/debian/patches/multiple-local-realms b/debian/patches/multiple-local-realms deleted file mode 100644 index e3612c4b2..000000000 --- a/debian/patches/multiple-local-realms +++ /dev/null @@ -1,578 +0,0 @@ -Enable listing multiple realms in the server krb.conf file. Up to four -realms may be treated as local in that fashion for authorization -purposes (instead of the single realm supported without this patch). - -This upstream patch is in the 1.5 series but not in 1.4. However, it -has been working in production at Stanford University for some time. - ---- openafs.orig/src/audit/audit.c -+++ openafs/src/audit/audit.c -@@ -447,12 +447,43 @@ - } - if ((clen = strlen(tcell))) { - #if defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV) -- static char local_realm[AFS_REALM_SZ] = ""; -- if (!local_realm[0]) { -- if (afs_krb_get_lrealm(local_realm, 0) != 0 /*KSUCCESS*/) -- strncpy(local_realm, "UNKNOWN.LOCAL.REALM", AFS_REALM_SZ); -+ static char local_realms[AFS_NUM_LREALMS][AFS_REALM_SZ]; -+ static int num_lrealms = -1; -+ int i, lrealm_match; -+ -+ if (num_lrealms == -1) { -+ for (i=0; i= sizeof(vname)) - goto done; - strcat(vname, "@"); ---- openafs.orig/src/auth/userok.c -+++ openafs/src/auth/userok.c -@@ -382,7 +382,9 @@ - - afs_uint32 exp; - static char lcell[MAXCELLCHARS] = ""; -- static char lrealm[AFS_REALM_SZ] = ""; -+ static char lrealms[AFS_NUM_LREALMS][AFS_REALM_SZ]; -+ static int num_lrealms = -1; -+ int lrealm_match = 0, i; - - /* get auth details from server connection */ - code = -@@ -419,11 +421,40 @@ - /* if running a krb environment, also get the local realm */ - /* note - this assumes AFS_REALM_SZ <= MAXCELLCHARS */ - /* just set it to lcell if it fails */ -- if (!lrealm[0]) { -- if (afs_krb_get_lrealm(lrealm, 0) != 0) /* KSUCCESS */ -- strncpy(lrealm, lcell, AFS_REALM_SZ); -+ if (num_lrealms == -1) { -+ for (i=0; i"); - flag = 1; - -- /* cell of connection matches local cell or krb4 realm */ -- } else if (!strcasecmp(tcell, lcell) || !strcasecmp(tcell, lrealm)) { -+ /* cell of connection matches local cell or one of the realms */ -+ } else if (!strcasecmp(tcell, lcell) || lrealm_match) { - if ((tmp = CompFindUser(adir, tname, ".", tinst, NULL))) { - strcpy(uname, tmp); - flag = 1; -@@ -446,7 +477,6 @@ - flag = 1; - #endif - } -- - /* cell of conn doesn't match local cell or realm */ - } else { - if ((tmp = CompFindUser(adir, tname, ".", tinst, tcell))) { ---- openafs.orig/src/config/afs_sysnames.h -+++ openafs/src/config/afs_sysnames.h -@@ -291,4 +291,6 @@ - #ifdef AFS_KERBREALM_ENV - #define AFS_REALM_SZ 64 - #endif -+/* Specifies the number of equivalent local realm names */ -+#define AFS_NUM_LREALMS 4 - #endif /* __AFS_SYSNAMES_INCL_ENV_ */ ---- openafs.orig/src/ptserver/ptprocs.c -+++ openafs/src/ptserver/ptprocs.c -@@ -87,6 +87,7 @@ - extern afs_int32 Initdb(); - extern int pr_noAuth; - extern afs_int32 initd; -+extern char *pr_realmName; - afs_int32 iNewEntry(), newEntry(), whereIsIt(), dumpEntry(), addToGroup(), - nameToID(), Delete(), removeFromGroup(); - afs_int32 getCPS(), getCPS2(), getHostCPS(), listMax(), setMax(), listEntry(); -@@ -172,22 +173,9 @@ - if (exp < FT_ApproxTime()) - goto done; - #endif -- if (strlen(tcell)) { -- extern char *pr_realmName; --#if defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV) -- static char local_realm[AFS_REALM_SZ] = ""; -- if (!local_realm[0]) { -- if (afs_krb_get_lrealm(local_realm, 0) != 0 /*KSUCCESS*/) -- strncpy(local_realm, pr_realmName, AFS_REALM_SZ); -- } --#endif -- if ( --#if defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV) -- strcasecmp(local_realm, tcell) && --#endif -- strcasecmp(pr_realmName, tcell)) -- foreign = 1; -- } -+ if (tcell[0]) -+ foreign = afs_is_foreign_ticket_name(name,inst,tcell,pr_realmName); -+ - strncpy(vname, name, sizeof(vname)); - if (ilen = strlen(inst)) { - if (strlen(vname) + 1 + ilen >= sizeof(vname)) -@@ -634,7 +622,24 @@ - ABORT_WITH(tt, code); - - for (i = 0; i < aname->namelist_len; i++) { -- code = NameToID(tt, aname->namelist_val[i], &aid->idlist_val[i]); -+ char vname[256]; -+ char *nameinst, *cell; -+ -+ strncpy(vname, aname->namelist_val[i], sizeof(vname)); -+ vname[sizeof(vname)-1] ='\0'; -+ -+ nameinst = vname; -+ cell = strchr(vname, '@'); -+ if (cell) { -+ *cell = '\0'; -+ cell++; -+ } -+ -+ if (cell && afs_is_foreign_ticket_name(nameinst,NULL,cell,pr_realmName)) -+ code = NameToID(tt, aname->namelist_val[i], &aid->idlist_val[i]); -+ else -+ code = NameToID(tt, nameinst, &aid->idlist_val[i]); -+ - if (code != PRSUCCESS) - aid->idlist_val[i] = ANONYMOUSID; - osi_audit(PTS_NmToIdEvent, code, AUD_STR, -@@ -2275,7 +2280,6 @@ - } - #endif /* IP_WILDCARDS */ - -- - afs_int32 - WhoIsThisWithName(acall, at, aid, aname) - struct rx_call *acall; -@@ -2303,11 +2307,12 @@ - } else if (code == 2) { /* kad class */ - - int clen; -- extern char *pr_realmName; - - if ((code = rxkad_GetServerInfo(acall->conn, NULL, 0 /*was &exp */ , - name, inst, tcell, NULL))) - goto done; -+ -+ - strncpy(vname, name, sizeof(vname)); - if ((ilen = strlen(inst))) { - if (strlen(vname) + 1 + ilen >= sizeof(vname)) -@@ -2316,19 +2321,9 @@ - strcat(vname, inst); - } - if ((clen = strlen(tcell))) { -+ int foreign = afs_is_foreign_ticket_name(name,inst,tcell,pr_realmName); - --#if defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV) -- static char local_realm[AFS_REALM_SZ] = ""; -- if (!local_realm[0]) { -- if (afs_krb_get_lrealm(local_realm, 0) != 0 /*KSUCCESS*/) -- strncpy(local_realm, pr_realmName, AFS_REALM_SZ); -- } --#endif -- if ( --#if defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV) -- strcasecmp(local_realm, tcell) && --#endif -- strcasecmp(pr_realmName, tcell)) { -+ if (foreign) { - if (strlen(vname) + 1 + clen >= sizeof(vname)) - goto done; - strcat(vname, "@"); ---- openafs.orig/src/util/afsutil_prototypes.h -+++ openafs/src/util/afsutil_prototypes.h -@@ -74,7 +74,8 @@ - - /* get_krbrlm.c */ - extern int afs_krb_get_lrealm(char *r, int n); -- -+extern int afs_krb_exclusion(char *name); -+extern int afs_is_foreign_ticket_name(char *tname, char *tinst, char * tcell, char *localrealm); - /* hostparse.c */ - extern struct hostent *hostutil_GetHostByName(register char *ahost); - extern char *hostutil_GetNameByINet(afs_uint32 addr); ---- openafs.orig/src/util/dirpath.c -+++ openafs/src/util/dirpath.c -@@ -365,6 +365,8 @@ - pathp = dirPathArray[AFSDIR_SERVER_MIGRATELOG_FILEPATH_ID]; - AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_MIGR_DIR, AFSDIR_MIGRATE_LOGNAME); - -+ pathp = dirPathArray[AFSDIR_SERVER_KRB_EXCL_FILEPATH_ID]; -+ AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_SERVER_ETC_DIR, AFSDIR_KRB_EXCL_FILE); - - /* client file paths */ - #ifdef AFS_NT40_ENV ---- openafs.orig/src/util/dirpath.hin -+++ openafs/src/util/dirpath.hin -@@ -144,6 +144,7 @@ - #define AFSDIR_BOSVR_FILE "bosserver" - #define AFSDIR_VOLSERLOG_FILE "VolserLog" - #define AFSDIR_AUDIT_FILE "Audit" -+#define AFSDIR_KRB_EXCL_FILE "krb.excl" - - #define AFSDIR_ROOTVOL_FILE "RootVolume" - #define AFSDIR_HOSTDUMP_FILE "hosts.dump" -@@ -262,6 +263,7 @@ - AFSDIR_SERVER_MIGRATELOG_FILEPATH_ID, - AFSDIR_SERVER_BIN_FILE_DIRPATH_ID, - AFSDIR_CLIENT_CELLALIAS_FILEPATH_ID, -+ AFSDIR_SERVER_KRB_EXCL_FILEPATH_ID, - AFSDIR_PATHSTRING_MAX } afsdir_id_t; - - /* getDirPath() returns a pointer to a string from an internal array of path strings -@@ -329,6 +331,7 @@ - #define AFSDIR_SERVER_WEIGHTING_CONSTANTS_FILEPATH getDirPath(AFSDIR_SERVER_WEIGHTING_CONSTANTS_FILEPATH_ID) - #define AFSDIR_SERVER_THRESHOLD_CONSTANTS_FILEPATH getDirPath(AFSDIR_SERVER_THRESHOLD_CONSTANTS_FILEPATH_ID) - #define AFSDIR_SERVER_MIGRATELOG_FILEPATH getDirPath(AFSDIR_SERVER_MIGRATELOG_FILEPATH_ID) -+#define AFSDIR_SERVER_KRB_EXCL_FILEPATH getDirPath(AFSDIR_SERVER_KRB_EXCL_FILEPATH_ID) - - /* client file paths */ - #define AFSDIR_CLIENT_THISCELL_FILEPATH getDirPath(AFSDIR_CLIENT_THISCELL_FILEPATH_ID) ---- openafs.orig/src/util/dirpath_nt.h -+++ openafs/src/util/dirpath_nt.h -@@ -135,6 +135,7 @@ - #define AFSDIR_BOSVR_FILE "bosserver" - #define AFSDIR_VOLSERLOG_FILE "VolserLog" - #define AFSDIR_AUDIT_FILE "Audit" -+#define AFSDIR_KRB_EXCL_FILE "krb.excl" - - #define AFSDIR_ROOTVOL_FILE "RootVolume" - #define AFSDIR_HOSTDUMP_FILE "hosts.dump" -@@ -257,6 +258,7 @@ - AFSDIR_SERVER_MIGRATELOG_FILEPATH_ID, - AFSDIR_SERVER_BIN_FILE_DIRPATH_ID, - AFSDIR_CLIENT_CELLALIAS_FILEPATH_ID, -+ AFSDIR_SERVER_KRB_EXCL_FILEPATH_ID, - AFSDIR_PATHSTRING_MAX - } afsdir_id_t; - -@@ -325,6 +327,7 @@ - #define AFSDIR_SERVER_WEIGHTING_CONSTANTS_FILEPATH getDirPath(AFSDIR_SERVER_WEIGHTING_CONSTANTS_FILEPATH_ID) - #define AFSDIR_SERVER_THRESHOLD_CONSTANTS_FILEPATH getDirPath(AFSDIR_SERVER_THRESHOLD_CONSTANTS_FILEPATH_ID) - #define AFSDIR_SERVER_MIGRATELOG_FILEPATH getDirPath(AFSDIR_SERVER_MIGRATELOG_FILEPATH_ID) -+#define AFSDIR_SERVER_KRB_EXCL_FILEPATH getDirPath(AFSDIR_SERVER_KRB_EXCL_FILEPATH_ID) - - /* client file paths */ - #define AFSDIR_CLIENT_THISCELL_FILEPATH getDirPath(AFSDIR_CLIENT_THISCELL_FILEPATH_ID) ---- openafs.orig/src/util/get_krbrlm.c -+++ openafs/src/util/get_krbrlm.c -@@ -28,21 +28,148 @@ - #define KSUCCESS 0 - #define KFAILURE (-1) - -+static char * -+parse_str(char *buffer, char *result, int size) -+{ -+ int n=0; -+ -+ if (!buffer) -+ goto cleanup; -+ -+ while (*buffer && isspace(*buffer)) -+ buffer++; -+ while (*buffer && !isspace(*buffer)) { -+ if (n < size - 1) { -+ *result++=*buffer++; -+ n++; -+ } else { -+ buffer++; -+ } -+ } -+ -+ cleanup: -+ *result='\0'; -+ return buffer; -+} -+ -+ - int - afs_krb_get_lrealm(char *r, int n) - { -+ char linebuf[2048]; -+ char tr[AFS_REALM_SZ] = ""; -+ char *p; - FILE *cnffile/*, *fopen()*/; -+ int i; -+ int rv = KFAILURE; - -- if (n > 1) -- return (KFAILURE); /* Temporary restriction */ -+ *r = '\0'; - - if ((cnffile = fopen(AFSDIR_SERVER_KCONF_FILEPATH, "r")) == NULL) { - return (KFAILURE); - } -- if (fscanf(cnffile, "%s", r) != 1) { -- (void)fclose(cnffile); -- return (KFAILURE); -+ if (fgets(linebuf, sizeof(linebuf)-1, cnffile) == NULL) { -+ goto cleanup; -+ } -+ linebuf[sizeof(linebuf)-1] = '\0'; -+ for (i=0, p=linebuf; i<=n && *p; i++) { -+ p = parse_str(p, tr, AFS_REALM_SZ); -+ } -+ -+ if (*tr) { -+ strcpy(r,tr); -+ rv = KSUCCESS; -+ } -+ -+ cleanup: -+ (void)fclose(cnffile); -+ return rv; -+} -+ -+int -+afs_krb_exclusion(char * name) -+{ -+ char linebuf[2048]; -+ char excl_name[256] = ""; -+ FILE *cnffile/*, *fopen()*/; -+ int exclude = 0; -+ -+ if ((cnffile = fopen(AFSDIR_SERVER_KRB_EXCL_FILEPATH, "r")) == NULL) -+ return exclude; -+ -+ for (;;) { -+ if (fgets(linebuf, sizeof(linebuf)-1, cnffile) == NULL) { -+ goto cleanup; -+ } -+ linebuf[sizeof(linebuf)-1] = '\0'; -+ parse_str(linebuf, excl_name, sizeof(excl_name)); -+ -+ if (!strcmp(name,excl_name)) { -+ exclude = 1; -+ break; -+ } - } -+ -+ cleanup: - (void)fclose(cnffile); -- return (KSUCCESS); -+ return exclude; -+} -+ -+int -+afs_is_foreign_ticket_name(char *tname, char *tinst, char * tcell, char *localrealm) -+{ -+ int foreign = 0; -+ -+ if (localrealm && strcasecmp(localrealm, tcell)) -+ foreign = 1; -+ -+#if defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV) -+ if (foreign) { -+ static char local_realms[AFS_NUM_LREALMS][AFS_REALM_SZ]; -+ static int num_lrealms = -1; -+ int lrealm_match, i; -+ char uname[256]; -+ -+ if (num_lrealms == -1) { -+ for (i=0; i= PR_MAXNAMELEN) { - ViceLog(2, - ("MapName: Name too long, using AnonymousID for %s@%s\n", ---- openafs.orig/src/viced/viced.c -+++ openafs/src/viced/viced.c -@@ -1074,7 +1074,8 @@ - return -1; - } - } else if (!strcmp(argv[i], "-realm")) { -- extern char local_realm[AFS_REALM_SZ]; -+ extern char local_realms[AFS_NUM_LREALMS][AFS_REALM_SZ]; -+ extern int num_lrealms; - if ((i + 1) >= argc) { - fprintf(stderr, "missing argument for -realm\n"); - return -1; -@@ -1085,7 +1086,15 @@ - AFS_REALM_SZ); - return -1; - } -- strncpy(local_realm, argv[i], AFS_REALM_SZ); -+ if (num_lrealms == -1) -+ num_lrealms = 0; -+ if (num_lrealms >= AFS_NUM_LREALMS) { -+ printf -+ ("a maximum of %d -realm arguments can be specified.\n", -+ AFS_NUM_LREALMS); -+ return -1; -+ } -+ strncpy(local_realms[num_lrealms++], argv[i], AFS_REALM_SZ); - } else if (!strcmp(argv[i], "-udpsize")) { - if ((i + 1) >= argc) { - printf("You have to specify -udpsize \n"); diff --git a/debian/patches/pam-build b/debian/patches/pam-build deleted file mode 100644 index 70f0d0efc..000000000 --- a/debian/patches/pam-build +++ /dev/null @@ -1,88 +0,0 @@ -Apply an incredibly ugly hack to build the PAM modules against the shared -objects generated for the shared libraries. Not suitable upstream in its -current form. The right upstream solution is to standardize the shared -library ABI and install it with a real SONAME, and then link the PAM -modules against it. - ---- openafs.orig/Makefile.in -+++ openafs/Makefile.in -@@ -512,8 +512,6 @@ - # pthread based user space RX library - shlibafsrpc: rx rxkad des - case ${SYS_NAME} in \ -- amd64_linux24) \ -- echo Skipping shlibafsrpc for amd64_linux24 ;; \ - alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ - ${COMPILE_PART1} shlibafsrpc ${COMPILE_PART2} ;; \ - *) \ -@@ -522,8 +520,6 @@ - - shlibafsauthent: ubik auth kauth shlibafsrpc - case ${SYS_NAME} in \ -- amd64_linux24) \ -- echo Skipping shlibafsauthent for amd64_linux24 ;; \ - alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ - ${COMPILE_PART1} shlibafsauthent ${COMPILE_PART2} ;; \ - *) \ ---- openafs.orig/src/pam/Makefile.in -+++ openafs/src/pam/Makefile.in -@@ -25,7 +25,17 @@ - afs_pam_msg.o afs_message.o AFS_component_version_number.o - OBJS = $(SHOBJS) test_pam.o - INCLUDES=-I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} --CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS} -+CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS} ${MT_CFLAGS} -+ -+# For Debian, we link directly with the object files that would have gone -+# into the libafsrpc and libafsauthent shared libraries. The shared libraries -+# themselves cannot be used because the interface isn't stable and they have -+# no SONAME, but this is the easiest way of getting PIC objects built with the -+# pthread API. -+SHLIB_OBJS := `ls ../shlibafsauthent/*.o | grep -v version_num` \ -+ `ls ../shlibafsrpc/*.o | grep -v version_num` -+KRB_SHLIB_OBJS := `ls ../shlibafsauthent/*.o | egrep -v 'version_num|ktc.o'` \ -+ `ls ../shlibafsrpc/*.o | grep -v version_num` - - all: test_pam ${TOP_LIBDIR}/pam_afs.so.1 ${TOP_LIBDIR}/pam_afs.krb.so.1 - -@@ -47,6 +57,9 @@ - afs_util_krb.o: afs_util.c afs_pam_msg.h afs_message.h afs_util.h - ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/afs_util.c -o afs_util_krb.o - -+ktc.o: ${srcdir}/../auth/ktc.c -+ ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/../auth/ktc.c -+ - pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o - set -x; \ - case "$(SYS_NAME)" in \ -@@ -59,8 +72,9 @@ - afs_setcred.o afs_auth.o afs_util.o \ - $(SHOBJS) $(LIBS) ;; \ - *linux*) \ -- $(CC) $(LDFLAGS) -o $@ afs_setcred.o \ -- afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\ -+ $(CC) $(LDFLAGS) $(PAM_CFLAGS) -o $@ afs_setcred.o \ -+ afs_auth.o afs_util.o $(SHOBJS) $(SHLIB_OBJS) \ -+ $(MT_LIBS) -lpam -lresolv;;\ - *fbsd*| *nbsd*) \ - $(CC) $(LDFLAGS) -o $@ afs_setcred.o \ - afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\ -@@ -68,7 +82,7 @@ - echo No link line for system $(SYS_NAME). ;; \ - esac - --pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o -+pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o ktc.o - set -x; \ - case "$(SYS_NAME)" in \ - hp_ux* | ia64_hpux*) \ -@@ -81,7 +95,8 @@ - $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \ - *linux*) \ - $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o \ -- afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\ -+ afs_auth_krb.o afs_util_krb.o ktc.o $(SHOBJS) \ -+ $(KRB_SHLIB_OBJS) $(MT_LIBS) -lpam -lresolv;;\ - *fbsd*| *nbsd*) \ - $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o \ - afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\ diff --git a/debian/patches/ucontext-everywhere b/debian/patches/ucontext-everywhere deleted file mode 100644 index 5e1e53fc4..000000000 --- a/debian/patches/ucontext-everywhere +++ /dev/null @@ -1,59 +0,0 @@ -Build with UCONTEXT everywhere for current glibc. Patch pulled from -upstream stable branch, will be in 1.4.5. - ---- openafs.orig/src/config/param.alpha_linux_26.h -+++ openafs/src/config/param.alpha_linux_26.h -@@ -81,6 +81,11 @@ - #define SYS_NAME_ID SYS_NAME_ID_alpha_linux_26 - - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* AFS_PARAM_H */ - - #else /* !defined(UKERNEL) */ ---- openafs.orig/src/config/param.parisc_linux24.h -+++ openafs/src/config/param.parisc_linux24.h -@@ -70,6 +70,11 @@ - #endif - #endif /* KERNEL */ - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* AFS_PARAM_H */ - - #else /* !defined(UKERNEL) */ ---- openafs.orig/src/config/param.s390_linux26.h -+++ openafs/src/config/param.s390_linux26.h -@@ -86,6 +86,11 @@ - #endif - #endif /* KERNEL */ - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* AFS_PARAM_H */ - - #else /* !defined(UKERNEL) */ ---- openafs.orig/src/config/param.s390x_linux26.h -+++ openafs/src/config/param.s390x_linux26.h -@@ -89,6 +89,11 @@ - #endif - #endif /* KERNEL */ - -+#ifdef __GLIBC__ -+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3) -+#define USE_UCONTEXT -+#endif -+#endif - #endif /* AFS_PARAM_H */ - - #else /* !defined(UKERNEL) */ diff --git a/debian/rules b/debian/rules index 8ff0a4a76..31324955a 100755 --- a/debian/rules +++ b/debian/rules @@ -2,9 +2,6 @@ # Based on the sample debian/rules that uses debhelper. # GNU copyright 1997 by Joey Hess. -# Use quilt to manage patches. -include /usr/share/quilt/quilt.make - # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -85,7 +82,7 @@ get-orig-source: gzip -9 openafs_$(DEBVERS).orig.tar configure: configure-stamp -configure-stamp: $(QUILT_STAMPFN) +configure-stamp: @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi dh_testdir sh regen.sh @@ -112,15 +109,14 @@ build-stamp: chmod +x debian/afs-rootvol debian/afs-newcell touch $@ -clean: unpatch +clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp install-stamp [ ! -f Makefile ] || $(MAKE) distclean dh_clean aclocal.m4 configure configure-libafs doc/man-pages/man1/*.1 \ doc/man-pages/man5/*.5 doc/man-pages/man8/*.8 \ - src/kauth/ka-forwarder src/packaging/RedHat/openafs.spec \ - doc/man-pages/pod1/afs-up.pod + src/kauth/ka-forwarder src/packaging/RedHat/openafs.spec install: install-stamp install-stamp: DH_OPTIONS= -- 2.39.5