From 1df29a310b571ec32a95ed06572bf879a452b299 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Nov 23 2016 01:24:55 +0000 Subject: Further fork on getting things installed. Also more cleanups. --- diff --git a/cyrus-imapd-2.1.3-flock.patch b/cyrus-imapd-2.1.3-flock.patch deleted file mode 100644 index 3b8a27e..0000000 --- a/cyrus-imapd-2.1.3-flock.patch +++ /dev/null @@ -1,78 +0,0 @@ -diff -up cyrus-imapd-2.4.6/lib/lock_flock.c.flock cyrus-imapd-2.4.6/lib/lock_flock.c ---- cyrus-imapd-2.4.6/lib/lock_flock.c.flock 2010-12-20 14:15:49.000000000 +0100 -+++ cyrus-imapd-2.4.6/lib/lock_flock.c 2011-02-10 12:56:45.262786102 +0100 -@@ -52,6 +52,10 @@ - #endif - - #include "cyr_lock.h" -+#include -+ -+/* Locking timeout parameter */ -+#define MAXTIME 99 - - const char *lock_method_desc = "flock"; - -@@ -68,6 +72,18 @@ const char *lock_method_desc = "flock"; - * 'failaction' is provided, it is filled in with a pointer to a fixed - * string naming the action that failed. - * -+ * Modified by jwade 4/16/2002 to work around seen file locking problem -+ * Added locking timeout parameter to allow processes that are -+ * waiting for a lock to eventually time out -+ * -+ * Calls flock() in non-blocking fashion and then retries until a -+ * maximum delay is reached or the lock succeeds. -+ * -+ * As written, uses a quadratic backoff on retries with MAXTIME being -+ * the longest interval delay. Total delay time is the sum of the squares -+ * of all integers whose square is less than MAXTIME. In the case of -+ * MAXTIME = 99 this is 0+1+4+9+16+25+36+49+64+81= 285 Seconds -+ * This time is arbitrary and can be adjusted - */ - int lock_reopen(fd, filename, sbuf, failaction) - int fd; -@@ -78,17 +94,29 @@ const char **failaction; - int r; - struct stat sbuffile, sbufspare; - int newfd; -+ int delay=0, i=0; - - if (!sbuf) sbuf = &sbufspare; - -- for (;;) { -- r = flock(fd, LOCK_EX); -+ for(i=0,delay=0;;) { -+ r = flock(fd, LOCK_EX|LOCK_NB); - if (r == -1) { -- if (errno == EINTR) continue; -- if (failaction) *failaction = "locking"; -+ if (errno == EINTR) { -+ continue; -+ } -+ else if ((errno == EWOULDBLOCK) && (delay < MAXTIME)) { -+ syslog(LOG_DEBUG, "lock: reopen-blocked sleeping for %d on interval %d (%d, %s)" , delay, i, fd, filename); -+ sleep(delay); -+ i++; -+ delay = i*i; -+ continue; -+ } -+ if (failaction) { -+ if (delay >= MAXTIME) *failaction = "locking_timeout"; -+ else *failaction = "locking"; -+ } - return -1; - } -- - fstat(fd, sbuf); - r = stat(filename, &sbuffile); - if (r == -1) { -@@ -96,9 +124,7 @@ const char **failaction; - flock(fd, LOCK_UN); - return -1; - } -- - if (sbuf->st_ino == sbuffile.st_ino) return 0; -- - newfd = open(filename, O_RDWR); - if (newfd == -1) { - if (failaction) *failaction = "opening"; diff --git a/cyrus-imapd-2.3.1-authid_normalize.patch b/cyrus-imapd-2.3.1-authid_normalize.patch deleted file mode 100644 index de62ae9..0000000 --- a/cyrus-imapd-2.3.1-authid_normalize.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff -up cyrus-imapd-2.4.14/lib/auth_unix.c.authid_normalize cyrus-imapd-2.4.14/lib/auth_unix.c ---- cyrus-imapd-2.4.14/lib/auth_unix.c.authid_normalize 2012-03-12 12:47:51.000000000 +0100 -+++ cyrus-imapd-2.4.14/lib/auth_unix.c 2012-03-14 10:49:50.679822894 +0100 -@@ -156,10 +156,12 @@ const char *identifier; - size_t len; - { - static char retbuf[81]; -+ char backup[81]; - struct group *grp; - char sawalpha; - char *p; - int username_tolower = 0; -+ int ic,rbc; - - if(!len) len = strlen(identifier); - if(len >= sizeof(retbuf)) return NULL; -@@ -211,6 +213,22 @@ size_t len; - /* now we don't */ - /* if (!sawalpha) return NULL; */ - -+ if( (libcyrus_config_getswitch(CYRUSOPT_NORMALIZEUID) == 1) ) { -+ strcpy(backup,retbuf); -+ /* remove leading blanks */ -+ for(ic=0; isblank(backup[ic]); ic++); -+ for(rbc=0; backup[ic]; ic++) { -+ retbuf[rbc] = ( isalpha(backup[ic]) ? -+ tolower(backup[ic]) : backup[ic] ); -+ rbc++; -+ } -+ retbuf[rbc] = '\0'; -+ /* remove trailing blanks */ -+ for(--rbc; isblank(retbuf[rbc]); rbc--) { -+ retbuf[rbc] = '\0'; -+ } -+ } -+ - return retbuf; - } - -diff -up cyrus-imapd-2.4.14/lib/imapoptions.authid_normalize cyrus-imapd-2.4.14/lib/imapoptions ---- cyrus-imapd-2.4.14/lib/imapoptions.authid_normalize 2012-03-12 12:47:51.000000000 +0100 -+++ cyrus-imapd-2.4.14/lib/imapoptions 2012-03-14 11:01:11.020256349 +0100 -@@ -844,6 +844,11 @@ Blank lines and lines beginning with ``# - /* Set the length of the NNTP server's inactivity autologout timer, - in minutes. The minimum value is 3, the default. */ - -+{ "normalizeuid", 0, SWITCH } -+/* Lowercase uid and strip leading and trailing blanks. It is recommended -+ to set this to yes, especially if OpenLDAP is used as authentication -+ source. */ -+ - { "notifysocket", "{configdirectory}/socket/notify", STRING } - /* Unix domain socket that the mail notification daemon listens on. */ - -diff -up cyrus-imapd-2.4.14/lib/libcyr_cfg.c.authid_normalize cyrus-imapd-2.4.14/lib/libcyr_cfg.c ---- cyrus-imapd-2.4.14/lib/libcyr_cfg.c.authid_normalize 2012-03-12 12:47:51.000000000 +0100 -+++ cyrus-imapd-2.4.14/lib/libcyr_cfg.c 2012-03-14 10:49:50.681822910 +0100 -@@ -158,6 +158,10 @@ struct cyrusopt_s cyrus_options[] = { - CFGVAL(long, 1), - CYRUS_OPT_SWITCH }, - -+ { CYRUSOPT_NORMALIZEUID, -+ CFGVAL(long, 1), -+ CYRUS_OPT_SWITCH }, -+ - { CYRUSOPT_LAST, { NULL }, CYRUS_OPT_NOTOPT } - }; - -diff -up cyrus-imapd-2.4.14/lib/libcyr_cfg.h.authid_normalize cyrus-imapd-2.4.14/lib/libcyr_cfg.h ---- cyrus-imapd-2.4.14/lib/libcyr_cfg.h.authid_normalize 2012-03-12 12:47:51.000000000 +0100 -+++ cyrus-imapd-2.4.14/lib/libcyr_cfg.h 2012-03-14 10:49:50.681822910 +0100 -@@ -116,6 +116,8 @@ enum cyrus_opt { - CYRUSOPT_SQL_USESSL, - /* Checkpoint after every recovery (OFF) */ - CYRUSOPT_SKIPLIST_ALWAYS_CHECKPOINT, -+ /* Lowercase uid and strip leading and trailing blanks (OFF) */ -+ CYRUSOPT_NORMALIZEUID, - - CYRUSOPT_LAST - diff --git a/cyrus-imapd-2.3.1.tar.gz.sig b/cyrus-imapd-2.3.1.tar.gz.sig deleted file mode 100644 index 9e892dd..0000000 Binary files a/cyrus-imapd-2.3.1.tar.gz.sig and /dev/null differ diff --git a/cyrus-imapd-2.3.12p2-current-db.patch b/cyrus-imapd-2.3.12p2-current-db.patch deleted file mode 100644 index 85d242a..0000000 --- a/cyrus-imapd-2.3.12p2-current-db.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up cyrus-imapd-2.4.6/cmulocal/berkdb.m4.db4.7 cyrus-imapd-2.4.6/cmulocal/berkdb.m4 ---- cyrus-imapd-2.4.6/cmulocal/berkdb.m4.db4.7 2010-12-20 14:15:49.000000000 +0100 -+++ cyrus-imapd-2.4.6/cmulocal/berkdb.m4 2011-02-10 13:43:26.397438481 +0100 -@@ -214,6 +214,7 @@ AC_DEFUN([CYRUS_BERKELEY_DB_CHK_LIB], - - saved_LIBS=$LIBS - for dbname in ${with_bdb} \ -+ db \ - db-4.8 db4.8 db48 \ - db-4.7 db4.7 db47 \ - db-4.6 db4.6 db46 \ -@@ -226,8 +227,7 @@ AC_DEFUN([CYRUS_BERKELEY_DB_CHK_LIB], - db-3.3 db3.3 db33 \ - db-3.2 db3.2 db32 \ - db-3.1 db3.1 db31 \ -- db-3.0 db3.0 db30 db-3 db3 \ -- db -+ db-3.0 db3.0 db30 db-3 db3 - do - LIBS="$saved_LIBS -l$dbname" - AC_TRY_LINK([#include diff --git a/cyrus-imapd-2.3.18-potential-overflow.patch b/cyrus-imapd-2.3.18-potential-overflow.patch deleted file mode 100644 index 456591f..0000000 --- a/cyrus-imapd-2.3.18-potential-overflow.patch +++ /dev/null @@ -1,29 +0,0 @@ -This is a backport of -https://cyrus.foundation/cyrus-imapd/commit/?id=ff4e6c71d932b3e6bbfa67d76f095e27ff21bad0 - -The patch is mentioned in http://seclists.org/oss-sec/2015/q3/651 as fixing -potential overflows. - -diff --git a/master/master.c b/master/master.c -index 3886441..455548b 100644 ---- a/master/master.c -+++ b/master/master.c -@@ -197,13 +197,15 @@ void event_free(struct event *a) - free(a); - } - --void get_prog(char *path, unsigned size, char *const *cmd) -+void get_prog(char *path, size_t size, char *const *cmd) - { -+ if (!size) return; - if (cmd[0][0] == '/') { -- /* master lacks strlcpy, due to no libcyrus */ -- snprintf(path, size, "%s", cmd[0]); -+ /* master lacks strlcpy, due to no libcyrus */ -+ strncpy(path, cmd[0], size - 1); - } - else snprintf(path, size, "%s/%s", SERVICE_PATH, cmd[0]); -+ path[size-1] = '\0'; - } - - void get_statsock(int filedes[2]) diff --git a/cyrus-imapd-2.4.12-debugopt.patch b/cyrus-imapd-2.4.12-debugopt.patch deleted file mode 100644 index 170a994..0000000 --- a/cyrus-imapd-2.4.12-debugopt.patch +++ /dev/null @@ -1,109 +0,0 @@ -diff -up cyrus-imapd-2.4.12/imap/global.c.debugopt cyrus-imapd-2.4.12/imap/global.c ---- cyrus-imapd-2.4.12/imap/global.c.debugopt 2011-10-04 21:53:03.000000000 +0200 -+++ cyrus-imapd-2.4.12/imap/global.c 2011-11-22 14:24:28.272416643 +0100 -@@ -157,6 +157,10 @@ int cyrus_init(const char *alt_config, c - /* don't free the openlog() string! */ - } - -+ /* allow debug logging */ -+ if (!config_debug) -+ setlogmask(~LOG_MASK(LOG_DEBUG)); -+ - /* Look up default partition */ - config_defpartition = config_getstring(IMAPOPT_DEFAULTPARTITION); - for (p = (char *)config_defpartition; p && *p; p++) { -diff -up cyrus-imapd-2.4.12/imap/tls.c.debugopt cyrus-imapd-2.4.12/imap/tls.c ---- cyrus-imapd-2.4.12/imap/tls.c.debugopt 2011-10-04 21:53:03.000000000 +0200 -+++ cyrus-imapd-2.4.12/imap/tls.c 2011-11-22 14:24:28.272416643 +0100 -@@ -255,9 +255,9 @@ static DH *load_dh_param(const char *key - - if (ret == NULL) { - ret = get_dh1024(); -- syslog(LOG_NOTICE, "imapd:Loading hard-coded DH parameters"); -+ syslog(LOG_DEBUG, "imapd:Loading hard-coded DH parameters"); - } else { -- syslog(LOG_NOTICE, "imapd:Loading DH parameters from file"); -+ syslog(LOG_DEBUG, "imapd:Loading DH parameters from file"); - } - - if (bio != NULL) BIO_free(bio); -diff -up cyrus-imapd-2.4.12/lib/imapoptions.debugopt cyrus-imapd-2.4.12/lib/imapoptions ---- cyrus-imapd-2.4.12/lib/imapoptions.debugopt 2011-11-22 14:24:28.265416615 +0100 -+++ cyrus-imapd-2.4.12/lib/imapoptions 2011-11-22 14:24:28.273416647 +0100 -@@ -388,6 +388,9 @@ Blank lines and lines beginning with ``# - hashing done on configuration directories. This is recommended if - one partition has a very bushy mailbox tree. */ - -+{ "debug", 0, SWITCH } -+/* If enabled, allow syslog() to pass LOG_DEBUG messages. */ -+ - # Commented out - there's no such thing as "hostname_mechs", but we need - # this for the man page - # { "hostname_mechs", NULL, STRING } -diff -up cyrus-imapd-2.4.12/lib/libconfig.c.debugopt cyrus-imapd-2.4.12/lib/libconfig.c ---- cyrus-imapd-2.4.12/lib/libconfig.c.debugopt 2011-10-04 21:53:03.000000000 +0200 -+++ cyrus-imapd-2.4.12/lib/libconfig.c 2011-11-22 14:24:28.274416650 +0100 -@@ -84,6 +84,7 @@ int config_auditlog; - unsigned config_maxword; - unsigned config_maxquoted; - int config_qosmarking; -+int config_debug; - - /* declared in each binary that uses libconfig */ - extern const int config_need_data; -@@ -350,6 +351,9 @@ void config_read(const char *alt_config) - - ival = config_getenum(IMAPOPT_QOSMARKING); - config_qosmarking = qos[ival]; -+ -+ /* allow debug logging */ -+ config_debug = config_getswitch(IMAPOPT_DEBUG); - } - - #define GROWSIZE 4096 -diff -up cyrus-imapd-2.4.12/lib/libconfig.h.debugopt cyrus-imapd-2.4.12/lib/libconfig.h ---- cyrus-imapd-2.4.12/lib/libconfig.h.debugopt 2011-10-04 21:53:03.000000000 +0200 -+++ cyrus-imapd-2.4.12/lib/libconfig.h 2011-11-22 14:24:28.274416650 +0100 -@@ -82,6 +82,7 @@ extern int config_auditlog; - extern unsigned config_maxquoted; - extern unsigned config_maxword; - extern int config_qosmarking; -+extern int config_debug; - - /* config requirement flags */ - #define CONFIG_NEED_PARTITION_DATA (1<<0) -diff -up cyrus-imapd-2.4.12/master/master.c.debugopt cyrus-imapd-2.4.12/master/master.c ---- cyrus-imapd-2.4.12/master/master.c.debugopt 2011-10-04 21:53:03.000000000 +0200 -+++ cyrus-imapd-2.4.12/master/master.c 2011-11-22 14:30:47.243975974 +0100 -@@ -1984,7 +1984,7 @@ int main(int argc, char **argv) - if(pidlock_fd != -1) close(pidlock_fd); - } - -- syslog(LOG_NOTICE, "process started"); -+ syslog(LOG_DEBUG, "process started"); - - #if defined(HAVE_UCDSNMP) || defined(HAVE_NETSNMP) - /* initialize SNMP agent */ -@@ -2041,7 +2041,7 @@ int main(int argc, char **argv) - init_janitor(); - - /* ok, we're going to start spawning like mad now */ -- syslog(LOG_NOTICE, "ready for work"); -+ syslog(LOG_DEBUG, "ready for work"); - - now = time(NULL); - for (;;) { -diff -up cyrus-imapd-2.4.12/master/masterconf.c.debugopt cyrus-imapd-2.4.12/master/masterconf.c ---- cyrus-imapd-2.4.12/master/masterconf.c.debugopt 2011-10-04 21:53:03.000000000 +0200 -+++ cyrus-imapd-2.4.12/master/masterconf.c 2011-11-22 14:24:28.276416658 +0100 -@@ -99,6 +99,10 @@ int masterconf_init(const char *ident, c - /* don't free the openlog() string! */ - } - -+ /* drop debug messages locally */ -+ if (!config_debug) -+ setlogmask(~LOG_MASK(LOG_DEBUG)); -+ - return 0; - } - diff --git a/cyrus-imapd.spec b/cyrus-imapd.spec index 9f8637a..8cf4974 100644 --- a/cyrus-imapd.spec +++ b/cyrus-imapd.spec @@ -27,16 +27,10 @@ Source11: README.rpm Source12: cyrus-imapd.service Source13: cyr_systemd_helper -#Patch0: cyrus-imapd-2.1.3-flock.patch -#Patch1: cyrus-imapd-2.3.1-authid_normalize.patch - -# fedora/rhel specific, find current db lib, rhbz#461875 -#Patch2: cyrus-imapd-2.3.12p2-current-db.patch - -# for c-i <= 2.4.12 -#Patch3: cyrus-imapd-2.4.12-debugopt.patch - -#Patch4: cyrus-imapd-2.3.18-potential-overflow.patch +# There is a conflict between the sched_param structure defined in the source +# and one defined by a system header. Fixed upstream as +# https://github.com/cyrusimap/cyrus-imapd/commit/a288b4fea15f843e309dcdf7039a1ebcc3d19616 +Patch0: fix-sched_param.patch BuildRequires: autoconf automake bison flex groff libtool BuildRequires: pkgconfig tcp_wrappers transfig @@ -58,7 +52,7 @@ Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %{?perl_default_filter} %description -The %{name} package contains the core of the Cyrus IMAP server. +The cyrus-imapd package contains the core of the Cyrus IMAP server. It is a scaleable enterprise mail system designed for use from small to large enterprise environments using standards-based internet mail technologies. @@ -101,13 +95,13 @@ Requires(post): grep, coreutils, make, openssl Requires(postun): shadow-utils %description utils -The %{name}-utils package contains administrative tools for the +The cyrus-imapd-utils package contains administrative tools for the Cyrus IMAP server. It can be installed on systems other than the one running the server. %prep %autosetup -p1 -install -m 644 %{SOURCE11} doc/ +install -m 644 %SOURCE11 doc/ # Modify docs master --> cyrus-master perl -pi -e "s@master\(8\)@cyrus-master(8)@" man/*5 man/*8 lib/imapoptions @@ -137,13 +131,13 @@ find . -type f -name "*.pl" -exec chmod 755 {} \; autoreconf -vi %{configure} \ - --with-bdb-incdir=%{_includedir}/libdb \ - --with-cyrus-prefix=%{cyrexecdir} \ - --with-extraident="Fedora-RPM-%{version}-%{release}" \ + --with-bdb-incdir=%_includedir/libdb \ + --with-cyrus-prefix=%cyrexecdir \ + --with-extraident="Fedora-RPM-%version-%release" \ --with-krbimpl=mit \ --with-ldap=/usr \ - --with-perl=%{__perl} \ - --with-service-path=%{cyrexecdir} \ + --with-perl=%__perl \ + --with-service-path=%cyrexecdir \ --with-snmp \ --with-syslogfacility=MAIL \ --enable-autocreate \ @@ -156,47 +150,54 @@ autoreconf -vi --enable-replication \ --enable-unit-tests \ -%undefine smp_mflags %make_build +# This isn't built by default, but this package has always installed it. +make -C notifyd notifytest + #make -C man -f Makefile.dist #make -C doc -f Makefile.dist #make LDFLAGS="$LDFLAGS -pie %{__global_ldflags}" -#make -C notifyd notifytest %install +echo AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +make install DESTDIR=%buildroot + +# Install some additional binaryes + +# Create directories +install -d \ + %buildroot/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig,cron.daily} \ + %buildroot/%_libdir/sasl \ + %buildroot/var/spool/imap \ + %buildroot/var/lib/imap/{user,quota,proc,log,msg,socket,db,sieve,sync,md5,rpm,backup,meta} \ + %buildroot/var/lib/imap/ptclient \ + %buildroot/%_datadir/%name/rpm \ + %buildroot/etc/pki/%name + + +echo BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +ls -lR %buildroot # This is needed to install the perl files correctly -pushd perl/imap - perl Makefile.PL PREFIX=%{buildroot}%{_prefix} INSTALLDIRS=vendor -popd -pushd perl/sieve/managesieve - perl Makefile.PL PREFIX=%{buildroot}%{_prefix} INSTALLDIRS=vendor -popd +#pushd perl/imap +# perl Makefile.PL PREFIX=%{buildroot}%{_prefix} INSTALLDIRS=vendor +#popd +#pushd perl/sieve/managesieve +# perl Makefile.PL PREFIX=%{buildroot}%{_prefix} INSTALLDIRS=vendor +#popd # Do what the regular make install does make install DESTDIR=%{buildroot} PREFIX=%{_prefix} mandir=%{_mandir} make -C man install DESTDIR=%{buildroot} PREFIX=%{_prefix} mandir=%{_mandir} -install -m 755 imtest/imtest %{buildroot}%{_bindir}/ -install -m 755 notifyd/notifytest %{buildroot}%{_bindir}/ -install -m 755 perl/imap/cyradm %{buildroot}%{_bindir}/ +install -m 755 notifyd/notifytest %buildroot%_bindir/ +install -m 755 perl/imap/cyradm %buildroot%_bindir/ # Install tools for tool in tools/* ; do test -f ${tool} && install -m 755 ${tool} %{buildroot}%{cyrexecdir}/ done -# Create directories -install -d \ - %{buildroot}/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig,cron.daily} \ - %{buildroot}%{_libdir}/sasl \ - %{buildroot}%{_var}/spool/imap \ - %{buildroot}%{_var}/lib/imap/{user,quota,proc,log,msg,socket,db,sieve,sync,md5,rpm,backup,meta} \ - %{buildroot}%{_var}/lib/imap/ptclient \ - %{buildroot}%{_datadir}/%{name}/rpm \ - %{buildroot}/etc/pki/%{name} \ - doc/contrib - # Install additional files install -m 755 %{SOURCE8} %{buildroot}%{cyrexecdir}/cvt_cyrusdb_all install -m 644 %{SOURCE9} %{buildroot}%{_datadir}/%{name}/rpm/magic diff --git a/fix-sched_param.patch b/fix-sched_param.patch new file mode 100644 index 0000000..d2f3d4d --- /dev/null +++ b/fix-sched_param.patch @@ -0,0 +1,238 @@ +diff --git a/imap/http_caldav.c b/imap/http_caldav.c +index 98c0f70..4520424 100644 +--- a/imap/http_caldav.c ++++ b/imap/http_caldav.c +@@ -362,7 +362,7 @@ static int store_resource(struct transaction_t *txn, icalcomponent *ical, + struct caldav_db *caldavdb, int overwrite, + unsigned flags); + +-static void sched_request(const char *organizer, struct sched_param *sparam, ++static void sched_request(const char *organizer, struct caldav_sched_param *sparam, + icalcomponent *oldical, icalcomponent *newical, + const char *att_update); + static void sched_reply(const char *userid, +@@ -1154,7 +1154,7 @@ static int caldav_delete_sched(struct transaction_t *txn, + const char *userid, *organizer, **hdr; + icalcomponent *ical, *comp; + icalproperty *prop; +- struct sched_param sparam; ++ struct caldav_sched_param sparam; + + /* Load message containing the resource and parse iCal data */ + ical = record_to_ical(mailbox, record); +@@ -2441,7 +2441,7 @@ static int caldav_post(struct transaction_t *txn) + icalproperty_method meth = 0; + icalproperty *prop = NULL; + const char *uid = NULL, *organizer = NULL; +- struct sched_param sparam; ++ struct caldav_sched_param sparam; + + if (!(namespace_calendar.allow & ALLOW_CAL_SCHED) || !txn->req_tgt.flags) { + /* POST to regular calendar collection */ +@@ -2726,7 +2726,7 @@ static int caldav_put(struct transaction_t *txn, + /* Scheduling object resource */ + const char *userid; + struct caldav_data *cdata; +- struct sched_param sparam; ++ struct caldav_sched_param sparam; + icalcomponent *oldical = NULL; + int r; + +@@ -5359,12 +5359,12 @@ static int store_resource(struct transaction_t *txn, icalcomponent *ical, + } + + +-int caladdress_lookup(const char *addr, struct sched_param *param) ++int caladdress_lookup(const char *addr, struct caldav_sched_param *param) + { + const char *userid = addr; + int islocal = 1, found = 1; + +- memset(param, 0, sizeof(struct sched_param)); ++ memset(param, 0, sizeof(struct caldav_sched_param)); + + if (!addr) return HTTP_NOT_FOUND; + +@@ -5571,7 +5571,7 @@ struct remote_rock { + static void busytime_query_remote(const char *server __attribute__((unused)), + void *data, void *rock) + { +- struct sched_param *remote = (struct sched_param *) data; ++ struct caldav_sched_param *remote = (struct caldav_sched_param *) data; + struct remote_rock *rrock = (struct remote_rock *) rock; + icalcomponent *comp; + struct proplist *list; +@@ -5673,18 +5673,18 @@ static void busytime_query_remote(const char *server __attribute__((unused)), + } + + +-static void free_sched_param(void *data) ++static void free_caldav_sched_param(void *data) + { +- struct sched_param *sched_param = (struct sched_param *) data; ++ struct caldav_sched_param *caldav_sched_param = (struct caldav_sched_param *) data; + +- if (sched_param) { ++ if (caldav_sched_param) { + struct proplist *prop, *next; + +- for (prop = sched_param->props; prop; prop = next) { ++ for (prop = caldav_sched_param->props; prop; prop = next) { + next = prop->next; + free(prop); + } +- free(sched_param); ++ free(caldav_sched_param); + } + } + +@@ -5700,14 +5700,14 @@ int sched_busytime_query(struct transaction_t *txn, + char mailboxname[MAX_MAILBOX_BUFFER]; + icalproperty *prop = NULL, *next; + const char *uid = NULL, *organizer = NULL; +- struct sched_param sparam; ++ struct caldav_sched_param sparam; + struct auth_state *org_authstate = NULL; + xmlNodePtr root = NULL; + xmlNsPtr ns[NUM_NAMESPACE]; + struct propfind_ctx fctx; + struct calquery_filter calfilter; + struct hash_table remote_table; +- struct sched_param *remote = NULL; ++ struct caldav_sched_param *remote = NULL; + + if (!calendarprefix) { + calendarprefix = config_getstring(IMAPOPT_CALENDARPREFIX); +@@ -5811,7 +5811,7 @@ int sched_busytime_query(struct transaction_t *txn, + remote = hash_lookup(key, &remote_table); + if (!remote) { + /* New remote - add it to the hash table */ +- remote = xzmalloc(sizeof(struct sched_param)); ++ remote = xzmalloc(sizeof(struct caldav_sched_param)); + if (sparam.server) remote->server = xstrdup(sparam.server); + remote->port = sparam.port; + remote->flags = sparam.flags; +@@ -5907,7 +5907,7 @@ int sched_busytime_query(struct transaction_t *txn, + struct remote_rock rrock = { txn, ical, root, ns }; + hash_enumerate(&remote_table, busytime_query_remote, &rrock); + } +- free_hash_table(&remote_table, free_sched_param); ++ free_hash_table(&remote_table, free_caldav_sched_param); + + /* Output the XML response */ + if (!ret) xml_response(HTTP_OK, txn, root->doc); +@@ -5945,7 +5945,7 @@ static void free_sched_data(void *data) + + /* Deliver scheduling object to a remote recipient */ + static void sched_deliver_remote(const char *recipient, +- struct sched_param *sparam, ++ struct caldav_sched_param *sparam, + struct sched_data *sched_data) + { + int r; +@@ -6250,7 +6250,7 @@ static int deliver_merge_pollstatus(icalcomponent *ical, icalcomponent *request) + + + static void sched_pollstatus(const char *organizer, +- struct sched_param *sparam, icalcomponent *ical, ++ struct caldav_sched_param *sparam, icalcomponent *ical, + const char *voter) + { + struct auth_state *authstate; +@@ -6376,7 +6376,7 @@ deliver_merge_pollstatus(icalcomponent *ical __attribute__((unused)), + } + + static void sched_pollstatus(const char *organizer __attribute__((unused)), +- struct sched_param *sparam __attribute__((unused)), ++ struct caldav_sched_param *sparam __attribute__((unused)), + icalcomponent *ical __attribute__((unused)), + const char *voter __attribute__((unused))) + { +@@ -6708,7 +6708,7 @@ static int deliver_merge_request(const char *attendee, + + /* Deliver scheduling object to local recipient */ + static void sched_deliver_local(const char *recipient, +- struct sched_param *sparam, ++ struct caldav_sched_param *sparam, + struct sched_data *sched_data, + struct auth_state *authstate) + { +@@ -6986,7 +6986,7 @@ void sched_deliver(const char *recipient, void *data, void *rock) + { + struct sched_data *sched_data = (struct sched_data *) data; + struct auth_state *authstate = (struct auth_state *) rock; +- struct sched_param sparam; ++ struct caldav_sched_param sparam; + int islegal; + + /* Check SCHEDULE-FORCE-SEND value */ +@@ -7325,7 +7325,7 @@ static unsigned propcmp(icalcomponent *oldical, icalcomponent *newical, + + + /* Create and deliver an organizer scheduling request */ +-static void sched_request(const char *organizer, struct sched_param *sparam, ++static void sched_request(const char *organizer, struct caldav_sched_param *sparam, + icalcomponent *oldical, icalcomponent *newical, + const char *att_update) + { +@@ -7607,7 +7607,7 @@ static icalcomponent *trim_attendees(icalcomponent *comp, const char *userid, + prop; + prop = nextprop) { + const char *att = get_recipient(prop); +- struct sched_param sparam; ++ struct caldav_sched_param sparam; + + nextprop = icalcomponent_get_next_property(copy, recip_kind); + +diff --git a/imap/http_caldav_sched.h b/imap/http_caldav_sched.h +index 5d8b2a9..9b66b81 100644 +--- a/imap/http_caldav_sched.h ++++ b/imap/http_caldav_sched.h +@@ -109,7 +109,7 @@ struct proplist { + }; + + /* Each calendar user address has the following scheduling protocol params */ +-struct sched_param { ++struct caldav_sched_param { + char *userid; /* Userid corresponding to calendar address */ + char *server; /* Remote server user lives on */ + unsigned port; /* Remote server port, default = 80 */ +@@ -119,7 +119,7 @@ struct sched_param { + + extern icalarray *rscale_calendars; + extern const char *get_icalcomponent_errstr(icalcomponent *ical); +-extern int isched_send(struct sched_param *sparam, const char *recipient, ++extern int isched_send(struct caldav_sched_param *sparam, const char *recipient, + icalcomponent *ical, xmlNodePtr *xml); + + extern int sched_busytime_query(struct transaction_t *txn, +@@ -127,6 +127,6 @@ extern int sched_busytime_query(struct transaction_t *txn, + extern void sched_deliver(const char *recipient, void *data, void *rock); + extern xmlNodePtr xml_add_schedresponse(xmlNodePtr root, xmlNsPtr dav_ns, + xmlChar *recipient, xmlChar *status); +-extern int caladdress_lookup(const char *addr, struct sched_param *param); ++extern int caladdress_lookup(const char *addr, struct caldav_sched_param *param); + + #endif /* HTTP_CALDAV_SCHED_H */ +diff --git a/imap/http_ischedule.c b/imap/http_ischedule.c +index fef11a0..e08bc80 100644 +--- a/imap/http_ischedule.c ++++ b/imap/http_ischedule.c +@@ -540,7 +540,7 @@ static int meth_post_isched(struct transaction_t *txn, + + while ((recipient = tok_next(&tok))) { + /* Is recipient remote or local? */ +- struct sched_param sparam; ++ struct caldav_sched_param sparam; + int r = caladdress_lookup(recipient, &sparam); + + /* Don't allow scheduling with remote users via iSchedule */ +@@ -583,7 +583,7 @@ static int meth_post_isched(struct transaction_t *txn, + } + + +-int isched_send(struct sched_param *sparam, const char *recipient, ++int isched_send(struct caldav_sched_param *sparam, const char *recipient, + icalcomponent *ical, xmlNodePtr *xml) + { + int r = 0; diff --git a/rpmlint.cf b/rpmlint.cf new file mode 100644 index 0000000..8e65b7b --- /dev/null +++ b/rpmlint.cf @@ -0,0 +1 @@ +addFilter('hardcoded-library-path in %{_prefix}/lib/%{name}')