Re: [Cooker] Re: mktemp does not work
On Wednesday, August 28, 2002, at 08:55 PM, Todd Lyons wrote: >> You're 100% positive on this? Was it on Mandrake you used 4 X's, or >> BSD? I've got 7.2 up in vmware for some security testing and just ran >> "mktemp file." and get the cannot create error, and the manpage >> indicates 6 X's. > > man mktemp on RH 7.1: > The template may be any file name with some number of `Xs' > appended > to it, for example /tmp/temp.. The trailing `Xs' are replaced with > the current process number and/or a unique letter combination. The > number of unique file names mktemp can return depends on the number of > `Xs' provided; six `Xs' will result in mktemp testing roughly 26 ** 6 > combinations. > > However, when you try to do less than 6: > [root@atlantis /root]# mktemp -u fileXXX > Cannot create temp file fileXXX > [root@atlantis /root]# mktemp -u fileX > Cannot create temp file fileX > [root@atlantis /root]# mktemp -u fileXX > fileMdioDs > > The interesting thing is what happens when you go more than 6: > [root@atlantis /root]# mktemp -u file > fileXXsswMeG > > I think I just remembered backwards (ie I wanted more than 6 but could > only get 6). Looks like 6 is the magic number... no more, no less. >> I don't think it changed from 7.2 to cooker (ie. from 6 to 4 and back >> to 6). > > I believe you are right. This is a RedHat-ism it appears. Yup... I think we should use the BSD mktemp, but it's at version 1.4 while our mktemp is 1.5, even though it's "more obsolete". I'll see if we can put it in cooker since it's not an urgent thing, it may be better to wait until post-9.0. -- MandrakeSoft Security; http://www.mandrakesecure.net/ FE6F2AFD: "lynx -source http://linsec.ca/vdanen.asc | gpg --import" Fingerprint: 88D8 0D23 8D4B 3407 5BD7 66F9 2043 D0E5 FE6F 2AFD PGP.sig Description: PGP signature
Re: [Cooker] Re: mktemp does not work
Todd Lyons ([EMAIL PROTECTED]) wrote: > Vincent Danen wrote on Wed, Aug 28, 2002 at 06:04:01PM -0600 : > > > > You're 100% positive on this? Was it on Mandrake you used 4 X's, or > > BSD? I've got 7.2 up in vmware for some security testing and just > > ran "mktemp file." and get the cannot create error, and the > > manpage indicates 6 X's. > > man mktemp on RH 7.1: > The template may be any file name with some number of `Xs' appended > to it, for example /tmp/temp.. The trailing `Xs' are replaced > with the current process number and/or a unique letter combination. > The number of unique file names mktemp can return depends on the > number of `Xs' provided; six `Xs' will result in mktemp testing > roughly 26 ** 6 combinations. > > However, when you try to do less than 6: > [root@atlantis /root]# mktemp -u fileXXX > Cannot create temp file fileXXX > [root@atlantis /root]# mktemp -u fileX > Cannot create temp file fileX > [root@atlantis /root]# mktemp -u fileXX > fileMdioDs > > The interesting thing is what happens when you go more than 6: > [root@atlantis /root]# mktemp -u file > fileXXsswMeG > > I think I just remembered backwards (ie I wanted more than 6 but could > only get 6). > > > I don't think it changed from 7.2 to cooker (ie. from 6 to 4 and > > back to 6). > > I believe you are right. This is a RedHat-ism it appears. RedHat-ism *g* Anyway. The sourcecode in the linux version is 4 years old and the source-code from the author is from december 2001 and contains a few minor improvements which result in better code, the ability to specify other templates and the -t option that results is a direct use of the tempdirectory. All in all my recommendation is to upgrade to mktemp 1.4 after mdk 9.0 Groetjes, Han. -- http://www.xs4all.nl/~hanb/software
Re: [Cooker] Re: mktemp does not work
Vincent Danen wrote on Wed, Aug 28, 2002 at 06:04:01PM -0600 : > > You're 100% positive on this? Was it on Mandrake you used 4 X's, or > BSD? I've got 7.2 up in vmware for some security testing and just ran > "mktemp file." and get the cannot create error, and the manpage > indicates 6 X's. man mktemp on RH 7.1: The template may be any file name with some number of `Xs' appended to it, for example /tmp/temp.. The trailing `Xs' are replaced with the current process number and/or a unique letter combination. The number of unique file names mktemp can return depends on the number of `Xs' provided; six `Xs' will result in mktemp testing roughly 26 ** 6 combinations. However, when you try to do less than 6: [root@atlantis /root]# mktemp -u fileXXX Cannot create temp file fileXXX [root@atlantis /root]# mktemp -u fileX Cannot create temp file fileX [root@atlantis /root]# mktemp -u fileXX fileMdioDs The interesting thing is what happens when you go more than 6: [root@atlantis /root]# mktemp -u file fileXXsswMeG I think I just remembered backwards (ie I wanted more than 6 but could only get 6). > I don't think it changed from 7.2 to cooker (ie. from 6 to 4 and back > to 6). I believe you are right. This is a RedHat-ism it appears. Blue skies... Todd -- | MandrakeSoft USA | Sometimes you get what you want. | | http://www.mandrakesoft.com | Sometimes you get experience.| | http://www.mandrakelinux.com |--unknown origin | msg72969/pgp0.pgp Description: PGP signature
Re: [Cooker] Re: mktemp does not work
On Wednesday, August 28, 2002, at 03:27 PM, Todd Lyons wrote: >>> I got a repeatable here: >>> Please test: ``mktemp file.XXX'' >>> I get: ``Cannot create temp file file.XXX'' >> This is because you're using mktemp wrong. You need 6 X's... ie. >> mktemp file.X >> file.0AgVNF >> Read the manpage... it indicates that 6 X's are required in the >> template. > > This is new I believe (the requirement of 6). I've used it in the past > with 4 X's and it worked fine. (Just wanted to let Han know that he > wasn't crazy...errr...not too much at least :) You're 100% positive on this? Was it on Mandrake you used 4 X's, or BSD? I've got 7.2 up in vmware for some security testing and just ran "mktemp file." and get the cannot create error, and the manpage indicates 6 X's. I don't think it changed from 7.2 to cooker (ie. from 6 to 4 and back to 6). -- MandrakeSoft Security; http://www.mandrakesecure.net/ FE6F2AFD: "lynx -source http://linsec.ca/vdanen.asc | gpg --import" Fingerprint: 88D8 0D23 8D4B 3407 5BD7 66F9 2043 D0E5 FE6F 2AFD PGP.sig Description: PGP signature
Re: [Cooker] Re: mktemp does not work
Vincent Danen wrote on Wed, Aug 28, 2002 at 10:49:57AM -0600 : > > >I got a repeatable here: > >Please test: ``mktemp file.XXX'' > >I get: ``Cannot create temp file file.XXX'' > This is because you're using mktemp wrong. You need 6 X's... ie. > mktemp file.X > file.0AgVNF > Read the manpage... it indicates that 6 X's are required in the > template. This is new I believe (the requirement of 6). I've used it in the past with 4 X's and it worked fine. (Just wanted to let Han know that he wasn't crazy...errr...not too much at least :) Blue skies... Todd -- Todd Lyons -- MandrakeSoft, Inc. http://www.mandrakesoft.com/ UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn Cooker Version mandrake-release-9.0-0.3mdk Kernel 2.4.19-5mdk msg72904/pgp0.pgp Description: PGP signature