Ucrit_addPid( sessionid.pid );
- fstr_sprintf(uid_str, "%d", sessionid.uid);
- fstr_sprintf(gid_str, "%d", sessionid.gid);
+ fstr_sprintf(uid_str, "%u", (unsigned int)sessionid.uid);
+ fstr_sprintf(gid_str, "%u", (unsigned int)sessionid.gid);
d_printf("%-7s %-12s %-12s %-12s (%s)\n",
procid_str_static(&sessionid.pid),
};
TALLOC_CTX *frame = talloc_stackframe();
int ret = 0;
+ struct messaging_context *msg_ctx;
sec_init();
load_case_tables();
Ucrit_addUid( nametouid(username) );
if (verbose) {
- d_printf("using configfile = %s\n", dyn_CONFIGFILE);
+ d_printf("using configfile = %s\n", get_dyn_CONFIGFILE());
}
- if (!lp_load(dyn_CONFIGFILE,False,False,False,True)) {
- fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
+ if (!lp_load_initial_only(get_dyn_CONFIGFILE())) {
+ fprintf(stderr, "Can't load %s - run testparm to debug it\n",
+ get_dyn_CONFIGFILE());
ret = -1;
goto done;
}
* the db_open() calls further down.
*/
- messaging_init(NULL, procid_self(), event_context_init(NULL));
-
+ msg_ctx = messaging_init(NULL, procid_self(),
+ event_context_init(NULL));
+
+ if (msg_ctx == NULL) {
+ fprintf(stderr, "messaging_init failed\n");
+ ret = -1;
+ goto done;
+ }
+
+ if (!lp_load(get_dyn_CONFIGFILE(),False,False,False,True)) {
+ fprintf(stderr, "Can't load %s - run testparm to debug it\n",
+ get_dyn_CONFIGFILE());
+ ret = -1;
+ goto done;
+ }
+
switch (profile_only) {
case 'P':
/* Dump profile data */
if ( show_processes ) {
struct db_context *db;
db = db_open(NULL, lock_path("sessionid.tdb"), 0,
- TDB_DEFAULT, O_RDWR, 0644);
+ TDB_CLEAR_IF_FIRST, O_RDONLY, 0644);
if (!db) {
d_printf("sessionid.tdb not initialised\n");
} else {
- d_printf("\nSamba version %s\n",SAMBA_VERSION_STRING);
+ d_printf("\nSamba version %s\n",samba_version_string());
d_printf("PID Username Group Machine \n");
d_printf("-------------------------------------------------------------------\n");
+ if (lp_security() == SEC_SHARE) {
+ d_printf(" <processes do not show up in "
+ "anonymous mode>\n");
+ }
db->traverse_read(db, traverse_sessionid, NULL);
TALLOC_FREE(db);
int result;
struct db_context *db;
db = db_open(NULL, lock_path("locking.tdb"), 0,
- TDB_DEFAULT, O_RDONLY, 0);
+ TDB_CLEAR_IF_FIRST, O_RDONLY, 0);
if (!db) {
d_printf("%s not initialised\n",