summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Reid <dreid@apache.org>2001-11-08 22:56:26 +0000
committerDavid Reid <dreid@apache.org>2001-11-08 22:56:26 +0000
commitcfbe3f2f29235f619f0398cb9dd562be4f26c482 (patch)
treece49e83a5aef214c729fc57c89db8d2ac1d89b22
parent236df424d31478405b4136ff2f4cb137afd0e301 (diff)
downloadhttpd-cfbe3f2f29235f619f0398cb9dd562be4f26c482.tar.gz
Get the daemon code working again for User/Group on BeOS,
but make them no-op's until we get multi-user for beos... (yeah, right) Suggested by Roy. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91811 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--os/beos/beosd.c75
-rw-r--r--os/beos/beosd.h16
2 files changed, 21 insertions, 70 deletions
diff --git a/os/beos/beosd.c b/os/beos/beosd.c
index c29be7f1a3..09a2cf8e9c 100644
--- a/os/beos/beosd.c
+++ b/os/beos/beosd.c
@@ -67,55 +67,14 @@ beosd_config_rec beosd_config;
/* Set group privileges.
*
- * Note that we use the username as set in the config files, rather than
- * the lookup of to uid --- the same uid may have multiple passwd entries,
- * with different sets of groups for each.
+ * Note that until we get the multi-user situation sorted on beos,
+ * this is just a no-op to allow common configuration files!
*/
#if B_BEOS_VERSION < 0x0460
static int set_group_privs(void)
{
-
- if (!geteuid()) {
- char *name;
-
- /* Get username if passed as a uid */
-
- if (beosd_config.user_name[0] == '#') {
- struct passwd *ent;
- uid_t uid = atoi(&beosd_config.user_name[1]);
-
- if ((ent = getpwuid(uid)) == NULL) {
- ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
- "getpwuid: couldn't determine user name from uid %u, "
- "you probably need to modify the User directive",
- (unsigned)uid);
- return -1;
- }
-
- name = ent->pw_name;
- }
- else
- name = beosd_config.user_name;
-
- if (setgid(beosd_config.group_id) == -1) {
- ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
- "setgid: unable to set group id to Group %u",
- (unsigned)beosd_config.group_id);
- return -1;
- }
-
- /* Reset `groups' attributes. */
-
-#ifdef HAVE_INITGROUPS
- if (initgroups(name, beosd_config.group_id) == -1) {
- ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
- "initgroups: unable to set groups for User %s "
- "and Group %u", name, (unsigned)beosd_config.group_id);
- return -1;
- }
-#endif
- }
+ /* no-op */
return 0;
}
#endif
@@ -131,33 +90,23 @@ int beosd_setup_child(void)
}
-const char *beosd_set_user(cmd_parms *cmd, void *dummy, char *arg)
+AP_DECLARE(const char *) beosd_set_user(cmd_parms *cmd,
+ void *dummy, const char *arg)
{
- const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
- if (err != NULL) {
- return err;
- }
-
- beosd_config.user_name = arg;
- beosd_config.user_id = ap_uname2id(arg);
+ /* no-op */
return NULL;
}
-const char *beosd_set_group(cmd_parms *cmd, void *dummy, char *arg)
+AP_DECLARE(const char *) beosd_set_group(cmd_parms *cmd,
+ void *dummy, const char *arg)
{
- const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
- if (err != NULL) {
- return err;
- }
-
- beosd_config.group_id = ap_gname2id(arg);
-
+ /* no-op */
return NULL;
}
void beosd_pre_config(void)
{
- beosd_config.user_name = DEFAULT_USER;
- beosd_config.user_id = ap_uname2id(DEFAULT_USER);
- beosd_config.group_id = ap_gname2id(DEFAULT_GROUP);
+ /* Until the multi-user situation on BeOS is fixed,
+ simply have a no-op here to allow for common conf files
+ */
}
diff --git a/os/beos/beosd.h b/os/beos/beosd.h
index 31b055bd7f..f30b3247a9 100644
--- a/os/beos/beosd.h
+++ b/os/beos/beosd.h
@@ -81,15 +81,17 @@ extern beosd_config_rec beosd_config;
void beosd_detach(void);
int beosd_setup_child(void);
void beosd_pre_config(void);
-const char *beosd_set_user(cmd_parms *cmd, void *dummy, char *arg);
-const char *beosd_set_group(cmd_parms *cmd, void *dummy, char *arg);
+AP_DECLARE(const char *) beosd_set_user (cmd_parms *cmd, void *dummy,
+ const char *arg);
+AP_DECLARE(const char *) beosd_set_group(cmd_parms *cmd, void *dummy,
+ const char *arg);
#define beosd_killpg(x, y) (kill (-(x), (y)))
-#define UNIX_DAEMON_COMMANDS \
-{ "User", beosd_set_user, NULL, RSRC_CONF, TAKE1, \
- "Effective user id for this server"}, \
-{ "Group", beosd_set_group, NULL, RSRC_CONF, TAKE1, \
- "Effective group id for this server"}, \
+#define BEOS_DAEMON_COMMANDS \
+AP_INIT_TAKE1("User", beosd_set_user, NULL, RSRC_CONF, \
+ "Effective user id for this server (NO-OP)"), \
+AP_INIT_TAKE1("Group", beosd_set_group, NULL, RSRC_CONF, \
+ "Effective group id for this server (NO-OP)"),
#endif /* BEOSD_H */