[Libvir] 7/22 no uid_t / getuid

Richard W.M. Jones rjones at redhat.com
Fri Dec 7 12:00:27 UTC 2007


Jim Meyering wrote:
> "Richard W.M. Jones" <rjones at redhat.com> wrote:
>> There is no uid_t or getuid in MinGW.
>>
>> I'm not really sure that forcing connections readonly if the user is
>> non-root is a useful thing to be doing anyway, so perhaps this code is
>> better off just being deleted?
> 
> For the missing uid_t, you could add this to configure.in
> AC_CHECK_TYPE(mode_t, int)
> then no need for ifndef around the decl of "uid".

autoconf docs seem to suggest that this usage is deprecated:

<quote>
  -- Macro: AC_CHECK_TYPE (TYPE, DEFAULT)
      Autoconf, up to 2.13, used to provide this version of
      `AC_CHECK_TYPE', deprecated because of its flaws.  First, although
      it is a member of the `CHECK' clan, it does more than just
      checking.  Secondly, missing types are defined using `#define',
      not `typedef', and this can lead to problems in the case of
      pointer types.
</quote>

> With this function (and a test for getuid in configure.in),
> (or maybe that should be "return 0"?)
> 
> #ifndef HAVE_GETUID
> static int getuid() { return 1; }
> #endif /* __MINGW32__ */
> 
> you could avoid the remaining ifdefs.

Better just to check for getuid?

Having said that I still think it'd be better just to delete this code 
because forcing non-root Xen connections to be readonly doesn't seem 
very useful to me.

Rich.

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20071207/630f9082/attachment-0001.bin>


More information about the libvir-list mailing list