Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


mode issue on uuencode

Posted on 2006-07-19
Medium Priority
Last Modified: 2012-06-22
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.

Question by:sandr5
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Expert Comment

ID: 17149370

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.

LVL 16

Expert Comment

by:Hanno P.S.
ID: 17166086
Do you encode a plain file without any setuid and/or setgid mode?

Author Comment

ID: 17167371
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
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!


Accepted Solution

JJSmith earned 1000 total points
ID: 17188576

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.


Author Comment

ID: 17192212
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
`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.

Author Comment

ID: 17192230
Oops, I guess I clicked on a link while typing my post, and the link got embedded.  Please ignore that.

Featured Post

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question