Here you have it:
#include
#include
#include
#include
int
main(int argc, char **argv)
{
struct passwd *p;
int e;
e = errno, errno = 0;
p = getpwuid(0);
if (errno) {
fprintf(stdout, "errno is: %u\n", errno);
Why reinvent the wheel?
[root@black ~]# getent passwd 1
daemon:*:1:1:The devil himself:/root:/sbin/nologin
[root@black ~]#
-mike
On May 7, 2013, at 4:06 AM, Friedrich Locke wrote:
> Dear list members,
>
> I am in need to write a simple program to return the passwd entry for a
> given uid nu
On Tuesday 07 May 2013 15:45:55 you wrote:
> On Tue, May 07, 2013 at 03:25:04PM +0200, Remco wrote:
> | The way I read the man page on my OpenBSD 5.2 system, as well as on the
> | www.openbsd.org web site, errno has no specific meaning when getpwuid
> | returns. It only tells you whether it succeed
On Tue, May 07, 2013 at 03:25:04PM +0200, Remco wrote:
| The way I read the man page on my OpenBSD 5.2 system, as well as on the
| www.openbsd.org web site, errno has no specific meaning when getpwuid
| returns. It only tells you whether it succeeded or not, it doesn't say it
| sets errno, nor d
Philip Guenther wrote:
> On Mon, May 6, 2013 at 6:06 PM, Friedrich Locke
> wrote:
>> I am in need to write a simple program to return the passwd entry for a
>> given uid number.
>>
>> Here you have it:
>>
>> #include
>> #include
>> #include
>> #include
>>
>> int
>> main(int argc, char **argv)
mtree wants them to be:
# grep ^pwd.db /etc/mtree/*
/etc/mtree/special:pwd.db type=file mode=0444 uname=root
gname=wheel optional
2013/5/7 noah pugsley
> On Mon, May 6, 2013 at 6:31 PM, Ted Unangst wrote:
>
> > On Mon, May 06, 2013 at 22:06, Friedrich Locke wrote:
> >
> > > e =
On Mon, May 6, 2013 at 7:51 PM, Friedrich Locke
wrote:
> As Noah Pugsley noted: it should have worked, regardless error checking
> code is not right.
>
> As asked:
>
> sioux@scallop$ ls -l /etc/pwd.db /etc/spwd.db
> -rw-r--r-- 1 root wheel1220608 May 1 12:41 /etc/pwd.db
> -rw-r- 1 root
On Mon, May 6, 2013 at 7:51 PM, Friedrich Locke
wrote:
> As Noah Pugsley noted: it should have worked, regardless error checking
> code is not right.
>
> As asked:
>
> sioux@scallop$ ls -l /etc/pwd.db /etc/spwd.db
> -rw-r--r-- 1 root wheel1220608 May 1 12:41 /etc/pwd.db
> -rw-r- 1 root
As Noah Pugsley noted: it should have worked, regardless error checking
code is not right.
As asked:
sioux@scallop$ ls -l /etc/pwd.db /etc/spwd.db
-rw-r--r-- 1 root wheel1220608 May 1 12:41 /etc/pwd.db
-rw-r- 1 root _shadow 1273856 May 1 12:41 /etc/spwd.db
sioux@scallop$
I am run
On Mon, May 6, 2013 at 6:31 PM, Ted Unangst wrote:
> On Mon, May 06, 2013 at 22:06, Friedrich Locke wrote:
>
> > e = errno, errno = 0;
> > p = getpwuid(0);
> > if (errno) {
> > fprintf(stdout, "errno is: %u\n", errno);
> >
> > sioux@lion$ ./pw
> > errno is: 13
> > sioux@lion$
> >
> >
> > Any idei
On Mon, May 06, 2013 at 22:06, Friedrich Locke wrote:
> e = errno, errno = 0;
> p = getpwuid(0);
> if (errno) {
> fprintf(stdout, "errno is: %u\n", errno);
>
> sioux@lion$ ./pw
> errno is: 13
> sioux@lion$
>
>
> Any ideia why openbsd implementation of getpwuid returns error ?
That is not how th
On Mon, May 6, 2013 at 6:06 PM, Friedrich Locke
wrote:
> I am in need to write a simple program to return the passwd entry for a
> given uid number.
>
> Here you have it:
>
> #include
> #include
> #include
> #include
>
> int
> main(int argc, char **argv)
> {
> struct passwd *p;
>
Dear list members,
I am in need to write a simple program to return the passwd entry for a
given uid number.
Here you have it:
#include
#include
#include
#include
int
main(int argc, char **argv)
{
struct passwd *p;
int e;
e = errno, errno = 0;
13 matches
Mail list logo