This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ITP] libfakesu 1.0


Hi Christian,

Christian Franke wrote:
> 
> D. Boland wrote:
> > http://cygwin.boland.nl/x86/release/libfakesu/
> 
> A few notes regarding cygfakesu.c:
> 
> > uid_t root_uid = 18;
> > gid_t root_gid = 544;
> >
> > uid_t my_uid = -1;
> > gid_t my_gid = -1;
> >
> > struct passwd my_pw;
> > struct group my_grp;
> >
> > char str255[255];
> > ...
> > uid_t uid_get(uid_t uid){
> > ...
> > gid_t gid_get(gid_t gid){
> > ...
> > etc...
> 
> Variables and functions not exported by the fakesu.h file should be
> declared as static. Note that the cygfakesu.def file has no effect when
> generating a static lib.

I added 'static' for un-exported symbols. Removed cygfakesu.def.

> 
> $ gcc -Wall cygfakesu.c
> ...
> cygfakesu.c:52:2: warning: implicit declaration of function â??getuidâ??
> [-Wimplicit-function-declaration]
> ...
> 
> Include of unistd.h is missing.

Added it.

> 
> > int su_setgroups(int size, const gid_t *list){
> > ...
> >     gid_t l[s];
> > ...
> >     return setgroups(size, &l);
> 
> setgroups() 2nd parameter expects a type compatible to 'pointer to const
> git_t'
> The type of '&l' is 'pointer to array of git_t' :-)
> (cosmetic in C, compilation would fail in C++):

I added typecasting, like this:

	return setgroups(size, (gid_t *) &l);

Would that satisfy c++?

Anyway, thanks for pointing it out.

Daniel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]