Solved

mode issue on uuencode

Posted on 2006-07-19
6
394 Views
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.

0
Comment
Question by:sandr5
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:JJSmith
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.


0
 
LVL 16

Expert Comment

by:Hanno Schröder
ID: 17166086
Do you encode a plain file without any setuid and/or setgid mode?
0
 
LVL 1

Author Comment

by:sandr5
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
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 6

Accepted Solution

by:
JJSmith earned 250 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.

Cheers
JJ
0
 
LVL 1

Author Comment

by:sandr5
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
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
 
LVL 1

Author Comment

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to check for shares on HP-UX 1 62
Linux: disable vim auto-comment 7 120
unix example issues 18 91
Wrap Oraccle SQL*Plus executable Command 4 84
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

832 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