10.1.5 --- User Privillages Gone

lifegauge

Registered
After updating to 10.1.5, I get the same mounting problems that some other users are getting. When I try to install an applicatin that requires a system folder, I usually get an error that says I do not have sufficient permission. Problem is, I only have one user added in my useraccounts list, and have set it to have admin access (Enable user to administer this computer).

Anyone has similar problems with user privillages after installing 10.1.5?
I hate to do this but everytime I want to install / update a software I'll have to log out, log in as root, install the software, log out, then back in again.

This has been happening since I got 10.1.5, hope someone here can help =|
 
you could try and setup another user id with admin privledges and see if that one has the problem as well. Then bring all your stuff into that profile. But I am not really sure how that will affect ownership/privledges.
 
i've tried setting up another user account like you said, but to no avail =|

don't tell me i have to re-install osx again?

this sucks ..
 
this will probably sound silly but have you tried running fsck on it? Also do you have a disk with os 9 on it that you could boot from and then run norton, tech tool or similar?

you might try going into net info and duplicating your account and retyping the password in the old one.

Anyone else got any good ideas?
 
total 81049
drwxrwxr-x 37 root admin 1214 Jun 7 14:32 Applications
drwxr-xr-x 17 lg unknown 534 Jun 7 03:23 Applications (Mac OS 9)
drwxr-xr-x 7 501 admin 264 Jun 7 03:29 Backup
-rw-rw-r-- 1 root admin 307200 Jun 7 10:48 Desktop DB
-rw-rw-r-- 1 root admin 1817905 Jun 7 10:44 Desktop DF
drwxr-xr-x 2 lg unknown 264 Jun 7 03:00 Desktop Folder
drwxr-xr-x 5 lg unknown 264 Jun 7 03:14 Documents
drwxrwxr-x 32 root admin 1044 Oct 23 2001 Library
drwxrwxr-x 9 root admin 264 Jun 7 10:38 My Software
drwxrwxr-x 6 root admin 264 Jun 5 12:30 Network
drwxrwxr-x 5 root admin 126 Jun 7 03:26 System
drwxr-xr-x 36 lg unknown 1180 Jun 7 10:48 System Folder
drwxr-xr-x 3 lg unknown 264 Jun 7 03:01 TheVolumeSettingsFolder
drwxr-xr-x 8 lg unknown 264 Jun 7 03:01 Trash
drwxrwxr-x 6 root admin 160 Jun 7 03:35 Users
drwxrwxrwt 2 root admin 264 Jun 7 14:13 Volumes
dr-xr-xr-x 1 root wheel 512 Jun 7 16:29 automount
drwxrwxr-x 33 root admin 1078 Jun 5 13:44 bin
drwxrwxr-x 8 root admin 264 Jun 5 23:23 chkstuff117a
lrwxrwxr-t 1 root admin 13 Jun 7 10:48 cores -> private/cores
dr-xr-xr-x 2 root wheel 512 Jun 7 03:03 dev
lrwxrwxr-t 1 root admin 11 Jun 7 10:48 etc -> private/etc
lrwxrwxr-t 1 root admin 9 Jun 7 10:48 mach -> /mach.sym
-r--r--r-- 1 root admin 564768 Jun 7 03:03 mach.sym
-rw-rw-r-- 1 root admin 3169824 May 31 05:52 mach_kernel
drwxrwxr-x 7 root admin 264 Jun 7 03:03 private
drwxrwxr-x 60 root admin 1996 Jun 6 19:28 sbin
lrwxrwxr-t 1 root admin 11 Jun 7 10:48 tmp -> private/tmp
drwxrwxr-x 9 lg unknown 264 Jun 7 14:15 usr
lrwxrwxr-t 1 root admin 11 Jun 7 10:48 var -> private/var
 
Yup, that's precisely what I wanted to see. What it tells me is a number of permissions are in fact incorrect. Have you done a change in the Show Info window, and checked the Apply to all enclosed folders?

For example /bin, /private, and several others should be group wheel, not admin, and should not have group-write capability.

You may have to do a reinstall to correct them. While the problems seen here can be easily fixed, there may well be other problems throughout the filesystem.
 
Yeah, this kind of issue has come up before (it can cause Classic to fail to launch, sudo to stop working, and other problems).
 
Hmm, so you're suggesting that I re-install 10.1.5 or OSX itself?
Or would there be an easier way to settle this problem without re-installing?
 
Hi there,

I though it might be a fun excersise to write a little C program which will report all directories, threir owner, group and modes from a given start-point. It would then be really easy to do a Perl/Python/whatever script that takes the output from a "healthy" machine and restores the permissions on another machine.

I've included the C source below. You can compile it with:
cc -o list_dir_modes list_dir_modes.c
and then call the resulting program with
./list_dir_modes
you can optionally provide a starting directory as the first and only parameter.

------ BEGIN CODE:

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <netinfo/ni.h>
#include <dirent.h>


ni_id getId (void *niHandle, const char *name)
{
ni_id rootId;
ni_id tmpId;
ni_entrylist tmpDirs;
ni_entry *entries;
ni_namelist names;
int count;

ni_root(niHandle, &rootId);
ni_list(niHandle, &rootId, "name", &tmpDirs);
entries = tmpDirs.ni_entrylist_val;
for (count = 0; count < tmpDirs.ni_entrylist_len; count++) {
names = *(entries[count].names);
if (names.ni_namelist_len > 0) {
if (strcmp(name, names.ni_namelist_val[0]) == 0) {
tmpId.nii_object = entries[count].id;
tmpId.nii_instance = NULL;
break;
}
}
}

return tmpId;
}

ni_id getUsersId (void *niHandle)
{
return getId(niHandle, "users");
}

ni_id getGroupsId (void *niHandle)
{
return getId(niHandle, "groups");
}

const char* readById (int id, int type)
{
/* Variables */
void *niHandle;
ni_status niReturnCode;
ni_idlist idList;
char idVal[10];
ni_id rootId;
ni_id tmpId;
ni_id tmpPoint;
int count;
ni_namelist names;
char *retVal;

retVal = "Invalid ID";

niReturnCode = ni_open(NULL, "/", &niHandle);
if (niHandle != NULL) {
ni_root(niHandle, &rootId);
if (type == 0) {
tmpId = getUsersId(niHandle);
} else if (type == 1) {
tmpId = getGroupsId(niHandle);
}
sprintf(idVal, "%d", id);
if (type == 0) {
ni_lookup(niHandle, &tmpId, "uid", idVal, &idList);
} else if (type == 1) {
ni_lookup(niHandle, &tmpId, "gid", idVal, &idList);
}
tmpPoint.nii_object = idList.ni_idlist_val[0];
tmpPoint.nii_instance = NULL;
ni_lookupprop(niHandle, &tmpPoint, "name", &names);
retVal = names.ni_namelist_val[0];
ni_free(niHandle);
} else {
printf("Error opening NI.\n");
printf("%s\n", ni_error(niReturnCode));
}

return retVal;
}

const char *readUser (uid_t uid)
{
return readById((int) uid, 0);
}

const char *readGroup (gid_t gid)
{
return readById((int) gid, 1);
}

void reportStats (const char* fileName)
{
/* Variables */
struct stat myStat;
int retCode;
int userMode = 0;
int groupMode = 0;
int otherMode = 0;
const char *userName;
const char *groupName;
uid_t uid;
gid_t gid;

/* Get stats */
stat(fileName, &myStat);

/* Report stats */
uid = myStat.st_uid;
gid = myStat.st_gid;
userName = readUser(uid);
groupName = readGroup(gid);
if ((myStat.st_mode & S_IRUSR) == S_IRUSR) {
userMode += 1;
}
if ((myStat.st_mode & S_IWUSR) == S_IWUSR) {
userMode += 2;
}
if ((myStat.st_mode & S_IXUSR) == S_IXUSR) {
userMode += 4;
}
if ((myStat.st_mode & S_IRGRP) == S_IRGRP) {
groupMode += 1;
}
if ((myStat.st_mode & S_IWGRP) == S_IWGRP) {
groupMode += 2;
}
if ((myStat.st_mode & S_IXGRP) == S_IXGRP) {
groupMode += 4;
}
if ((myStat.st_mode & S_IROTH) == S_IROTH) {
otherMode += 1;
}
if ((myStat.st_mode & S_IWOTH) == S_IWOTH) {
otherMode += 2;
}
if ((myStat.st_mode & S_IXOTH) == S_IXOTH) {
otherMode += 4;
}
printf("%s %s %s %d%d%d\n", fileName, userName, groupName, userMode,
groupMode, otherMode);
}

void scanDirectory (const char* dirName)
{
DIR *dirPointer;
struct dirent *dirEntry;
char *fullName;

dirPointer = opendir(dirName);
while ((dirEntry = readdir(dirPointer)) != NULL) {
if (strcmp(dirEntry->d_name, ".") != 0 &&
strcmp(dirEntry->d_name, "..") != 0 &&
dirEntry->d_type == DT_DIR) {
fullName = malloc(sizeof(char) * (strlen(dirName) +
strlen(dirEntry->d_name) + 1));
strcpy(fullName, dirName);
if (fullName[strlen(fullName) -1] != '/') {
strcat(fullName, "/");
}
strcat(fullName, dirEntry->d_name);
reportStats(fullName);
scanDirectory(fullName);
free(fullName);
}
}

closedir(dirPointer);
}

int main (int argc, const char **argv)
{
int count;
char *startdir;

if (argc > 1) {
startdir = (char*) argv[1];
} else {
startdir = "/";
}
scanDirectory(startdir);

return 0;
}


------ END CODE


C

PS: Sorry this has been a while coming, but I've been busy doing paid work and its been ages since I've programmed C :))))

PPS: This program uses NI to get the user name and group name, so it can't be compiled for other *nix systems without some minor changes ....
 
Back
Top