public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: mkshortcut debugging problem
@ 2002-02-28 22:50 Joshua Daniel Franklin
  0 siblings, 0 replies; 11+ messages in thread
From: Joshua Daniel Franklin @ 2002-02-28 22:50 UTC (permalink / raw)
  To: cygwin

>Permissions or ACLs on the two different directories?  Try
>
>getfacl {dir1}
>getfacl {dir2}
>
>Same?  Different?

Well, it's writing to the same directory in both cases, but the ACLs are:

$ getfacl.exe /c/Documents\ and\ Settings/All\ Users/Desktop/
# file: /c/Documents and Settings/All Users/Desktop/
# owner: Administrator
# group: None
user::rwx
group::rwx
group:Users:r-x
group:Power Users:rwx
mask::rwx
other::r-x
default:user::---
default:group::---
default:group:Users:---
default:group:Power Users:rwx
default:mask::---
default:other::---

Or did you mean the ACLs on /bin and /usr/src...? Those look identical.

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: mkshortcut debugging problem
@ 2002-03-07 23:03 Joshua Daniel Franklin
  0 siblings, 0 replies; 11+ messages in thread
From: Joshua Daniel Franklin @ 2002-03-07 23:03 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 869 bytes --]

Well, after going over hoards of MSDN documents and adjusting my
code, I realized what most developers' first guess might have been...

I followed the null pointer. Madness overtook me.

I corrected this (char *)problem and my util actually passed all my
tests, no matter which directory it was in. I also ran it through 
GNU indent a few times (just to make sure :)
Features of this version include:

--Prettier code, thanks to indent
--Better error checking
--Works ;)

Because of the indent the patch is bigger than the actual file, 
so here's the whole thing. (Chuck, this should be drop-in replacement 
for the one in cygutils-0.9.9. I apologize for the inconvenience.)

Thanks again to Corinna and Jason for the help.

__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

[-- Attachment #2: mkshortcut.c.bz2 --]
[-- Type: application/octet-stream, Size: 3491 bytes --]

[-- Attachment #3: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: mkshortcut debugging problem
@ 2002-03-02 19:49 Joshua Daniel Franklin
  2002-03-04  4:50 ` Jason Tishler
  2002-03-12 23:33 ` Charles Wilson
  0 siblings, 2 replies; 11+ messages in thread
From: Joshua Daniel Franklin @ 2002-03-02 19:49 UTC (permalink / raw)
  To: Jason Tishler; +Cc: cygwin

Thanks much, I'll take a look. Sure is easy to read...looks almost like
Python.

:)

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: mkshortcut debugging problem
@ 2002-03-01 17:00 Joshua Daniel Franklin
  2002-03-02  8:08 ` Jason Tishler
  0 siblings, 1 reply; 11+ messages in thread
From: Joshua Daniel Franklin @ 2002-03-01 17:00 UTC (permalink / raw)
  To: cygwin

> On Thu, Feb 28, 2002 at 04:03:34PM -0800, Joshua Daniel Franklin wrote:
> > The code that produces this error is:
> >
> >       MultiByteToWideChar (CP_ACP, 0, lname, -1, widepath, MAX_PATH);
> >       hres = pf->lpVtbl->Save (pf, widepath, TRUE);
> >       if (!SUCCEEDED(hres))
> >       {
> >         fprintf(stderr, "%s: Save to persistant storage failed (Does the
> > directo
> > ry you are writing to exist?)\n", prog_name);
> >         exit(3);
> >       }
>
> Try the following before calling pf->lpVtbl->Save():
>
>    GetCurrentDirectory(dir);
>    pf->lpVtbl->SetRelativePath(dir);
>
> This is just basically as it should work.  Look in MSDN for the
> exact usage.
>
> Corinna
>

Tried this, no difference:

/usr/src/cygutils-0.9.9/src-gpl$ ./mkshortcut -P http://www.cygwin.com #works
/usr/src/cygutils-0.9.9/src-gpl$ cp ./mkshortcut.exe /bin/
/usr/src/cygutils-0.9.9/src-gpl$ /bin/mkshortcut -P http://www.cygwin.com
mkshortcut: Save to persistant storage failed (Does the directory you are
writing to exist?)

Has anyone even seen something like this before?

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 11+ messages in thread
* mkshortcut debugging problem
@ 2002-02-28 17:33 Joshua Daniel Franklin
  2002-02-28 19:30 ` Charles Wilson
  2002-03-01  5:00 ` Corinna Vinschen
  0 siblings, 2 replies; 11+ messages in thread
From: Joshua Daniel Franklin @ 2002-02-28 17:33 UTC (permalink / raw)
  To: cygwin

I updated to cygutils 0.9.9 yesterday which included the utility
'mkshortcut', which I wrote. I was horrified to find that it dumps
the stack when attempting to set the name for a shortcut (the -n 
option). I *did* make sure it worked before sending Chuck the code, 
after all. My first thought was that I accidentally sent an old 
version, so I got the source and found that it did indeed crash 
when built as I had been doing it. I freely acknowledge that the
code, especially string-handling, is a mess, and after making what 
seem to be arbitary changes it again works...but only from the current
directory. When I copy the new version to /bin (or /usr/bin) this is
what happens:

/usr/src/cygutils-0.9.9/src-gpl$ /usr/src/cygutils-0.9.9/src-gpl/mkshortcut.exe
-DA /usr/local/bin/
[This works, producing bin.lnk in the All Users\Desktop\ dir]
/usr/src/cygutils-0.9.9/src-gpl$ rm /c/Documents\ and\ Settings/All\
Users/Desktop/bin.lnk 
/usr/src/cygutils-0.9.9/src-gpl$ cp
/usr/src/cygutils-0.9.9/src-gpl/mkshortcut.exe /usr/bin/
/usr/src/cygutils-0.9.9/src-gpl$ mkshortcut.exe -DA /usr/local/bin/
mkshortcut.exe: Save to persistant storage failed (Does the directory you are
writing to exist?)

The code that produces this error is:

      MultiByteToWideChar (CP_ACP, 0, lname, -1, widepath, MAX_PATH);
      hres = pf->lpVtbl->Save (pf, widepath, TRUE);
      if (!SUCCEEDED(hres)) 
      {
        fprintf(stderr, "%s: Save to persistant storage failed (Does the
directo
ry you are writing to exist?)\n", prog_name);
        exit(3);
      }

I'm afraid I have no idea how to debug this, and I've begun to make what
seem like arbitrary changes. Why would it work from one directory and not
another? (BTW, I tried printf'ing the lname string and it is identical in
both cases.) Anyone have any suggestions?

Thanks.
Joshua Daniel Franklin

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-03-13 14:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-28 22:50 mkshortcut debugging problem Joshua Daniel Franklin
  -- strict thread matches above, loose matches on Subject: below --
2002-03-07 23:03 Joshua Daniel Franklin
2002-03-02 19:49 Joshua Daniel Franklin
2002-03-04  4:50 ` Jason Tishler
2002-03-12 23:33 ` Charles Wilson
2002-03-13  6:37   ` Joshua Daniel Franklin
2002-03-01 17:00 Joshua Daniel Franklin
2002-03-02  8:08 ` Jason Tishler
2002-02-28 17:33 Joshua Daniel Franklin
2002-02-28 19:30 ` Charles Wilson
2002-03-01  5:00 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).