Great Circle Associates Majordomo-Workers
(January 1998)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: minor 1.94.4 patches
From: Bill Houle <Bill . Houle @ SanDiegoCA . NCR . COM>
Date: Sat, 17 Jan 1998 12:31:44 -0800
To: majordomo-users @ greatcircle . com
Cc: majordomo-workers @ greatcircle . com

Here is a minor little patch that cleans up newinfo/newintro in 1.94.4. The
line numbers will not match exactly due to other local hacks, but the
context is the same. The jist is as follows: 

An "intro" file overrides an "info" file on welcome messages for new
subscriptions. If you implement an "intro" file and then change your mind,
you cannot revert to using the "info" file because a zero-length "intro"
file is still left behind. This patch will remove the info/intro files when
a zero-length file results from the respective "new" commands. 

NOTE: if date_intro/date_info is set, even an "empty" file will have a
non-zero size. This patch does not do "if -s < length($datestamp)",
although that is another option....

--bill




MAJORDOMO
***************
*** 828,834 ****
        # The list is valid, so check the password
        if (&valid_passwd($listdir, $clean_list, $passwd)) {
            # The password is valid, so write the new info
-           local (@time) = localtime if &cf_ck_bool($clean_list,"date_info");
            local($mode, $uid, $gid) =
                (stat("$listdir/$clean_list.info"))[2,4,5];
            $mode = (0664) if !$mode;
--- 836,841 ----
***************
*** 842,851 ****
                    }
                    print INFO $_, "\n";
                }
-               chmod($mode, "$listdir/$clean_list.info");
-               chown($uid, $gid, "$listdir/$clean_list.info")
-                   if defined($uid);
                &lclose(INFO);
                print REPLY "New info for list $clean_list accepted.\n";
                &log("newinfo $clean_list PASSWORD");
            } else {
--- 849,863 ----
                    }
                    print INFO $_, "\n";
                }
                &lclose(INFO);
+           if (-s "$listdir/$clean_list.info" > 0) {
+                       chmod($mode, "$listdir/$clean_list.info");
+                       chown($uid, $gid, "$listdir/$clean_list.info")
+                               if defined($uid);
+               }
+               else {
+                       unlink("$listdir/$clean_list.info");
+               }
                print REPLY "New info for list $clean_list accepted.\n";
                &log("newinfo $clean_list PASSWORD");
            } else {
***************
*** 932,938 ****
        # The list is valid, so check the password
        if (&valid_passwd($listdir, $clean_list, $passwd)) {
            # The password is valid, so write the new intro
-           local (@time) = localtime if
&cf_ck_bool($clean_list,"date_intro");
            if (&lopen(INFO, ">", "$listdir/$clean_list.intro")) {
                print INFO "[Last updated on: ", &chop_nl(&ctime(time())),
                         "]\n" if &cf_ck_bool($clean_list,"date_intro");
--- 944,949 ----
***************
*** 944,950 ****
                    print INFO $_, "\n";
                }
                &lclose(INFO);
-               chmod(0664, "$listdir/$clean_list.intro");
                print REPLY "New intro for list $clean_list accepted.\n";
                &log("newintro $clean_list PASSWORD");
            } else {
--- 955,966 ----
                    print INFO $_, "\n";
                }
                &lclose(INFO);
+           if (-s "$listdir/$clean_list.intro" > 0) {
+                       chmod(0664, "$listdir/$clean_list.intro");
+               }
+               else {
+                       unlink("$listdir/$clean_list.intro");
+               }
                print REPLY "New intro for list $clean_list accepted.\n";
                &log("newintro $clean_list PASSWORD");
            } else {





Indexed By Date Previous: Re: Majordomo 1.94 confirm msg shouldn't mention deleting
From: Jerry Peek <jpeek@jpeek.com>
Next: Re: another trivial 1.94.4 patch: moderator
From: Dave Wolfe <dwolfe@risc.sps.mot.com>
Indexed By Thread Previous: MajorCool 2 (Was: another trivial 1.94.4 patch: moderator)
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Next: The majordomo log file... (1.94.4) two items
From: "Brian L. Heess" <dmbong@commline.com>

Google
 
Search Internet Search www.greatcircle.com