Compare commits
4 Commits
0.37
...
openrc-0.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba457f1fed | ||
|
|
722871c0ae | ||
|
|
d670dbddf7 | ||
|
|
f1a19aed78 |
@@ -1,3 +1,3 @@
|
|||||||
NAME= openrc
|
NAME= openrc
|
||||||
VERSION= 0.9.9
|
VERSION= 0.9.9.2
|
||||||
PKG= ${NAME}-${VERSION}
|
PKG= ${NAME}-${VERSION}
|
||||||
|
|||||||
@@ -128,10 +128,10 @@ rc_getline(char **line, size_t *len, FILE *fp)
|
|||||||
}
|
}
|
||||||
librc_hidden_def(rc_getline)
|
librc_hidden_def(rc_getline)
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
char *
|
char *
|
||||||
rc_proc_getent(const char *ent)
|
rc_proc_getent(const char *ent)
|
||||||
{
|
{
|
||||||
|
#ifdef __linux__
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char *proc, *p, *value = NULL;
|
char *proc, *p, *value = NULL;
|
||||||
size_t i, len;
|
size_t i, len;
|
||||||
@@ -171,9 +171,11 @@ rc_proc_getent(const char *ent)
|
|||||||
free(proc);
|
free(proc);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
librc_hidden_def(rc_proc_getent)
|
librc_hidden_def(rc_proc_getent)
|
||||||
#endif
|
|
||||||
|
|
||||||
RC_STRINGLIST *
|
RC_STRINGLIST *
|
||||||
rc_config_list(const char *file)
|
rc_config_list(const char *file)
|
||||||
|
|||||||
@@ -360,12 +360,10 @@ bool rc_newer_than(const char *, const char *, time_t *, char *);
|
|||||||
* @return true if source is older than target, otherwise false */
|
* @return true if source is older than target, otherwise false */
|
||||||
bool rc_older_than(const char *, const char *, time_t *, char *);
|
bool rc_older_than(const char *, const char *, time_t *, char *);
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
/*! Read variables/values from /proc/cmdline
|
/*! Read variables/values from /proc/cmdline
|
||||||
* @param value
|
* @param value
|
||||||
* @return pointer to the value, otherwise NULL */
|
* @return pointer to the value, otherwise NULL */
|
||||||
char *rc_proc_getent(const char *);
|
char *rc_proc_getent(const char *);
|
||||||
#endif
|
|
||||||
|
|
||||||
/*! Update the cached dependency tree if it's older than any init script,
|
/*! Update the cached dependency tree if it's older than any init script,
|
||||||
* its configuration file or an external configuration file the init script
|
* its configuration file or an external configuration file the init script
|
||||||
|
|||||||
@@ -1178,20 +1178,18 @@ start_stop_daemon(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PAM
|
#ifdef HAVE_PAM
|
||||||
if (changeuser != NULL)
|
if (changeuser != NULL) {
|
||||||
pamr = pam_start("start-stop-daemon",
|
pamr = pam_start("start-stop-daemon",
|
||||||
changeuser, &conv, &pamh);
|
changeuser, &conv, &pamh);
|
||||||
else
|
|
||||||
pamr = pam_start("start-stop-daemon",
|
|
||||||
"nobody", &conv, &pamh);
|
|
||||||
|
|
||||||
if (pamr == PAM_SUCCESS)
|
if (pamr == PAM_SUCCESS)
|
||||||
pamr = pam_acct_mgmt(pamh, PAM_SILENT);
|
pamr = pam_acct_mgmt(pamh, PAM_SILENT);
|
||||||
if (pamr == PAM_SUCCESS)
|
if (pamr == PAM_SUCCESS)
|
||||||
pamr = pam_open_session(pamh, PAM_SILENT);
|
pamr = pam_open_session(pamh, PAM_SILENT);
|
||||||
if (pamr != PAM_SUCCESS)
|
if (pamr != PAM_SUCCESS)
|
||||||
eerrorx("%s: pam error: %s",
|
eerrorx("%s: pam error: %s",
|
||||||
applet, pam_strerror(pamh, pamr));
|
applet, pam_strerror(pamh, pamr));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gid && setgid(gid))
|
if (gid && setgid(gid))
|
||||||
@@ -1219,15 +1217,17 @@ start_stop_daemon(int argc, char **argv)
|
|||||||
rc_stringlist_add(env_list, environ[i++]);
|
rc_stringlist_add(env_list, environ[i++]);
|
||||||
|
|
||||||
#ifdef HAVE_PAM
|
#ifdef HAVE_PAM
|
||||||
pamenv = (const char *const *)pam_getenvlist(pamh);
|
if (changeuser != NULL) {
|
||||||
if (pamenv) {
|
pamenv = (const char *const *)pam_getenvlist(pamh);
|
||||||
while (*pamenv) {
|
if (pamenv) {
|
||||||
/* Don't add strings unless they set a var */
|
while (*pamenv) {
|
||||||
if (strchr(*pamenv, '='))
|
/* Don't add strings unless they set a var */
|
||||||
putenv(xstrdup(*pamenv));
|
if (strchr(*pamenv, '='))
|
||||||
else
|
putenv(xstrdup(*pamenv));
|
||||||
unsetenv(*pamenv);
|
else
|
||||||
pamenv++;
|
unsetenv(*pamenv);
|
||||||
|
pamenv++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1304,7 +1304,7 @@ start_stop_daemon(int argc, char **argv)
|
|||||||
setsid();
|
setsid();
|
||||||
execvp(exec, argv);
|
execvp(exec, argv);
|
||||||
#ifdef HAVE_PAM
|
#ifdef HAVE_PAM
|
||||||
if (pamr == PAM_SUCCESS)
|
if (changeuser != NULL && pamr == PAM_SUCCESS)
|
||||||
pam_close_session(pamh, PAM_SILENT);
|
pam_close_session(pamh, PAM_SILENT);
|
||||||
#endif
|
#endif
|
||||||
eerrorx("%s: failed to exec `%s': %s",
|
eerrorx("%s: failed to exec `%s': %s",
|
||||||
|
|||||||
Reference in New Issue
Block a user