httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@apache.org
Subject cvs commit: httpd-2.0/os/beos beosd.c beosd.h
Date Thu, 08 Nov 2001 22:56:27 GMT
dreid       01/11/08 14:56:26

  Modified:    os/beos  beosd.c beosd.h
  Log:
  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.
  
  Revision  Changes    Path
  1.17      +12 -63    httpd-2.0/os/beos/beosd.c
  
  Index: beosd.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/os/beos/beosd.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- beosd.c	2001/02/16 04:26:43	1.16
  +++ beosd.c	2001/11/08 22:56:26	1.17
  @@ -67,55 +67,14 @@
   
   /* 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 @@
   }
   
   
  -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
  +     */
   }
  
  
  
  1.10      +9 -7      httpd-2.0/os/beos/beosd.h
  
  Index: beosd.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/os/beos/beosd.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- beosd.h	2001/04/26 00:28:13	1.9
  +++ beosd.h	2001/11/08 22:56:26	1.10
  @@ -81,15 +81,17 @@
   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 */
  
  
  

Mime
View raw message