linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug: cant write to solaris partitioned disk
@ 2002-11-14 21:15 H.Rosmanith (Kernel Mailing List)
  0 siblings, 0 replies; only message in thread
From: H.Rosmanith (Kernel Mailing List) @ 2002-11-14 21:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Herbert Rosmanith, H.Rosmanith (Kernel Mailing List), Ferdinand Goldmann


hi,

after not being active on a solaris machine, I forgot the root-password.
since the machine is a blade100, I just plugged the harddisk to my
linux-workstation, mounted the filesystem with ufs, but no matter what,
I was not able to reset the root-password by modifying /mnt/etc/shadow,
allthough I had CONFIG_EXPERIMENTAL=y and CONFIG_UFS_FS_WRITE=y and
specifed -o ufstype=sun on the mount-command-line.

therefore, I tried a different approach: search the partition for
the string "root:cryptpw:1234:::::" and clear the root-pw with
"dd". so I specified "dd if=newrootpw of=/dev/hdc1 bs=4096 seek=10794 count=1"
(the 10794 are the result of the previous search-operation). since I
couldnt get "dd" to work, I wrote a small helperprog, which does an
"lseek(fd,4096*10794,SEEK_SET)" and then write the new shadow-entry with
the cleared root-pw. but that one failed too!! the error-code I got
was -EBADF. quite strange.

so I tried another approach, which worked: copy the *whole* solaris-partition
to my linux-disk, make a copy of that, modify the root-pw on the copy and
copy the whole partition back. that worked, and I am now logged in as
root with no password on the blade100 again (phew!).

so, what the bug seems to me: it is not possible to write() to a solaris
partition when previously, an lseek() operation has been performed, in
contrast, write()ing without lseek()ing *is* possible.

bug or feature?

please comment/fix, thank you,
herbert rosmanith






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-11-14 21:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-14 21:15 bug: cant write to solaris partitioned disk H.Rosmanith (Kernel Mailing List)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).