* Creating an NSS module
@ 2003-04-28 18:54 Darío Mariani
2003-04-28 23:09 ` Glynn Clements
0 siblings, 1 reply; 5+ messages in thread
From: Darío Mariani @ 2003-04-28 18:54 UTC (permalink / raw)
To: linux-c-programming
Hello:
I'm creating an NSS module for the passwd and group databases. I
implemented the following functions:
nss_status _nss_authon_setgrent()
nss_status _nss_authon_endgrent()
nss_status _nss_authon_getgrent_r (group * gr, char * buffer, size_t
buflen, int * errnop)
nss_status _nss_authon_getgrnam_r (const char * name, struct group * gr,
char * buffer, size_t buflen, int * errnop)
nss_status _nss_authon_getgrgid_r (const gid_t gid, struct group * gr,
char * buffer, size_t buflen, int *errnop)
nss_status _nss_authon_setpwent()
nss_status _nss_authon_endpwent()
nss_status _nss_authon_getpwent_r (passwd * pw, char * buffer, size_t
buflen, int * errnop)
nss_status _nss_authon_getpwnam_r (const char * name, struct passwd *
result, char * buffer, size_t buflen, int * errnop)
nss_status _nss_authon_getpwuid_r (uid_t uid, passwd * result, char *
buffer, size_t buflen, int * errnop)
The libc functions getgrent(), getgrnam(), getgrgid() and the finger
command work, but the groups command doesn't and also the chgrp doesn't
work for an user other than root. Any ideas on what happens? Am I
missing some function?
Thanks,
Darío
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Creating an NSS module
2003-04-28 18:54 Creating an NSS module Darío Mariani
@ 2003-04-28 23:09 ` Glynn Clements
2003-05-21 15:05 ` Interprocess communication through stdin Darío Mariani
2003-08-05 17:00 ` MIME library Darío Mariani
0 siblings, 2 replies; 5+ messages in thread
From: Glynn Clements @ 2003-04-28 23:09 UTC (permalink / raw)
To: Darío Mariani; +Cc: linux-c-programming
Darío Mariani wrote:
> I'm creating an NSS module for the passwd and group databases. I
> implemented the following functions:
[snip]
> The libc functions getgrent(), getgrnam(), getgrgid() and the finger
> command work, but the groups command doesn't and also the chgrp doesn't
> work for an user other than root. Any ideas on what happens? Am I
> missing some function?
I suspect that the problem is that you haven't logged in using the new
groups.
The "id" command (used by the "groups" script) lists the supplementary
GIDs of the current process. Similarly, the chgrp program uses the
chown() system call to change a file's group; this insists that the
new group is among the process' supplementary GIDs.
The supplementary GID's are set upon login (usually via the
initgroups() libc function), and are inherited by child processes. The
initgroups() function uses the setgroups() system call to set the
process' supplementary GIDs as defined in the groups database. The
setgroups() system call requires root privilege, so ordinary programs
can't use it.
Changing the groups database (whether you change the data directly or,
as in this case, change the mechanism by which it is obtained) will
not affect the supplementary GIDs of any existing process. You will
have to "log in" (whether via login, telnetd/sshd, xdm etc) in order
for any changes in the groups database to take effect for
authentication purposes.
OTOH, programs which use the groups database directly (i.e. the
getgr*() functions) will reflect any changes immediately.
--
Glynn Clements <glynn.clements@virgin.net>
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Interprocess communication through stdin
2003-04-28 23:09 ` Glynn Clements
@ 2003-05-21 15:05 ` Darío Mariani
2003-05-21 17:43 ` Glynn Clements
2003-08-05 17:00 ` MIME library Darío Mariani
1 sibling, 1 reply; 5+ messages in thread
From: Darío Mariani @ 2003-05-21 15:05 UTC (permalink / raw)
To: linux-c-programming
Hello:
I'm implementing a program that spawns a child process. I was
wondering if instead of creating a pipe for interprocess communication
is there any way to send data to the child by its stdin. The problem is
that this child process is a program that accepts input from the stdin
and I do not want modify it or have a named pipe redirected to its stdin.
Thanks,
Darío
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Interprocess communication through stdin
2003-05-21 15:05 ` Interprocess communication through stdin Darío Mariani
@ 2003-05-21 17:43 ` Glynn Clements
0 siblings, 0 replies; 5+ messages in thread
From: Glynn Clements @ 2003-05-21 17:43 UTC (permalink / raw)
To: Darío Mariani; +Cc: linux-c-programming
Darío Mariani wrote:
> I'm implementing a program that spawns a child process. I was
> wondering if instead of creating a pipe for interprocess communication
> is there any way to send data to the child by its stdin. The problem is
> that this child process is a program that accepts input from the stdin
> and I do not want modify it or have a named pipe redirected to its stdin.
Connect an unnamed pipe to the child's stdin:
int fds[2];
pid_t pid;
pipe(fds);
pid = fork();
if (pid > 0)
{
/* parent */
close(fds[0]);
}
else
{
/* child */
close(fds[1]);
dup2(fds[0], STDIN_FILENO);
close(fds[0]);
execl(prog, arg1, arg2, NULL);
}
/* write() to fds[1] to send data to child */
[Error checking omitted for brevity.]
--
Glynn Clements <glynn.clements@virgin.net>
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* MIME library
2003-04-28 23:09 ` Glynn Clements
2003-05-21 15:05 ` Interprocess communication through stdin Darío Mariani
@ 2003-08-05 17:00 ` Darío Mariani
1 sibling, 0 replies; 5+ messages in thread
From: Darío Mariani @ 2003-08-05 17:00 UTC (permalink / raw)
To: linux-c-programming
Hello:
Does anyone know of a MIME library that's more or less well
documented and has a free license (GPL, BSD, etc.)?
Thanks,
Darío
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-08-05 17:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-28 18:54 Creating an NSS module Darío Mariani
2003-04-28 23:09 ` Glynn Clements
2003-05-21 15:05 ` Interprocess communication through stdin Darío Mariani
2003-05-21 17:43 ` Glynn Clements
2003-08-05 17:00 ` MIME library Darío Mariani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).