RPM Community Forums

Mailing List Message of <rpm-devel>

Re: rpm 4.4.9 missing neon support in Solaris 9 - build issue? (fwd)

From: David Halik <dhalik@jla.rutgers.edu>
Date: Wed 07 Nov 2007 - 21:38:14 CET
Message-ID: <Pine.SOC.4.64.0711071537420.15811@jla.rutgers.edu>

One more...

=================================
David Halik
Systems Programmer
OSS/NBCS - OIT Rutgers
dhalik@jla.rutgers.edu
=================================

---------- Forwarded message ----------
Date: Tue, 6 Nov 2007 12:17:21 -0500
From: Jeff Johnson <n3npq@mac.com>
To: David Halik <dhalik@jla.rutgers.edu>
Subject: Re: rpm 4.4.9 missing neon support in Solaris 9 - build issue?


On Nov 6, 2007, at 11:03 AM, David Halik wrote:

> 
>> 
>> All depends on how the URL is opened, and there
>> have been flip-flop's in rpm code about whether rpm should be network
>> aware or not.
>> 
>> Find the open, it should *NOT* look like
>> fd = Fopen(url, "r.fdio");
>> the "fdio" explicitly turns off network protocols.
>> 
>> Changing "fdio" to "ufdio" should explicitly permit network access:
>> fd = Fopen(url, "r.ufdio");
>> 
>> The default access is ufdio for many years in code I work with.
>> 
>> 73 de Jeff
>> 
> 
> Thanks, thats definitely going in the right direction. I grepped through the 
> 4.4.9 sourceball and I couldn't find the either line that you listed, but I 
> think I see whats going on. I might be totally off here, but here it goes...
> 
> The debug message shows:
> 
> Fopen fdio path <url> fmode r
> 
> Which is probably wrong after what you said. You listed fd = Fopen(url, 
> "r.ufdio"); which I can't find, but this looks interesting:
> 
> # /usr/local/gnu/bin/grep -nR Fopen\(url  *
> rpmio/url.c:554:    sfd = Fopen(url, "r");
> #
>

What makes diagnosing tricky is that the default behavior was changed from 
non-network
"fdio" to network-aware "ufdio" and then "fdio" was added deliberately
prevent network access in rpm.

If you give me a reference point (i.e. a url to a *.src.rpm) to whatevger you 
are calling
rpm "sources", I'll try to give you line no.'s wrto that reference point.


> Which is...
>
>   sfd = Fopen(url, "r");
>   if (sfd == NULL || Ferror(sfd)) {
>       rpmMessage(RPMMESS_DEBUG, _("failed to open %s: %s\n"), url, 
> Fstrerror(sfd));
>       rc = FTPERR_UNKNOWN;
>       goto exit;
>   }
> 
> Should that be r.ufdio instead of just r? Maybe r is using fdio? Not sure. it 
> looks like it is definitely calling that since the error message is the same 
> as listed there. Once I get in to work I'm going to try out switching that 
> around.
>

If you add "r.ufdio" explicitly, the Fopen will be network aware.

> The closet match to what you gave me is rpmio/tget.c:
> 
> static void readFile(const char * path)
> {
>   FD_t fd;
> 
> fprintf(stderr, "===== %s\n", path);
>   fd = Fopen(path, "r.ufdio");
>   if (fd != NULL) {
>       char buf[BUFSIZ];
>       size_t len = Fread(buf, 1, sizeof(buf), fd);
>       int xx = Fclose(fd);
>
>       if (len > 0)
>           fwrite(buf, 1, len, stderr);
>   }
> }
> 
> But... considering it uses "path" and not "url" that can't be right. I'm 
> guessing that the reason my --ftpdebug isn't showing anything is the fact 
> that its using the wrong mode, and therefore doesn't know it's a url/ftp.
>

For rpmio API purposes, paths/url's are both permitted as the 1st argument to 
Fopen().

> Thank you so much for the help on this, I'm sorry to keep harassing you with, 
> I definitely appreciate the pointers. By the way, I'm using the untouched 
> 4.4.9 source for all of this, so anything here should be the same as what you 
> have.
>

np, tnx for tnx ;-)

73 de Jeff
Received on Wed Nov 7 21:38:17 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.