Re: Setting a default location for files
Eugene Crosser <[email protected]> Tue, 11 Jan 2011 20:29:59 +0300
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <[email protected]> |
Hi all, I think that the problem of the shebang line being taken as a path to the interpreter in its entirety did exist in Linux maybe a decade ago, or more. (A number of other potential problems is described here: http://en.wikipedia.org/wiki/Shebang_%28Unix%29#Portability). In the past years, constructions like #!/usr/bin/perl -w worked quite well. However, it's quite likely the interpreter's responsibility to parse the command line into the arguments vector, while the kernel only selects the part till the first whitespace to pass it to exec*(). It might be that perl (in my example) and shell (as used most of the time) are capable of breaking the command line into the arg vector, while crm interpreter is not? Just a hypothesis. On another note, I'd suggest to *not* put crm scripts into /var. I think the proper place for them is either /usr/lib, or even better /usr/share (as they are architecture independent). Eugene On 01/11/2011 05:39 PM, [email protected] wrote: > Thomas Spahni <[email protected]> writes: > >> Hi all >> >> It's a long time since my last post, but here I'm back. >> >> I have built a .rpm package of crm114 for the openSUSE distribution >> (actually in my private repository, not (yet) public). Because these >> packages are built for the x86_64 architecture as well, I picked the >> crm114-20081111-BlameBarack-Ger-4560.src.tar.bz2 version for the build. >> >> The installation puts the executables into /usr/bin/ and the crm scripts >> and the .mfp and .css files into the /var/lib/crm114/ directory. This >> directory is included in the PATH and .crm program files are found. Now I >> would like to make /var/lib/crm114 the default location. >> >> This works: >> >> echo "Hello world" | crm -u /var/lib/crm114 mailreaver.crm >> Hello world >> X-CRM114-Version: 20081111-BlameBarack, rev 10118 (TRE 0.7.5 (LGPL, >> APPROX, >> WCHAR, MULTIBYTE)) MR-5829E8AB >> X-CRM114-CacheID: sfid-20110111_143154_387710_B0E52071 >> Message-Id: (sfid-20110111_143154_387710_B0E52071) >> X-CRM114-Status: UNSURE ( 0.00 ) >> X-CRM114-Notice: Please train this message. >> >> >> This does not work: >> >> a) Changing the shebang line in the scripts to add the additional >> arguments for crm114. Linux passes all remaining arguments as *one* >> argument, which will be considered to be a filename with spaces. >> >> b) echo "Hello world" | mailreaver.crm --fileprefix=/var/lib/crm114/ >> >> Aw, crud. maillib.crm broke. Here's the error: >> >> crm114: *WARNING* >> Nonexistent Classify table named: >> /var/lib/crm114//var/lib/crm114//nonspam.css >> I'll try to keep working. >> This happened at line 3565 of file /var/lib/crm114/mailreaver.crm: >> classify <:*:clf:> [:*:text:] /:*:lcr:/ /:*:clf_vt_cfg:/ >> (:*:fileprefix::*:goodcss: | :*:fileprefix::*:spamcss: ) >> (:classify_status:) >> (runtime system location: crm_osb_bayes.c(1433) in routine: >> crm_expr_osb_bayes_classify) >> >> This seems to be a bug in the mailreaver.crm script. >> >> >> Question: What is the preferred way to set a default file location system >> wide? I want that users can just do: >> >> cat email.txt | mailreaver --good >> >> or similar. Thank you. > > Hmmm.... (a) is particularly strange. Here's my attempt to reproduce > the script (note linewrap fixups), which doesn't show the issue: > > bash-4.1$ uname -a > Linux starbuck 2.6.34.7-56.fc13.x86_64 #1 SMP Wed Sep 15 03:36:55 UTC > 2010 x86_64 x86_64 x86_64 GNU/Linux > bash-4.1$ > bash-4.1$ crm -v > This is CRM114, version 20090807-BlameThorstenAndJenny (TRE 0.8.0 > (BSD)) > Copyright 2001-2006 William S. Yerazunis > This software is licensed under the GPL with ABSOLUTELY NO WARRANTY > bash-4.1$ > bash-4.1$ crm '-{window; output /HERE YOU GO!\n :*:_arg1: \n :*:_arg2: \n :*:_arg3: \n/;}' foo bar > HERE YOU GO! > -{window; output /HERE YOU GO!\n :*:_arg1: \n :*:_arg2: \n :*:_arg3: > \n/;} > foo > bar > bash-4.1$ > bash-4.1$ cat > crmdebug.sh > crm '-{window; output /HERE YOU GO!\n :*:_arg1: \n :*:_arg2: \n :*:_arg3: \n/;}' foo bar > bash-4.1$ ./crmdebug.sh > bash: ./crmdebug.sh: Permission denied > bash-4.1$ sh ./crmdebug.sh > HERE YOU GO! > -{window; output /HERE YOU GO!\n :*:_arg1: \n :*:_arg2: \n :*:_arg3: \n/;} > foo > bar > bash-4.1$ > bash-4.1$ chmod a+x crmdebug.sh > bash-4.1$ ./crmdebug.sh > HERE YOU GO! > -{window; output /HERE YOU GO!\n :*:_arg1: \n :*:_arg2: \n :*:_arg3: \n/;} > foo > bar > bash-4.1$ > > So, I honestly don't know what's wrong. It seems to work fine, command > line args appear correctly both when typed in on the command line, and > when executed as part of a shell script. But if something was causing > everything to get bunched all together, then your second bug would > follow logically (i.e. the initialization scripts would not create > the .css files in the right places, and you'd see a failure). > > What happens when you try to run the megatest script? Does Megatest > pass? > > - Bill Yerazunis > > > > > > ------------------------------------------------------------------------------ > Gaining the trust of online customers is vital for the success of any company > that requires sensitive data to be transmitted over the Web. Learn how to > best implement a security strategy that keeps consumers' information secure > and instills the confidence they need to proceed with transactions. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Crm114-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/crm114-general ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Crm114-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crm114-general
signature.asc
(application/pgp-signature, 262 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0sk5oACgkQfrw/cIw6UWkGXQCgwu1HMQHziq+X3szMroJfxpJg Z20AoMo/h0J7BhvZXV4sh0mYlEDTQrf5 =7IaI -----END PGP SIGNATURE-----