Solved

About cred structure ....

Posted on 2004-08-05
9
313 Views
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.."

thanks
aman


 
0
Comment
Question by:amankhan
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
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
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
And you checked of course with Google? Searching for
    LOCAL_CREDS Solaris
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
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
 

Author Comment

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


0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
is there actually a file in that location ?

did you install something from sources ?

what are the contents of the file ?
0
 

Author Comment

by:amankhan
Comment Utility
no sir , but theres a file in solaris

/usr/include/sys/cred.h

aman
0
 

Author Comment

by:amankhan
Comment Utility
/*      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
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
Comment Utility
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
 
LVL 20

Expert Comment

by:tfewster
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops 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.

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now