• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

mode issue on uuencode

Hi -
I'm using uuencode to email an attachment using sendmail (this option cannot change) and on the test system, it sets the mode as 0 in the begin line, instead of the same as the file permissions (which is set to 666):
begin 0 Report.txt

On production, the file permissions on the file are 664, and it creates the following:
begin 666 Report.txt

Now, the versions of uuencode are different on the test vs production.
Test - $Revision: 92453-07 linker linker crt0.o A.10.44 951205 $
Prod -  $Revision: 92453-07 linker linker crt0.o B.11.16 000601 $
(not sure how else to get the version of uuencode)

Is there some kind of known issue or something that the mode in the begin line of the encoded text does not match exactly the file's permissions?  Or maybe we aren't using uuencode correctly, or are missing a setting, etc...  The production begin line we can live with, since at least the users can still decode the email attachment, but the 0 does not decode at all.  Any help is appreciated.   Currently, we are scanning the encoded text for the begin line with the 0 and replacing with 666 so as to get it to work, but would like to do this the right way, instead of a hack :)

Let me know if any additional info is needed.

0
sandr5
Asked:
sandr5
  • 3
  • 2
1 Solution
 
JJSmithCommented:

I think the Revision number you are seeing relate to the C compiler that compile the uuencode command.

you might try a 'what' command against your uuencode binary.


0
 
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
Do you encode a plain file without any setuid and/or setgid mode?
0
 
sandr5Author Commented:
Yep - it's just a text file with some text and the actual source looks like -

        echo "From: $From
To: $RecptEmailAddress
Cc: $SenderemailAddress
Reply-To: $RecptEmailAddress
Subject: $NotifySubject

`cat $CoverLetterName`

`cat $ActualFileName | uuencode TransactionReport.txt `

." | /usr/sbin/sendmail -t
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
JJSmithCommented:

if you are 'uuencode'ing standard input;

`cat $ActualFileName | uuencode TransactionReport.txt`

and pipeing that to a sendmail command - how do expect file permissions to be detemined?

I would check the umask in both environments to see if that accounts for 666 in production and 0 in test.

Cheers
JJ
0
 
sandr5Author Commented:
Hi -
I see the umask in test is 00 and in prod is 00 (I'm not sure if i checked it right, typed "umask" at the prompt).  I also "touched" a file in test, and the permissions on it were 666 (this is logged in as the user under which the scripts are run)

However, you bring up an interesting point about the piping to the uuencode.  Instead, I changed it to behttp://www.experts-exchange.com/Operating_Systems/Unix/acceptAnswer.jsp?aid=17188576
Accept
`uuencode $ActualFileName TransactionReport.txt`
." | /usr/sbin/sendmail -t

and that works to set the mode value to 666 (or even 777 if I change the permissions on the $ActualFileName first!), so this we will use.
Thanks so much for your help.
0
 
sandr5Author Commented:
Oops, I guess I clicked on a link while typing my post, and the link got embedded.  Please ignore that.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now