[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[debian-hurd-Patches][310742] analog 6.0-14 hurd patch



debian-hurd-Patches item #310742, was changed at 2012-06-01 01:28 by Barry deFreese
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=410472&aid=310742&group_id=30628

>Status: Closed
Priority: 3
Submitted By: Flávio Cruz (flaviocruz-guest)
Assigned to: Nobody (None)
Summary: analog 6.0-14 hurd patch 
Category: None
Group: None
>Resolution: Out of Date


Initial Comment:
analog 6.0-14 patch for GNU/Hurd

----------------------------------------------------------------------

>Comment By: Barry deFreese (bdefreese)
Date: 2012-06-01 01:28

Message:
Newer patch filed in BTS.

----------------------------------------------------------------------

Comment By: Samuel Thibault (sthibaul-guest)
Date: 2008-04-30 23:38

Message:
Mmm, now it's rather about style. Maybe you can send it as is, but maybe
this could pose problem: you could avoid defining has_path_access() by
writing something like:

#ifdef __GLIBC__
      commandpath = realpath(t, NULL);
      if (commandpath != NULL)
#else
      if (realpath(t, commandpath))
#endif
      {
	if (access(commandpath, X_OK) == 0 &&
	stat(commandpath, &buf) == 0 && S_ISREG(buf.st_mode))
	  done = TRUE;
      }
#ifdef __GLIBC__
	else
	  free(commandpath);
#endif

but it's really a matter of taste (the maintainer's taste ;) ), you
could for instance propose two versions of the patch.


----------------------------------------------------------------------

Comment By: Flávio Cruz (flaviocruz-guest)
Date: 2008-04-30 20:42

Message:
New version ;-)

----------------------------------------------------------------------

Comment By: Samuel Thibault (sthibaul-guest)
Date: 2008-04-30 00:01

Message:
4K may still not be enough for the path below ;)


----------------------------------------------------------------------

Comment By: Flávio Cruz (flaviocruz-guest)
Date: 2008-04-29 23:56

Message:
Huu, you're right, but using realpath("/", NULL) doesn't just strdup's "/", but a buffer with 4K filled with "/ \0", at least in my system. Which means that the code below works OK.

But yeah, it's much better to patch the realpath calls just below.

----------------------------------------------------------------------

Comment By: Samuel Thibault (sthibaul-guest)
Date: 2008-04-28 23:27

Message:
Errr, I don't understand: why are you calling realpath("/", NULL)?  You
will just get an strdup of "/", which won't work with what is done
below.  You should rather patch the realpath() calls below.


----------------------------------------------------------------------

Comment By: Flávio Cruz (flaviocruz-guest)
Date: 2008-04-28 23:14

Message:
I've updated the patch

----------------------------------------------------------------------

Comment By: Samuel Thibault (sthibaul-guest)
Date: 2008-04-27 19:39

Message:
Mmm, SUS says that _PC_PATH_MAX is to be used for pathconf(), not
sysconf...

Also, it actually returns -1, since we don't have any path limitation
in GNU/Hurd.  A more correct fix is to set commandname to NULL to let
GLIBC's realpath allocate the string for us.  That should be done #ifdef
__GLIBC__ of course (that extension is not yet in SUS)


----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=410472&aid=310742&group_id=30628


Reply to: