Bug 14891 - RPCGEN generates xdr_uint when it needs xdr_u_int
RPCGEN generates xdr_uint when it needs xdr_u_int
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-07-31 11:48 EDT by Howard Lander
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-11 04:50:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Howard Lander 2000-07-31 11:48:39 EDT
I have a .x file.  It defines a proto that needs a uint.  When the code is generated the xdr call generated is xdr_uint,
 which is not found in libnsl.a.  We are using

glibc-2.1.3-15 and glibc-devel-2.1.3-15

I'll be happy to provide more info on request.

Thanks
Howard
Comment 1 Jakub Jelinek 2000-08-09 11:54:16 EDT
Yep, can you send me that .x file (or at least a cut down version of it which
still shows the bug)
and rpcgen command line used?
Comment 2 Howard Lander 2000-08-10 17:50:59 EDT
Here is my .x file:
#include "isunrpcdefs.h"

#ifdef RPC_SVC
%ISunAsyncResult  *pResult = NULL;
#endif

union getuser_res switch (int errno) {
case 0:
  ISunUser thisUser;
default:
  void;
};

union getacctno_res switch (int errno) {
case 0:
  uint acctno;
default:
  void;
};

union getallcontact_lists_res switch (int errno) {
case 0:
  ISunContactList pLists<>;
default:
  void;
};



program ISUNRPCAPISERVER {
  version ISUNRPCVERS {

    getuser_res ISunRPCGetUser(uint acctno) = 1;

    getacctno_res
      ISunRPCGetAcctnoFromUsername(string userName, uint iDomainID ) = 2;

    int ISunRPCInit() = 3;

    getallcontact_lists_res ISunRPCGetAllContactLists(uint acctno) = 4;
  } = 1;
} = 0x20000001;

*********** Here is the file included in the .x **************

#ifndef _ISUNRPCDEFS_H_
#define _ISUNRPCDEFS_H_

#ifndef _ISUNUSER_H_

#define ISUN_USERNAME_SIZE      33
#define ISUN_PASSWORD_SIZE      33
#define ISUN_FIRSTNAME_SIZE     31
#define ISUN_MIDDLENAME_SIZE    31
#define ISUN_LASTNAME_SIZE      31
#define ISUN_ADDRESS_SIZE       31
#define ISUN_CITY_SIZE          26
#define ISUN_COUNTRY_SIZE       31
#define ISUN_ZIPCODE_SIZE       10
#define ISUN_EMAILADDRESS_SIZE  256
#define ISUN_APPNAME_SIZE       65
#define ISUN_DESCRIPTION_SIZE   33
#define ISUN_ACCESSFLAG_SIZE    33
#define ISUN_GUIDSTRING_SIZE    52
#define ISUN_ODBC_DEFAULT_CONNECTION_SIZE    256
#define ISUN_HOMEDIR_SIZE       256
#define ISUN_PREFNAME_SIZE      33
#define ISUN_PREFVALUE_SIZE     256
#define ISUN_URL_SIZE           256
#define ISUN_DOMAINNAME_SIZE    65
#define ISUN_ORGANIZATION_SIZE  31
#define ISUN_PHONE_SIZE         15
#define ISUN_SMALLMSG_SIZE      81
#define ISUN_MEDIUMMSG_SIZE     256
#define ISUN_LARGEMSG_SIZE      2049

struct ISunUser {
        uint    m_iAcctno;
        uint    m_iAccountStatus;
        char    m_cUserName[ISUN_USERNAME_SIZE];
        uint    m_iDomainID;
        char    m_cPassword[ISUN_PASSWORD_SIZE];
        char   m_cFirstName[ISUN_FIRSTNAME_SIZE];
        char   m_cLastName[ISUN_LASTNAME_SIZE];
        char   m_cMiddleName[ISUN_MIDDLENAME_SIZE];
        char   m_cEmailAddress[ISUN_EMAILADDRESS_SIZE];
        char   m_cHomeDirectory[ISUN_HOMEDIR_SIZE];
};

struct ISunContactList {
  uint  m_iAcctno;
  uint  m_iListCode;
  uint  m_iListFlags;
  uint  m_iListFlagsExtra;
  char  m_cDescription[ISUN_DESCRIPTION_SIZE];
  char  m_cAccessType;
  char  m_cNickName[ISUN_USERNAME_SIZE];
};


#endif
#endif

Put these two files in a directory and type rpcgen -N *.x followed by grep xdr_uint *.c.  These should reproduce the problem


Comment 3 Jakub Jelinek 2000-08-11 04:50:21 EDT
You should either change all the uint types to u_int or some other type,
or define xdr_uint yourself.
I have just verified that Solaris rpcgen behaves the same way, xdr_uint
does not exist in the system libraries and rpcgen generates it for uint variables.
In fact, rpcgen just adds xdr_ prefix to all the types and it is up to you
to make sure you either use the glibc recognized standard types or supply
your own handlers.
Comment 4 Howard Lander 2000-08-11 10:07:30 EDT
OK, I guess I can live with this.  One question though: When you are talking about glibc recognized standard types, are you referring to the 
xdr types or the c intrinsic types?  I guess if it was me writing the rpcgen and xdr library, I'd have ensured that you could use
the c intrinsic types in the .x files.  I would have either renamed xdr_u_int to xdr_uint, or supported them both. I don't remember
u_int being a valid type in any c compiler I have ever seen.

Anyway, thanks for the information and for looking at the situation.  I'll probably just define xdr_uint to be xdr_u_int and go on!

I will mark this bug as resolved, but I think I will choose wontfix instead of notabug, since I still think the behavior is incorrect (even
if it is standard).  Since there is a perfectly usable workaround, that seems like the right choice to me.  I certainly won't complain 
if you want a different resolution, this is just my opinion.  I'm really not sure how bugzilla works: if you need me to change the
resolution I will.

Howard

Note You need to log in before you can comment on or make changes to this bug.