LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-30-2021, 08:07 AM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
uuencode - I must be in the Twilight Zone


Many years ago I took an image file, ran it through uuencode (on a Windoze machine), cut 10 columns from the resulting file and have used that data for years as a source of random passwords. Recently I observed that ALL of my passwords start with "M". I obviously changed the first character to M for some reason but I have no idea why. I decided to generate some new passwords.

I installed sharutils on my CentSOS 7 machine. Based on the man page
Code:
SYNOPSIS
       uuencode [-flag [value]]... [--opt-name[[=| ]value]]... [ in-file ] output-name
I should be able to execute
Code:
uuencode Greta\ Granstedt.jpg Greta.uu
However, no output file is created. The uuencoded data is displayed in the terminal. If I try redirecting
Quote:
uuencode Greta\ Granstedt.jpg > Greta.uu
control does not return to the terminal until I press Ctrl-D. The resulting file contains
Code:
begin 664 Greta Granstedt.jpg
`
end
I have searched and read at least a half dozen tutorials/examples which seem to confirm this syntax. I tried the same operation on Linux Mint 20. Same thing. It can't be this hard

What am I doing wrong?

TIA,

Ken

p.s. See Greta Grandstedt in "Street Scene" on IMDB. You can probably guess which picture I have chosen
 
Old 03-30-2021, 08:21 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Not a fix, as what you got is rather odd...

You might try using the "-m" option and see if it does something a bit different.

In the original version of uuencode/uudecode they were expecting their input to be from STDIN and would merge the output into a mail message or decode the mail message and create the output file.

In your case, (due to the command not terminating until ^D was entered), try:

uuencode <Greta\ Granstedt.jpg > Greta.uu
 
Old 03-30-2021, 08:22 AM   #3
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
From its man page:
Quote:
Note: uuencode uses buffered input and assumes that it is not hand typed from a tty. The consequence is that at a tty, you may need to hit Ctl-D several times to terminate input.
But why use uuencode at all?
Code:
base64 -w10 /dev/urandom|head

Last edited by shruggy; 03-30-2021 at 08:26 AM.
 
1 members found this post helpful.
Old 03-30-2021, 08:51 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by shruggy View Post
From its man page:


But why use uuencode at all?
Code:
base64 -w10 /dev/urandom|head
I thought it was partially due to historical operation and might be needed for decoding elsewhere.

But yes, using base64 would likely provide the equivalent activity.
 
Old 03-30-2021, 08:53 AM   #5
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Thanks jpollard,

I had tried -m. Same issue. The uuencode output looks different of course and is what I would use as a password source (no _ characters.) I tried your suggestion but it failed with a status code of 1 (The operation failed or the command syntax was not valid.)
Code:
uuencode -m <Greta_Granstedt.jpg > Greta.uu
uuencode (GNU sharutils) - encode a file into email friendly text - Ver. 4.13.3
USAGE:  uuencode [ -<flag> | --<name> ]... [ in-file ] output-name
Notice that I also removed the space from the input file name. No improvement.

Thanks shruggy,

I read that note and have used Ctrl-D when necessary. Why uuencode? Why not? I thought it was a rather creative process back when I first did it. It SHOULD still work and I would like to get a handle on it. Who knows, I might want to post something to Usenet

Ken
 
Old 03-30-2021, 08:58 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Quote:
Originally Posted by taylorkh View Post
The operation failed or the command syntax was not valid.
Because it is invalid. uuencode requires a file name to be specified on the command line. The output goes to stdout nevertheless. The file name is only needed in order to be recorded in the first line of the uuencoded file, so that uudecode could restore it when reading from stdin.

Last edited by shruggy; 03-30-2021 at 09:02 AM.
 
Old 03-30-2021, 09:09 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by shruggy View Post
Because it is invalid. uuencode requires a file name to be specified on the command line. The output goes to stdout nevertheless. The file name is only needed in order to be recorded in the first line of the uuencoded file, so that uudecode could restore it when reading from stdin.
THAT is what I forgot. The name is for the output not the input data.
 
Old 03-30-2021, 09:15 AM   #8
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Thanks again shruggy,

I see the original file name in the "output" file when I try to redirect the output
Quote:
uuencode -m Greta_Granstedt.jpg > Greta.uu
produces
Code:
begin-base64 664 Greta_Granstedt.jpg
====
Something strange is going on.

Ken
 
Old 03-30-2021, 09:20 AM   #9
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Thanks once more jpollard,

There must be a way to dump the results of uuencode to a FILE. Otherwise people could not have posted all those porno pictures to Usenet and it never would have grown beyond its discussion board roots

Ken

p.s. Perhaps I should use yenc. I remember when that hit Usenet. What a stink!
 
Old 03-30-2021, 09:36 AM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by taylorkh View Post
Thanks again shruggy,

I see the original file name in the "output" file when I try to redirect the outputproduces
Code:
begin-base64 664 Greta_Granstedt.jpg
====
Something strange is going on.

Ken
How about:

Code:
uuencode -m Greta_Granstedt.jpg <Greta_Granstedt.jpg > Greta.uu
 
1 members found this post helpful.
Old 03-30-2021, 11:06 AM   #11
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Congratulations jpollard - you win the prize!

That did the trick. I then tried
Code:
uuencode -m George.jpg <Greta_Granstedt.jpg > Greta.uu
and it created the first line of the Greta.uu file as
Code:
begin-base64 664 George.jpg
so the first item specified in the command is not related to the file being converted nor the file being created. Is this obvious from the man page? Not to me Actually I think I may have found the root cause of my confusion. Again from the man page
Code:
NOTES
       This manual page was AutoGen-erated from the uuencode option definitions.
Thank you for sticking with this.

Ken
 
Old 03-31-2021, 01:42 AM   #12
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Thanks.

It has been a LONG time since I used uuencode/uudecode. This and shruggy's last comment reminded me of the original intent of uuencode/uudecode as used with uucp.

And the implementation HAS changed. Originally the file name was supposed to be the input file and optional - if missing it processed stdin, and a second name was the name (mandatory) used for the file when uudecode was used.

For some reason the "file" parameter is currently being ignored.

I found this as the OLD documentation... which is what you interpreted the current manpage to be meaning (I did too when I first read it again), and forgot the "file label" name now identified as the "decode_pathname"

http://cng.seas.rochester.edu/CNG/do.../uuencode.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Total War: WARHAMMER II – The Twisted & The Twilight DLC Is Out Now for Linux LXer Syndicated Linux News 0 12-18-2020 12:50 AM
I find file zone in the slave zone to the do a transfer of zone from Windows Server 2012 as master dns and CentOS as slave DNS. To learn Linux - Newbie 1 09-02-2016 09:36 AM
Welcome To The Twilight Zone!! cousinlucky General 9 03-11-2014 09:30 PM
Which zone bind dns work either in forward zone are reverse zone sanjay87 Linux - Server 2 06-05-2012 04:21 AM
[SOLVED] Welcome to the Twilight Zone: SSH logging in with NO AUTHENTICATION fred49 Linux - Security 2 10-01-2011 06:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration