Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • 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.

  • 3
  • 2
1 Solution

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.

Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
Do you encode a plain file without any setuid and/or setgid mode?
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions


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.

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 be
`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.
sandr5Author Commented:
Oops, I guess I clicked on a link while typing my post, and the link got embedded.  Please ignore that.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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