Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
704d8476
Commit
704d8476
authored
26 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
fix for broken passwd fields
Rev: src/modules/system/passwords.c:1.21
parent
d3ede41b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/system/passwords.c
+14
-10
14 additions, 10 deletions
src/modules/system/passwords.c
with
14 additions
and
10 deletions
src/modules/system/passwords.c
+
14
−
10
View file @
704d8476
/*
/*
* $Id: passwords.c,v 1.2
0
1998/07/2
0 12:57:12 gr
ubb
a
Exp $
* $Id: passwords.c,v 1.2
1
1998/07/2
1 00:27:54 h
ubb
e
Exp $
*
*
* Password handling for Pike.
* Password handling for Pike.
*
*
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include
"system_machine.h"
#include
"system_machine.h"
#include
"system.h"
#include
"system.h"
RCSID
(
"$Id: passwords.c,v 1.2
0
1998/07/2
0 12:57:12 gr
ubb
a
Exp $"
);
RCSID
(
"$Id: passwords.c,v 1.2
1
1998/07/2
1 00:27:54 h
ubb
e
Exp $"
);
#include
"module_support.h"
#include
"module_support.h"
#include
"interpret.h"
#include
"interpret.h"
...
@@ -107,6 +107,8 @@ struct group *getgrnam(char *name)
...
@@ -107,6 +107,8 @@ struct group *getgrnam(char *name)
*/
*/
#if defined(HAVE_GETPWNAM) || defined(HAVE_GETPWUID) || defined(HAVE_GETPWENT)
#if defined(HAVE_GETPWNAM) || defined(HAVE_GETPWUID) || defined(HAVE_GETPWENT)
#define SAFE_PUSH_TEXT(X) do { char *text_ = (X); if(text_) push_text(text_); else push_constant_text(""); }while(0);
void
push_pwent
(
struct
passwd
*
ent
)
void
push_pwent
(
struct
passwd
*
ent
)
{
{
if
(
!
ent
)
if
(
!
ent
)
...
@@ -114,8 +116,8 @@ void push_pwent(struct passwd *ent)
...
@@ -114,8 +116,8 @@ void push_pwent(struct passwd *ent)
push_int
(
0
);
push_int
(
0
);
return
;
return
;
}
}
push_text
(
ent
->
pw_name
);
SAFE_PUSH_TEXT
(
ent
->
pw_name
);
#ifdef HAVE_GETSPNAM
#ifdef HAVE_GETSPNAM
if
(
!
strcmp
(
ent
->
pw_passwd
,
"x"
))
if
(
!
strcmp
(
ent
->
pw_passwd
,
"x"
))
{
{
...
@@ -129,16 +131,18 @@ void push_pwent(struct passwd *ent)
...
@@ -129,16 +131,18 @@ void push_pwent(struct passwd *ent)
push_text
(
"x"
);
push_text
(
"x"
);
}
else
}
else
#endif
/* Shadow password support */
#endif
/* Shadow password support */
push_text
(
ent
->
pw_passwd
);
SAFE_PUSH_TEXT
(
ent
->
pw_passwd
);
push_int
(
ent
->
pw_uid
);
push_int
(
ent
->
pw_uid
);
push_int
(
ent
->
pw_gid
);
push_int
(
ent
->
pw_gid
);
#ifdef HAVE_PW_GECOS
#ifdef HAVE_PW_GECOS
push_text
(
ent
->
pw_gecos
);
SAFE_PUSH_TEXT
(
ent
->
pw_gecos
);
#else
/* !HAVE_PW_GECOS */
#else
/* !HAVE_PW_GECOS */
push_text
(
"Mister Anonymous"
);
push_text
(
"Mister Anonymous"
);
#endif
/* HAVE_PW_GECOS */
#endif
/* HAVE_PW_GECOS */
push_text
(
ent
->
pw_dir
);
SAFE_PUSH_TEXT
(
ent
->
pw_dir
);
push_text
(
ent
->
pw_shell
);
SAFE_PUSH_TEXT
(
ent
->
pw_shell
);
f_aggregate
(
7
);
f_aggregate
(
7
);
}
}
#endif
#endif
...
@@ -151,8 +155,8 @@ void push_grent(struct group *ent)
...
@@ -151,8 +155,8 @@ void push_grent(struct group *ent)
push_int
(
0
);
push_int
(
0
);
return
;
return
;
}
}
push_text
(
ent
->
gr_name
);
SAFE_PUSH_TEXT
(
ent
->
gr_name
);
push_text
(
ent
->
gr_passwd
);
SAFE_PUSH_TEXT
(
ent
->
gr_passwd
);
push_int
(
ent
->
gr_gid
);
push_int
(
ent
->
gr_gid
);
{
{
char
**
cp
=
ent
->
gr_mem
;
char
**
cp
=
ent
->
gr_mem
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment