Bug 417 - Please don't change file suffix for sudoedit
Please don't change file suffix for sudoedit
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.7.3
PC Linux
: low enhancement
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-09 08:52 MDT by Reuben Thomas
Modified: 2010-08-02 15:01 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Reuben Thomas 2010-07-09 08:52:36 MDT
Editors like Emacs often choose the editing mode for a file based on
its suffix, and sudoedit frustrates this by adding some random
characters to the file name. Could it please add the random characters
elsewhere? Adding them to just before the suffix would be nice.

I see this needs a different function from mkstemp to achieve. mkstemps is available on many systems (including BSDs and glibc since 2.11), and fits the bill.

Would you consider a patch that uses mkstemps where available and the current code (using mkstemp) otherwise?
Comment 1 Todd C. Miller 2010-07-09 08:57:49 MDT
I'll look at doing this for sudo 1.7.4
Comment 2 Reuben Thomas 2010-07-09 08:58:55 MDT
Thanks, that would be brilliant!
Comment 3 Todd C. Miller 2010-07-09 10:09:05 MDT
This turns out to be fairly simple.  Give this a try:
ftp://ftp.sudo.ws/pub/millert/sudo/sudo-1.7.3-mkstemps.tar.gz
Comment 4 Reuben Thomas 2010-07-09 10:27:09 MDT
That's great, it seems to work fine. Thanks very much!
Comment 5 Todd C. Miller 2010-08-02 15:01:03 MDT
Closing, sudo 1.7.4 is out now.