Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

About cred structure ....

This question is worth  500 Points  
 


On Solaris 9, there is no header file like <sys/fcred.h> and the fcred structure. Instead there are a cred structure defined in the header file <sys/cred.h>. However solaris 9 does not support the LOCAL_CREDS socket option. Therefore we cant compile any program as it was to get it compiled like on UNIX....

On Linux(red hat), there is a ucred structure defined in <linux/ucred.h> that has three fields. Redhat Linux also supports a SO_PASSCRED socket option that can be used in place of the LOCAL_CREDS option...

I want it to get work on solaris machine... So, my doubt is that " Is there a way to use cred structure as ancillary data in Solaris 9.."

thanks
aman


 
0
amankhan
Asked:
amankhan
  • 3
  • 3
  • 2
  • +1
1 Solution
 
Sjef BosmanGroupware ConsultantCommented:
I haven't a clue. Did you also post a question in the Operating Systems/Solaris TA, pointing to this question? Maybe there's a Solaris expert who knows...
0
 
Sjef BosmanGroupware ConsultantCommented:
And you checked of course with Google? Searching for
    LOCAL_CREDS Solaris
0
 
sunnycoderCommented:
are these file standard or you got them with some package you installed ? I never heard of them nor have I been able to find them on my redhat installation

execute
rpm -qf /path/to/file

and post back the results
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
amankhanAuthor Commented:
[ab1310@hercules ~]$ rpm -qf /usr/include/linux/ucred.h
error: file /usr/include/linux/ucred.h: No such file or directory
[ab1310@hercules ~]$


0
 
sunnycoderCommented:
is there actually a file in that location ?

did you install something from sources ?

what are the contents of the file ?
0
 
amankhanAuthor Commented:
no sir , but theres a file in solaris

/usr/include/sys/cred.h

aman
0
 
amankhanAuthor Commented:
/*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/*        All Rights Reserved   */

/*      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T     */
/*      The copyright notice above does not evidence any        */
/*      actual or intended publication of such source code.     */

/*
 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 *              PROPRIETARY NOTICE (Combined)
 *
 * This source code is unpublished proprietary information
 * constituting, or derived under license from AT&T's UNIX(r) System V.
 * In addition, portions of such source code were derived from Berkeley
 * 4.3 BSD under license from the Regents of the University of
 * California.
 *
 *
 *
 *              Copyright Notice
 *
 * Notice of copyright on this source code product does not indicate
 * publication.
 *
 *      (c) 1986,1987,1988,1989  Sun Microsystems, Inc
 *      (c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
 *              All rights reserved.
 *
 */

#ifndef _SYS_CRED_H
#define _SYS_CRED_H

#pragma ident   "@(#)cred.h     1.21    97/01/09 SMI"   /* SVr4.0 1.8   */

#ifdef _KERNEL
#include <sys/t_lock.h>
#endif /* KERNEL */

#ifdef  __cplusplus
extern "C" {
#endif

/*
 * User credentials.  The size of the cr_groups[] array is configurable
 * but is the same (ngroups_max) for all cred structures; cr_ngroups
 * records the number of elements currently in use, not the array size.
 */
typedef struct cred {
        uint_t  cr_ref;                 /* reference count */
        uid_t   cr_uid;                 /* effective user id */
        gid_t   cr_gid;                 /* effective group id */
        uid_t   cr_ruid;                /* real user id */
        gid_t   cr_rgid;                /* real group id */
        uid_t   cr_suid;                /* "saved" user id (from exec) */
        gid_t   cr_sgid;                /* "saved" group id (from exec) */
        uint_t  cr_ngroups;             /* number of groups in cr_groups */
        gid_t   cr_groups[1];           /* supplementary group list */
} cred_t;

#ifdef _KERNEL

#define CRED()          curthread->t_cred

struct proc;                            /* cred.h is included in proc.h */

extern int ngroups_max;
/*
 * kcred is used when you need root permission.
 */
extern struct cred *kcred;
extern void cred_init(void);
extern void crhold(cred_t *);
extern void crfree(cred_t *);
extern cred_t *crget(void);
extern cred_t *crcopy(cred_t *);
extern void crcopy_to(cred_t *, cred_t *);
extern cred_t *crdup(cred_t *);
extern void crdup_to(cred_t *, cred_t *);
extern cred_t *crgetcred(void);
extern void crset(struct proc *, cred_t *);
extern int suser(cred_t *);
extern int groupmember(gid_t, cred_t *);
extern int hasprocperm(cred_t *, cred_t *);
extern int crcmp(cred_t *, cred_t *);

#endif  /* _KERNEL */

#ifdef  __cplusplus
}
#endif

#endif  /* _SYS_CRED_H */



THATS THE CONTENT OF CRED.H FILE ON SOLARIS FROM  /usr/include/sys/cred.h

aman
0
 
sunnycoderCommented:
sorry .. should have been more specific ...

on the linux machine execute
rpm -qf /path/to/file where file is <sys/fcred.h>

the idea is to know which package installed this file on linux so that we can investigate the usage and purpose
0
 
tfewsterCommented:
amankhan - "Posting a pointer question" does NOT mean "Post a 500 point question in every Topic Area that might be relevant and then repost it a couple of hours later just because you haven't had an immediate response"

From http://www.experts-exchange.com/help.jsp#hi50 :

"The maximum number of points which can be offered for any question is 500 points. ...

Minimum points may be used to "point" users to your question. For example, if you're writing a website in HTML and want to use the same styles for each page, you might ask the question in the HTML topic area. Rather than post a new question in the Cascading Style Sheets topic area, you could post a question worth 20 points there that tells the Experts about your original question. Just be sure and remember to close or delete your "pointer" question when you close the original."

I suggest that you delete all the other questions and create a 20 point "pointer" questions in Unix Programming and maybe Linux Programming.  The other areas are more for system admin questions anyway.

Post all your updates in this question, so that everyone can see what has been suggested and tried before.

Good luck,
tfewster
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now