Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


About cred structure ....

Posted on 2004-08-05
Medium Priority
Last Modified: 2012-05-05
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.."


Question by:amankhan
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11733621
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...
LVL 46

Expert Comment

by:Sjef Bosman
ID: 11733948
And you checked of course with Google? Searching for
    LOCAL_CREDS Solaris
LVL 45

Expert Comment

ID: 11734298
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

rpm -qf /path/to/file

and post back the results
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.


Author Comment

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

LVL 45

Expert Comment

ID: 11735150
is there actually a file in that location ?

did you install something from sources ?

what are the contents of the file ?

Author Comment

ID: 11735282
no sir , but theres a file in solaris



Author Comment

ID: 11735303
/*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/*        All Rights Reserved   */

/*      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" {

 * 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  /* _SYS_CRED_H */


LVL 45

Accepted Solution

sunnycoder earned 1000 total points
ID: 11735463
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
LVL 21

Expert Comment

ID: 11747263
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 :

"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,

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question